diff options
author | Guillaume Peoc'h <guillaume.peoch@sonarsource.com> | 2022-07-20 17:12:43 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-07-25 20:03:58 +0000 |
commit | b27a1274bfc7babaec18bbd46571a5b1cd037c91 (patch) | |
tree | 7089b59f9c5a277241fe16e65b71fbfd63ecacd3 /server | |
parent | 9cd44988c23e6533cbf34e5acc6d225e706f1707 (diff) | |
download | sonarqube-b27a1274bfc7babaec18bbd46571a5b1cd037c91.tar.gz sonarqube-b27a1274bfc7babaec18bbd46571a5b1cd037c91.zip |
SONAR-17061 Add PCI report tab to the “Security Reports” page
Diffstat (limited to 'server')
16 files changed, 265 insertions, 38 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts index 2b4751b9b8e..39e584cb163 100644 --- a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts @@ -53,6 +53,8 @@ describe('serialize/deserialize', () => { languages: ['a', 'b'], owaspTop10: ['a', 'b'], 'owaspTop10-2021': ['a', 'b'], + 'pciDss-3.2': ['a', 'b'], + 'pciDss-4.0': ['a', 'b'], projects: ['a', 'b'], resolutions: ['a', 'b'], resolved: true, @@ -81,6 +83,8 @@ describe('serialize/deserialize', () => { languages: 'a,b', owaspTop10: 'a,b', 'owaspTop10-2021': 'a,b', + 'pciDss-3.2': 'a,b', + 'pciDss-4.0': 'a,b', projects: 'a,b', resolutions: 'a,b', rules: 'a,b', diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap index 65ca848f341..7bb7a106350 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap @@ -140,6 +140,8 @@ exports[`should show warnning when not all projects are accessible 1`] = ` "languages": Array [], "owaspTop10": Array [], "owaspTop10-2021": Array [], + "pciDss-3.2": Array [], + "pciDss-4.0": Array [], "projects": Array [], "resolutions": Array [], "resolved": true, diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx index ca13e67a7e3..b093d6a73e1 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx @@ -40,7 +40,7 @@ import { renderSonarSourceSecurityCategory } from '../../../helpers/security-standard'; import { Facet } from '../../../types/issues'; -import { SecurityStandard, Standards, StandardType } from '../../../types/security'; +import { SecurityStandard, Standards } from '../../../types/security'; import { Dict } from '../../../types/types'; import { formatFacetStat, Query, STANDARDS } from '../utils'; @@ -83,7 +83,7 @@ type StatsProp = | 'cweStats' | 'sansTop25Stats' | 'sonarsourceSecurityStats'; -type ValuesProp = StandardType; +type ValuesProp = 'owaspTop10-2021' | 'owaspTop10' | 'sansTop25' | 'sonarsourceSecurity' | 'cwe'; const INITIAL_FACET_COUNT = 15; export default class StandardFacet extends React.PureComponent<Props, State> { @@ -96,7 +96,9 @@ export default class StandardFacet extends React.PureComponent<Props, State> { 'owaspTop10-2021': {}, sansTop25: {}, cwe: {}, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} } }; @@ -133,7 +135,9 @@ export default class StandardFacet extends React.PureComponent<Props, State> { owaspTop10, sansTop25, cwe, - sonarsourceSecurity + sonarsourceSecurity, + 'pciDss-3.2': pciDss3_2, + 'pciDss-4.0': pciDss4_0 }: Standards) => { if (this.mounted) { this.setState({ @@ -142,7 +146,9 @@ export default class StandardFacet extends React.PureComponent<Props, State> { owaspTop10, sansTop25, cwe, - sonarsourceSecurity + sonarsourceSecurity, + 'pciDss-3.2': pciDss3_2, + 'pciDss-4.0': pciDss4_0 } }); } diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts index e89d4b011ca..2ace6b60664 100644 --- a/server/sonar-web/src/main/js/apps/issues/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/utils.ts @@ -35,7 +35,7 @@ import { scrollToElement } from '../../helpers/scrolling'; import { get, save } from '../../helpers/storage'; import { isDefined } from '../../helpers/types'; import { Facet, RawFacet } from '../../types/issues'; -import { SecurityStandard, StandardType } from '../../types/security'; +import { SecurityStandard } from '../../types/security'; import { Dict, Issue, Paging, RawQuery } from '../../types/types'; import { UserBase } from '../../types/users'; @@ -54,6 +54,8 @@ export interface Query { languages: string[]; owaspTop10: string[]; 'owaspTop10-2021': string[]; + 'pciDss-3.2': string[]; + 'pciDss-4.0': string[]; projects: string[]; resolutions: string[]; resolved: boolean; @@ -70,12 +72,6 @@ export interface Query { } export const STANDARDS = 'standards'; -export const STANDARD_TYPES: StandardType[] = [ - SecurityStandard.OWASP_TOP10, - SecurityStandard.SANS_TOP25, - SecurityStandard.CWE, - SecurityStandard.SONARSOURCE -]; // allow sorting by CREATION_DATE only const parseAsSort = (sort: string) => (sort === 'CREATION_DATE' ? 'CREATION_DATE' : ''); @@ -93,10 +89,13 @@ export function parseQuery(query: RawQuery): Query { cwe: parseAsArray(query.cwe, parseAsString), directories: parseAsArray(query.directories, parseAsString), files: parseAsArray(query.files, parseAsString), + inNewCodePeriod: parseAsBoolean(query.inNewCodePeriod, false), issues: parseAsArray(query.issues, parseAsString), languages: parseAsArray(query.languages, parseAsString), owaspTop10: parseAsArray(query.owaspTop10, parseAsString), 'owaspTop10-2021': parseAsArray(query['owaspTop10-2021'], parseAsString), + 'pciDss-3.2': parseAsArray(query['pciDss-3.2'], parseAsString), + 'pciDss-4.0': parseAsArray(query['pciDss-4.0'], parseAsString), projects: parseAsArray(query.projects, parseAsString), resolutions: parseAsArray(query.resolutions, parseAsString), resolved: parseAsBoolean(query.resolved), @@ -104,7 +103,6 @@ export function parseQuery(query: RawQuery): Query { sansTop25: parseAsArray(query.sansTop25, parseAsString), scopes: parseAsArray(query.scopes, parseAsString), severities: parseAsArray(query.severities, parseAsString), - inNewCodePeriod: parseAsBoolean(query.inNewCodePeriod, false), sonarsourceSecurity: parseAsArray(query.sonarsourceSecurity, parseAsString), sort: parseAsSort(query.s), statuses: parseAsArray(query.statuses, parseAsString), @@ -140,6 +138,8 @@ export function serializeQuery(query: Query): RawQuery { languages: serializeStringArray(query.languages), owaspTop10: serializeStringArray(query.owaspTop10), 'owaspTop10-2021': serializeStringArray(query['owaspTop10-2021']), + 'pciDss-3.2': serializeStringArray(query['pciDss-3.2']), + 'pciDss-4.0': serializeStringArray(query['pciDss-4.0']), projects: serializeStringArray(query.projects), resolutions: serializeStringArray(query.resolutions), resolved: query.resolved ? undefined : 'false', @@ -257,7 +257,12 @@ export function shouldOpenStandardsFacet( export function shouldOpenStandardsChildFacet( openFacets: Dict<boolean>, query: Partial<Query>, - standardType: SecurityStandard + standardType: + | SecurityStandard.CWE + | SecurityStandard.OWASP_TOP10 + | SecurityStandard.OWASP_TOP10_2021 + | SecurityStandard.SANS_TOP25 + | SecurityStandard.SONARSOURCE ): boolean { const filter = query[standardType]; return ( @@ -283,7 +288,19 @@ function isFilteredBySecurityIssueTypes(query: Partial<Query>): boolean { } function isOneStandardChildFacetOpen(openFacets: Dict<boolean>, query: Partial<Query>): boolean { - return STANDARD_TYPES.some(standardType => - shouldOpenStandardsChildFacet(openFacets, query, standardType) + return [ + SecurityStandard.OWASP_TOP10, + SecurityStandard.SANS_TOP25, + SecurityStandard.CWE, + SecurityStandard.SONARSOURCE + ].some( + ( + standardType: + | SecurityStandard.CWE + | SecurityStandard.OWASP_TOP10 + | SecurityStandard.OWASP_TOP10_2021 + | SecurityStandard.SANS_TOP25 + | SecurityStandard.SONARSOURCE + ) => shouldOpenStandardsChildFacet(openFacets, query, standardType) ); } 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 e8fbee0ee0c..bbae623ea3b 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 @@ -98,7 +98,9 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> { [SecurityStandard.OWASP_TOP10_2021]: {}, [SecurityStandard.SANS_TOP25]: {}, [SecurityStandard.SONARSOURCE]: {}, - [SecurityStandard.CWE]: {} + [SecurityStandard.CWE]: {}, + [SecurityStandard.PCI_DSS_3_2]: {}, + [SecurityStandard.PCI_DSS_4_0]: {} }, filters: { ...this.constructFiltersFromProps(props), @@ -451,6 +453,8 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> { [SecurityStandard.SANS_TOP25]: undefined, [SecurityStandard.SONARSOURCE]: undefined, [SecurityStandard.OWASP_TOP10_2021]: undefined, + [SecurityStandard.PCI_DSS_3_2]: undefined, + [SecurityStandard.PCI_DSS_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 17229150d88..434ed274597 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 @@ -59,6 +59,8 @@ exports[`should render correctly 1`] = ` "cwe": Object {}, "owaspTop10": Object {}, "owaspTop10-2021": Object {}, + "pciDss-3.2": Object {}, + "pciDss-4.0": Object {}, "sansTop25": Object {}, "sonarsourceSecurity": 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 fb069b020e5..c9edd7eb43b 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 @@ -168,6 +168,16 @@ exports[`should render correctly when filtered by category or cwe: category 1`] "title": "Sensitive Data Exposure", }, }, + "pciDss-3.2": Object { + "1": Object { + "title": " Install and maintain a firewall configuration to protect cardholder data", + }, + }, + "pciDss-4.0": Object { + "2": Object { + "title": "This is useless...", + }, + }, "sansTop25": Object { "insecure-interaction": Object { "title": "Insecure Interaction Between Components", @@ -300,6 +310,16 @@ exports[`should render correctly when filtered by category or cwe: cwe 1`] = ` "title": "Sensitive Data Exposure", }, }, + "pciDss-3.2": Object { + "1": Object { + "title": " Install and maintain a firewall configuration to protect cardholder data", + }, + }, + "pciDss-4.0": Object { + "2": Object { + "title": "This is useless...", + }, + }, "sansTop25": Object { "insecure-interaction": Object { "title": "Insecure Interaction Between Components", 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 3629750ec3f..290851dab54 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 @@ -78,7 +78,9 @@ function shallowRender(props: Partial<HotspotSimpleListProps> = {}) { a3: { title: 'A3 - Sensitive Data Exposure' } }, sansTop25: {}, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-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 42b83d6517a..02f28614fd0 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 @@ -22,6 +22,8 @@ import { renderCWECategory, renderOwaspTop102021Category, renderOwaspTop10Category, + renderPciDss32Category, + renderPciDss40Category, renderSansTop25Category, renderSonarSourceSecurityCategory } from '../../helpers/security-standard'; @@ -52,7 +54,9 @@ export const SECURITY_STANDARDS = [ SecurityStandard.OWASP_TOP10, SecurityStandard.OWASP_TOP10_2021, SecurityStandard.SANS_TOP25, - SecurityStandard.CWE + SecurityStandard.CWE, + SecurityStandard.PCI_DSS_3_2, + SecurityStandard.PCI_DSS_4_0 ]; export const SECURITY_STANDARD_RENDERER = { @@ -60,7 +64,9 @@ export const SECURITY_STANDARD_RENDERER = { [SecurityStandard.OWASP_TOP10_2021]: renderOwaspTop102021Category, [SecurityStandard.SANS_TOP25]: renderSansTop25Category, [SecurityStandard.SONARSOURCE]: renderSonarSourceSecurityCategory, - [SecurityStandard.CWE]: renderCWECategory + [SecurityStandard.CWE]: renderCWECategory, + [SecurityStandard.PCI_DSS_3_2]: renderPciDss32Category, + [SecurityStandard.PCI_DSS_4_0]: renderPciDss40Category }; export function mapRules(rules: Array<{ key: string; name: string }>): Dict<string> { diff --git a/server/sonar-web/src/main/js/helpers/__tests__/security-standard-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/security-standard-test.ts index 1d9c3de6667..38c76db0106 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/security-standard-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/security-standard-test.ts @@ -22,6 +22,8 @@ import { renderCWECategory, renderOwaspTop102021Category, renderOwaspTop10Category, + renderPciDss32Category, + renderPciDss40Category, renderSansTop25Category, renderSonarSourceSecurityCategory } from '../security-standard'; @@ -39,7 +41,9 @@ describe('renderCWECategory', () => { owaspTop10: {}, 'owaspTop10-2021': {}, sansTop25: {}, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} }; it('should render cwe categories correctly', () => { expect(renderCWECategory(standards, '1004')).toEqual( @@ -60,7 +64,9 @@ describe('renderOwaspTop10Category', () => { }, 'owaspTop10-2021': {}, sansTop25: {}, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} }; it('should render owasp categories correctly', () => { expect(renderOwaspTop10Category(standards, 'a1')).toEqual('A1 - Injection'); @@ -80,7 +86,9 @@ describe('renderOwaspTop102021Category', () => { } }, sansTop25: {}, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} }; it('should render owasp categories correctly', () => { expect(renderOwaspTop102021Category(standards, 'a1')).toEqual('A1 - Injection'); @@ -90,6 +98,50 @@ describe('renderOwaspTop102021Category', () => { }); }); +describe('renderPciDss32Category', () => { + const standards: Standards = { + cwe: {}, + owaspTop10: {}, + 'owaspTop10-2021': {}, + sansTop25: {}, + sonarsourceSecurity: {}, + 'pciDss-3.2': { + '1': { + title: 'Install and maintain a firewall configuration to protect cardholder data' + } + }, + 'pciDss-4.0': {} + }; + it('should render Pci Dss 3.2 correctly', () => { + expect(renderPciDss32Category(standards, '1')).toEqual( + '1 - Install and maintain a firewall configuration to protect cardholder data' + ); + expect(renderPciDss32Category(standards, '1.1')).toEqual('1.1'); + }); +}); + +describe('renderPciDss40Category', () => { + const standards: Standards = { + cwe: {}, + owaspTop10: {}, + 'owaspTop10-2021': {}, + sansTop25: {}, + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': { + '1': { + title: 'Install and maintain a firewall configuration to protect cardholder data' + } + } + }; + it('should render Pci Dss 4.0 correctly', () => { + expect(renderPciDss40Category(standards, '1')).toEqual( + '1 - Install and maintain a firewall configuration to protect cardholder data' + ); + expect(renderPciDss40Category(standards, '1.1')).toEqual('1.1'); + }); +}); + describe('renderSansTop25Category', () => { const standards: Standards = { cwe: {}, @@ -100,7 +152,9 @@ describe('renderSansTop25Category', () => { title: 'Insecure Interaction Between Components' } }, - sonarsourceSecurity: {} + sonarsourceSecurity: {}, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} }; it('should render sans categories correctly', () => { expect(renderSansTop25Category(standards, 'insecure-interaction')).toEqual( @@ -127,7 +181,9 @@ describe('renderSonarSourceSecurityCategory', () => { others: { title: 'Others' } - } + }, + 'pciDss-3.2': {}, + 'pciDss-4.0': {} }; it('should render sonarsource categories correctly', () => { expect(renderSonarSourceSecurityCategory(standards, 'xss')).toEqual( diff --git a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts index 807dda6edad..8842d94dfed 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts @@ -124,10 +124,12 @@ describe('#getComponentSecurityHotspotsUrl', () => { getComponentSecurityHotspotsUrl(SIMPLE_COMPONENT_KEY, { inNewCodePeriod: 'true', [SecurityStandard.OWASP_TOP10_2021]: 'a1', - [SecurityStandard.CWE]: 'a1', + [SecurityStandard.CWE]: '213', [SecurityStandard.OWASP_TOP10]: 'a1', - [SecurityStandard.SANS_TOP25]: 'a1', - [SecurityStandard.SONARSOURCE]: 'a1', + [SecurityStandard.SANS_TOP25]: 'insecure-interaction', + [SecurityStandard.SONARSOURCE]: 'command-injection', + [SecurityStandard.PCI_DSS_3_2]: '4.2', + [SecurityStandard.PCI_DSS_4_0]: '4.1', ignoredParam: '1234' }) ).toEqual( @@ -137,10 +139,12 @@ describe('#getComponentSecurityHotspotsUrl', () => { id: SIMPLE_COMPONENT_KEY, inNewCodePeriod: 'true', [SecurityStandard.OWASP_TOP10_2021]: 'a1', - [SecurityStandard.SONARSOURCE]: 'a1', [SecurityStandard.OWASP_TOP10]: 'a1', - [SecurityStandard.SANS_TOP25]: 'a1', - [SecurityStandard.CWE]: 'a1' + [SecurityStandard.SONARSOURCE]: 'command-injection', + [SecurityStandard.SANS_TOP25]: 'insecure-interaction', + [SecurityStandard.CWE]: '213', + [SecurityStandard.PCI_DSS_3_2]: '4.2', + [SecurityStandard.PCI_DSS_4_0]: '4.1' }) }) ); diff --git a/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts b/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts index 2169d5e7e2c..57026803263 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/security-hotspots.ts @@ -183,6 +183,16 @@ export function mockStandards(): Standards { rce: { title: 'Code Injection (RCE)' } + }, + 'pciDss-3.2': { + '1': { + title: ' Install and maintain a firewall configuration to protect cardholder data' + } + }, + 'pciDss-4.0': { + '2': { + title: 'This is useless...' + } } }; } diff --git a/server/sonar-web/src/main/js/helpers/security-standard.ts b/server/sonar-web/src/main/js/helpers/security-standard.ts index 7a8b78a8ac8..870f62e934f 100644 --- a/server/sonar-web/src/main/js/helpers/security-standard.ts +++ b/server/sonar-web/src/main/js/helpers/security-standard.ts @@ -29,9 +29,8 @@ export function renderCWECategory(standards: Standards, category: string): strin return `CWE-${category}`; } else if (category === 'unknown') { return record.title; - } else { - return `CWE-${category} - ${record.title}`; } + return `CWE-${category} - ${record.title}`; } export function renderOwaspTop10Category( @@ -82,9 +81,24 @@ export function renderSonarSourceSecurityCategory( return addPrefix(category.toUpperCase(), 'SONAR', withPrefix); } else if (category === 'others') { return record.title; - } else { - return addPrefix(record.title, 'SONAR', withPrefix); } + return addPrefix(record.title, 'SONAR', withPrefix); +} + +export function renderPciDss32Category(standards: Standards, category: string): string { + const record = standards['pciDss-3.2'][category]; + if (!record) { + return category; + } + return `${category} - ${record.title}`; +} + +export function renderPciDss40Category(standards: Standards, category: string): string { + const record = standards['pciDss-4.0'][category]; + if (!record) { + return category; + } + return `${category} - ${record.title}`; } function addPrefix(title: string, prefix: string, withPrefix: boolean) { diff --git a/server/sonar-web/src/main/js/helpers/standards.json b/server/sonar-web/src/main/js/helpers/standards.json index 8d99f422089..da5a0b8341f 100644 --- a/server/sonar-web/src/main/js/helpers/standards.json +++ b/server/sonar-web/src/main/js/helpers/standards.json @@ -3966,5 +3966,81 @@ "others": { "title": "Others" } + }, + "pciDss-3.2": { + "1": { + "title": "Install and maintain a firewall configuration to protect cardholder data" + }, + "2": { + "title": "Do not use vendor-supplied defaults for system passwords and other security parameters" + }, + "3": { + "title": "Protect stored cardholder data" + }, + "4": { + "title": "Encrypt transmission of cardholder data across open, public networks" + }, + "5": { + "title": "Protect all systems against malware and regularly update anti-virus software or programs" + }, + "6": { + "title": "Develop and maintain secure systems and applications" + }, + "7": { + "title": "Restrict access to cardholder data by business need to know" + }, + "8": { + "title": "Identify and authenticate access to system components" + }, + "9": { + "title": "Restrict physical access to cardholder data" + }, + "10": { + "title": "Track and monitor all access to network resources and cardholder data" + }, + "11": { + "title": "Regularly test security systems and processes" + }, + "12": { + "title": "Maintain a policy that addresses information security for all personnel" + } + }, + "pciDss-4.0": { + "1": { + "title": "Install and Maintain Network Security Controls" + }, + "2": { + "title": "Apply Secure Configurations to All System Components" + }, + "3": { + "title": "Protect Stored Account Data" + }, + "4": { + "title": "Protect Cardholder Data with Strong Cryptography During Transmission Over Open, Public Networks" + }, + "5": { + "title": "Protect All Systems and Networks from Malicious Software Sections" + }, + "6": { + "title": "Develop and Maintain Secure Systems and Software" + }, + "7": { + "title": "Restrict Access to System Components and Cardholder Data by Business Need to Know" + }, + "8": { + "title": "Identify Users and Authenticate Access to System Components" + }, + "9": { + "title": "Restrict Physical Access to Cardholder Data" + }, + "10": { + "title": "Log and Monitor All Access to System Components and Cardholder Data" + }, + "11": { + "title": "Test Security of Systems and Networks Regularly" + }, + "12": { + "title": "Support Information Security with Organizational Policies and Programs" + } } }
\ No newline at end of file diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts index 1cc4e644fb0..73d69cfc6bb 100644 --- a/server/sonar-web/src/main/js/helpers/urls.ts +++ b/server/sonar-web/src/main/js/helpers/urls.ts @@ -208,10 +208,12 @@ export function getComponentSecurityHotspotsUrl(componentKey: string, query: Que file, ...pick(query, [ SecurityStandard.OWASP_TOP10_2021, - SecurityStandard.SONARSOURCE, SecurityStandard.OWASP_TOP10, + SecurityStandard.SONARSOURCE, SecurityStandard.SANS_TOP25, - SecurityStandard.CWE + SecurityStandard.CWE, + SecurityStandard.PCI_DSS_3_2, + SecurityStandard.PCI_DSS_4_0 ]) }), hash: '' diff --git a/server/sonar-web/src/main/js/types/security.ts b/server/sonar-web/src/main/js/types/security.ts index 6bec38d0265..b77e256874c 100644 --- a/server/sonar-web/src/main/js/types/security.ts +++ b/server/sonar-web/src/main/js/types/security.ts @@ -24,7 +24,9 @@ export enum SecurityStandard { OWASP_TOP10 = 'owaspTop10', SANS_TOP25 = 'sansTop25', SONARSOURCE = 'sonarsourceSecurity', - CWE = 'cwe' + CWE = 'cwe', + PCI_DSS_3_2 = 'pciDss-3.2', + PCI_DSS_4_0 = 'pciDss-4.0' } export type StandardType = SecurityStandard; |