aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorSteve Marion <steve.marion@sonarsource.com>2022-10-07 15:48:50 +0200
committersonartech <sonartech@sonarsource.com>2022-10-10 20:03:09 +0000
commit57a44ace74f9472a5d74478f9156946bc403ccc5 (patch)
tree080502db2b1d41fcdc327baf3b7816f9e97f6b36 /server/sonar-server-common
parent3421334ce91e9260738ed5007d0e1396d8a968d5 (diff)
downloadsonarqube-57a44ace74f9472a5d74478f9156946bc403ccc5.tar.gz
sonarqube-57a44ace74f9472a5d74478f9156946bc403ccc5.zip
SONAR-17399 add owasp asvs 4.0 level support in hotspot search API
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityStandards.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityStandards.java b/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityStandards.java
index e450c323e92..1661d13cf7a 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityStandards.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityStandards.java
@@ -330,12 +330,16 @@ public final class SecurityStandards {
return new SecurityStandards(standards, cwe, sqCategory, ignoredSQCategories);
}
- public static Set<String> getRequirementsForCategoryAndLevel(OwaspAsvs category, int level) {
+ public static Set<String> getRequirementsForCategoryAndLevel(String category, int level) {
return OWASP_ASVS_40_REQUIREMENTS_BY_LEVEL.get(level).stream()
- .filter(req -> req.startsWith(category.category() + "."))
+ .filter(req -> req.startsWith(category + "."))
.collect(Collectors.toSet());
}
+ public static Set<String> getRequirementsForCategoryAndLevel(OwaspAsvs category, int level) {
+ return getRequirementsForCategoryAndLevel(category.category(), level);
+ }
+
private static Set<String> getMatchingStandards(Set<String> securityStandards, String prefix) {
return securityStandards.stream()
.filter(s -> s.startsWith(prefix))