aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/security-hotspots
diff options
context:
space:
mode:
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>2022-09-29 12:08:27 +0200
committerPhilippe Perrin <philippe.perrin@sonarsource.com>2022-10-07 12:13:56 +0200
commite9494f3e121102ff5ede94eda6bf142e16dfc0fd (patch)
tree37f50df5e1fd4c1d491d0b812931e8af66f79b92 /server/sonar-web/src/main/js/apps/security-hotspots
parent82c04f95dad7dc92a24cf35a496e96cddab99740 (diff)
downloadsonarqube-e9494f3e121102ff5ede94eda6bf142e16dfc0fd.tar.gz
sonarqube-e9494f3e121102ff5ede94eda6bf142e16dfc0fd.zip
SONAR-17393 Add new security tab for OWASP ASVS
Diffstat (limited to 'server/sonar-web/src/main/js/apps/security-hotspots')
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsApp-test.tsx.snap1
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsAppRenderer-test.tsx.snap10
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/utils.ts7
5 files changed, 21 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
index 260afe05f41..d4669b90065 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
@@ -99,7 +99,8 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> {
[SecurityStandard.SONARSOURCE]: {},
[SecurityStandard.CWE]: {},
[SecurityStandard.PCI_DSS_3_2]: {},
- [SecurityStandard.PCI_DSS_4_0]: {}
+ [SecurityStandard.PCI_DSS_4_0]: {},
+ [SecurityStandard.OWASP_ASVS_4_0]: {}
},
filters: {
...this.constructFiltersFromProps(props),
@@ -454,6 +455,7 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> {
[SecurityStandard.OWASP_TOP10_2021]: undefined,
[SecurityStandard.PCI_DSS_3_2]: undefined,
[SecurityStandard.PCI_DSS_4_0]: undefined,
+ [SecurityStandard.OWASP_ASVS_4_0]: undefined,
file: undefined
}
});
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsApp-test.tsx.snap
index 4b6a0206bfb..1891d1068b1 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsApp-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsApp-test.tsx.snap
@@ -56,6 +56,7 @@ exports[`should render correctly 1`] = `
standards={
Object {
"cwe": Object {},
+ "owaspAsvs-4.0": Object {},
"owaspTop10": Object {},
"owaspTop10-2021": Object {},
"pciDss-3.2": Object {},
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsAppRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsAppRenderer-test.tsx.snap
index 9a9fc621891..6e3c4c9c0db 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsAppRenderer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/__tests__/__snapshots__/SecurityHotspotsAppRenderer-test.tsx.snap
@@ -145,6 +145,11 @@ exports[`should render correctly when filtered by category or cwe: category 1`]
"title": "No CWE associated",
},
},
+ "owaspAsvs-4.0": Object {
+ "1": Object {
+ "title": "New OWASP ASVS cat 1",
+ },
+ },
"owaspTop10": Object {
"a1": Object {
"title": "Injection",
@@ -286,6 +291,11 @@ exports[`should render correctly when filtered by category or cwe: cwe 1`] = `
"title": "No CWE associated",
},
},
+ "owaspAsvs-4.0": Object {
+ "1": Object {
+ "title": "New OWASP ASVS cat 1",
+ },
+ },
"owaspTop10": Object {
"a1": Object {
"title": "Injection",
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx
index 9a660270786..29a57bf93fb 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/HotspotSimpleList-test.tsx
@@ -79,7 +79,8 @@ function shallowRender(props: Partial<HotspotSimpleListProps> = {}) {
sansTop25: {},
sonarsourceSecurity: {},
'pciDss-3.2': {},
- 'pciDss-4.0': {}
+ 'pciDss-4.0': {},
+ 'owaspAsvs-4.0': {}
}}
{...props}
/>
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/utils.ts b/server/sonar-web/src/main/js/apps/security-hotspots/utils.ts
index 02f28614fd0..e425b2e8d94 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/utils.ts
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/utils.ts
@@ -20,6 +20,7 @@
import { flatten, groupBy, sortBy } from 'lodash';
import {
renderCWECategory,
+ renderOwaspAsvs40Category,
renderOwaspTop102021Category,
renderOwaspTop10Category,
renderPciDss32Category,
@@ -56,7 +57,8 @@ export const SECURITY_STANDARDS = [
SecurityStandard.SANS_TOP25,
SecurityStandard.CWE,
SecurityStandard.PCI_DSS_3_2,
- SecurityStandard.PCI_DSS_4_0
+ SecurityStandard.PCI_DSS_4_0,
+ SecurityStandard.OWASP_ASVS_4_0
];
export const SECURITY_STANDARD_RENDERER = {
@@ -66,7 +68,8 @@ export const SECURITY_STANDARD_RENDERER = {
[SecurityStandard.SONARSOURCE]: renderSonarSourceSecurityCategory,
[SecurityStandard.CWE]: renderCWECategory,
[SecurityStandard.PCI_DSS_3_2]: renderPciDss32Category,
- [SecurityStandard.PCI_DSS_4_0]: renderPciDss40Category
+ [SecurityStandard.PCI_DSS_4_0]: renderPciDss40Category,
+ [SecurityStandard.OWASP_ASVS_4_0]: renderOwaspAsvs40Category
};
export function mapRules(rules: Array<{ key: string; name: string }>): Dict<string> {