Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CPG reports for CPG2. New CSF 2 colors. #4330

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<ng-container *transloco="let t">
<div *ngFor="let d of model?.domains">
<div class="cpg-domain-bar page-break" [style.color]="colorSvc.textColor(backgroundColor(d.groupingId))"
[style.background-color]="backgroundColor(d.groupingId)">
[style.background-color]="backgroundColor(d.groupingId)" [style.borderColor]="backgroundColor(d.groupingId)">
{{d.title}}
</div>

<table *ngFor="let q of d.questions" class="cpg-table">
<tr>
<th style="width: 45%" [style.color]="colorSvc.textColor(backgroundColor(d.groupingId))"
<th style="width: 45%;" [style.borderLeftColor]="backgroundColor(d.groupingId)" [style.color]="colorSvc.textColor(backgroundColor(d.groupingId))"
[style.background-color]="backgroundColor(d.groupingId)">
<div class="d-flex flex-row justify-content-between">
<div class="d-flex flex-row">
Expand All @@ -53,7 +53,7 @@
[style.background-color]="backgroundColor(d.groupingId)">
{{t('reports.core.cpg.report.current assessment') | uppercase}}
</th>
<th style="width: 30%" [style.color]="colorSvc.textColor(backgroundColor(d.groupingId))"
<th style="width: 30%" [style.borderRightColor]="backgroundColor(d.groupingId)" [style.color]="colorSvc.textColor(backgroundColor(d.groupingId))"
[style.background-color]="backgroundColor(d.groupingId)">
{{t('reports.core.cpg.report.notes') | uppercase}}
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOFTWARE.
text-transform: uppercase;
margin-bottom: 2rem;
padding: 1rem;
border-top: 1px solid #ccc !important;
border-top: none !important;
}

.cpg-table {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,35 @@ export class CpgPracticeTableComponent implements OnInit {
* Returns the color for the CSF function of the group.
* This is specific to CPG grouping IDs.
*
* The colors were slightly modified in CSF 2.0.
*
* As SSG models are added to CSET the new grouping codes will be
* added to this logic.
*/
backgroundColor(groupId: number): string {

// CPG 2.0
switch (groupId) {
case 567:
// govern
return this.colorSvc.nistCsfFuncColor('GV-2');
case 568:
// identify
return this.colorSvc.nistCsfFuncColor('ID-2');
case 569:
// protect
return this.colorSvc.nistCsfFuncColor('PR-2');
case 570:
return this.colorSvc.nistCsfFuncColor('DE-2');
case 571:
// respond
return this.colorSvc.nistCsfFuncColor('RS-2');
case 572:
// recover
return this.colorSvc.nistCsfFuncColor('RC-2');


// CPG 1.0
case 200:
case 560:
// identify
Expand All @@ -94,12 +118,17 @@ export class CpgPracticeTableComponent implements OnInit {
case 564:
// recover
return this.colorSvc.nistCsfFuncColor('RC');


// SSG - IT
case 565:
// SSG - IT Software Development
return '#305496';
case 566:
case 566:
// SSG - IT Product Design
return '#548235';


default:
return '#6BA443';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ export class ReportsComponent implements OnInit, AfterViewInit {
this.currentSectionId = 'MVRA';
} else if (this.assessSvc.usesMaturityModel('CPG') && !this.isMobile) {
this.currentSectionId = 'CPG';
} else if (this.assessSvc.usesMaturityModel('CPG2') && !this.isMobile) {
this.currentSectionId = 'CPG';
} else if (this.assessSvc.usesMaturityModel('VADR') && !this.isMobile) {
this.currentSectionId = 'VADR';
} else if (this.assessSvc.usesMaturityModel('C2M2') && !this.isMobile) {
Expand Down
22 changes: 22 additions & 0 deletions CSETWebNg/src/app/services/color.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@ export class ColorService {
* anywhere CSF colors are displayed in CSET.
*/
nistCsfFuncColor(func: string) {

// CSF 2.0 colors
if (func.endsWith('-2')) {
switch (func) {
case 'GV-2':
return '#f9f39b';
case 'ID-2':
return '#4cb3e0';
case 'PR-2':
return '#918cea';
case 'DE-2':
return '#fab647';
case 'RS-2':
return '#e47677';
case 'RC-2':
return '#7ef49e';
default:
return '#FFFFFF';
}
}

// CSF 1.0 colors
switch (func) {
case 'ID':
return '#355C9B';
Expand Down
6 changes: 3 additions & 3 deletions CSETWebNg/src/assets/navigation/workflow-omni.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<node d="maturity questions" id="maturity-questions" path="assessment/{:id}/maturity-questions" visible="OPTION:MATURITY MATURITY-NONE(1,10,8,9,14,13,17)" />

<!-- Bonus model (SSG) -->
<node d="ssg" ssg="true" id="maturity-questions-bonus" path="assessment/{:id}/maturity-questions/bonus" visible="MATURITY-ANY(11) SECTOR-ANY(1,19,13,28)" />
<node d="ssg" ssg="true" id="maturity-questions-bonus" path="assessment/{:id}/maturity-questions/bonus" visible="MATURITY-ANY(11,21) SECTOR-ANY(1,19,13,28)" />



Expand Down Expand Up @@ -405,8 +405,8 @@


<!-- Results - CPG -->
<node d="performance summary" id="cpg-summary-page" path="assessment/{:id}/results/cpg-summary-page" visible="MATURITY:11" />
<node d="security practice checklist" id="cpg-practices-page" path="assessment/{:id}/results/cpg-practices-page" visible="MATURITY:11" />
<node d="performance summary" id="cpg-summary-page" path="assessment/{:id}/results/cpg-summary-page" visible="MATURITY-ANY(11,21)" />
<node d="security practice checklist" id="cpg-practices-page" path="assessment/{:id}/results/cpg-practices-page" visible="MATURITY-ANY(11,21)" />

<!-- Results - SD02 Series -->
<node displaytext="SD02 Series Pipeline Answer Summary" id="sd-answer-summary" path="assessment/{:id}/results/sd-answer-summary" visible="MATURITY:14" />
Expand Down
Loading