我如何测试 SonarQube 以了解它在 spring 启动应用程序中捕获安全问题的实际效果如何?

How can I test SonarQube to see how well it actually works for catching security issues in a spring boot app?

我们使用 SonarQube 来扫描安全漏洞(和其他东西)。我想知道 SonarQube 是否真的在捕捉重要的安全问题。我开始像这样一对一地测试问题:

@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        // disable csrf
        .csrf().disable()
        // use stateless sessions
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)

        // Enable CORS
        .and().cors()
        .and().headers().xssProtection().disable()
        .and().headers().contentTypeOptions().disable()
        .and().headers().frameOptions().disable();
}

然后,我会使用 SonarQube 扫描我的代码,看看它是否标记了我引入的那些安全问题。 (目前,我只对安全问题感兴趣)

问题是,存在太多不同的漏洞。我要找的是类似“Juice shop" or "Damn vulnerable web application”的东西。我想要一个网络应用程序(最好是在 Java Spring 引导程序中编写),其中有大量安全漏洞,我可以将其输入 SonarQube 并查看它捕获了哪些问题以及没有捕获到哪些问题。

有没有这样的应用程序?

是的,那里有故意易受攻击的 spring 引导应用程序。你可以从对比安全检查这个。希望它能满足您的测试需求:

https://github.com/Contrast-Security-OSS/vulnerable-spring-boot-application/

"Deliberately insecure web application webgoat 8" 看起来也不错:

https://www.cyberpunk.rs/deliberately-insecure-web-application-webgoat-8