【问题标题】:SonarQube shows a security error in Spring Framework controllers and in Spring Framework Application main classSonarQube 在 Spring Framework 控制器和 Spring Framework Application 主类中显示安全错误
【发布时间】:2019-02-24 21:06:03
【问题描述】:

我是否应该认真对待这个安全警告,这个警告会出现在每个控制器中

https://rules.sonarsource.com/java/RSPEC-4529

当我声明一个这样的控制器时

@RequestMapping(path = "/profile", method = RequestMethod.GET) 
public UserProfile getUserProfile(String name) {
...
}

这个警告出现在应用程序类中

https://rules.sonarsource.com/java/RSPEC-4823

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

【问题讨论】:

    标签: java spring spring-boot spring-mvc sonarqube


    【解决方案1】:

    是的,您应该认真对待安全警告。至少对于企业应用程序。

    如果您开发此应用程序是为了学习一些东西,那么这完全是您的选择。否则,保护 HTTP 端点是最佳实践。

    SonarQube hotspot 规则可帮助您识别所有显示安全漏洞的端点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      • 2016-07-19
      • 2015-06-21
      • 2020-09-09
      • 1970-01-01
      • 2016-09-18
      相关资源
      最近更新 更多