Skip to content

Commit 7bc3af9

Browse files
Merge branch 'master' into gsoc-2023
2 parents 88bb029 + 0be57de commit 7bc3af9

36 files changed

+2990
-1622
lines changed

Development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2222

2323
- We follow the coding style defined by [ESLint](https://eslint.org/).
2424
- We also use [Prettier](https://prettier.io/docs/en/index.html) as our opinionated code formatter.
25-
25+
- To validate the schemas of the DSOMM yaml files in the IDE, it is recommended to use the VS Code extension [redhat.vscode-yaml](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). The schemas are stored in /src/assets/YAML/schemas
2626

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ Attackers are intelligent and creative, equipped with new technologies and purpo
1010

1111
# Usage
1212

13-
Go to https://dsomm.timo-pagel.de.
13+
Go to https://dsomm.owasp.org.
1414

1515
* _matrix_ shows the dimensions, subdimensions and activities are described.
16-
* _Implementation Levels_ can be used to measure the current implementation level by clicking on the specific activities which have been performed.
17-
* _Ease and Value of Implementation_ is used for the maturity model development to see the ease and value of each activity to be able to compare it with activities within the subdimension and activities from other subdimensions.
18-
* _Dependenies_ shows the dependencies between activities
19-
* _Useage_ describes the dimensions
20-
* _Full Report_ prints all activities to be able to print it
16+
* _Implementation Levels_ can be used to show the current implementation level by clicking on the specific activities which have been performed (it is recommended to use a gitops-like flow)
17+
* _Mappings_ Shows mappings to other standards and provides the ability to download an excel sheet
18+
* _Useage_ describes how to use DSOMM
2119

2220
In this [video](https://www.youtube.com/watch?v=tX9RHZ_O5NU) Timo Pagel describes different strategic approaches for your secure DevOps strategy. The use OWASP DSOMM in combination with [OWASP SAMM](https//owaspsamm.org) is explained.
2321

src/app/component/activity-description/activity-description.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
}
1515
.teams-implemented-list {
1616
list-style: none;
17-
}
17+
}

src/app/component/activity-description/activity-description.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ <h1>
1010
</div>
1111

1212
<mat-accordion multi="true">
13+
<mat-expansion-panel>
14+
<mat-expansion-panel-header>
15+
<mat-panel-title>
16+
<b>UUID</b>
17+
</mat-panel-title>
18+
</mat-expansion-panel-header>
19+
<p [innerHTML]="currentActivity.uuid"></p>
20+
</mat-expansion-panel>
21+
1322
<mat-expansion-panel [expanded]="true">
1423
<mat-expansion-panel-header>
1524
<mat-panel-title>

src/app/component/activity-description/activity-description.component.spec.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,22 @@ describe('ActivityDescriptionComponent', () => {
4040
expect(heading.textContent).toContain(testSubDimension);
4141
});
4242

43+
it('check if UUID is being genenrated', () => {
44+
const testUUID = '00000000-0000-0000-0000-000000000000';
45+
component.currentActivity.uuid = testUUID;
46+
fixture.detectChanges();
47+
const HTMLElement: HTMLElement = fixture.nativeElement;
48+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
49+
expect(contentDisplayedinParagraphTag[0].textContent).toContain(testUUID);
50+
});
51+
4352
it('check if description is being genenrated', () => {
4453
const testDescription = 'Sample Description';
4554
component.currentActivity.description = testDescription;
4655
fixture.detectChanges();
4756
const HTMLElement: HTMLElement = fixture.nativeElement;
4857
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
49-
expect(contentDisplayedinParagraphTag[0].textContent).toContain(
58+
expect(contentDisplayedinParagraphTag[1].textContent).toContain(
5059
testDescription
5160
);
5261
});
@@ -57,7 +66,7 @@ describe('ActivityDescriptionComponent', () => {
5766
fixture.detectChanges();
5867
const HTMLElement: HTMLElement = fixture.nativeElement;
5968
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
60-
expect(contentDisplayedinParagraphTag[1].textContent).toContain(testRisk);
69+
expect(contentDisplayedinParagraphTag[2].textContent).toContain(testRisk);
6170
});
6271

6372
it('check if measure is being genenrated', () => {
@@ -66,7 +75,7 @@ describe('ActivityDescriptionComponent', () => {
6675
fixture.detectChanges();
6776
const HTMLElement: HTMLElement = fixture.nativeElement;
6877
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
69-
expect(contentDisplayedinParagraphTag[2].textContent).toContain(
78+
expect(contentDisplayedinParagraphTag[3].textContent).toContain(
7079
testMeasure
7180
);
7281
});
@@ -77,7 +86,7 @@ describe('ActivityDescriptionComponent', () => {
7786
fixture.detectChanges();
7887
const HTMLElement: HTMLElement = fixture.nativeElement;
7988
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
80-
expect(contentDisplayedinParagraphTag[3].textContent).toContain(
89+
expect(contentDisplayedinParagraphTag[4].textContent).toContain(
8190
testImplementationGuide
8291
);
8392
});
@@ -88,7 +97,7 @@ describe('ActivityDescriptionComponent', () => {
8897
fixture.detectChanges();
8998
const HTMLElement: HTMLElement = fixture.nativeElement;
9099
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
91-
expect(contentDisplayedinParagraphTag[6].textContent).toContain(
100+
expect(contentDisplayedinParagraphTag[7].textContent).toContain(
92101
testEvidence
93102
);
94103
});
@@ -99,7 +108,7 @@ describe('ActivityDescriptionComponent', () => {
99108
fixture.detectChanges();
100109
const HTMLElement: HTMLElement = fixture.nativeElement;
101110
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
102-
expect(contentDisplayedinParagraphTag[7].textContent).toContain(
111+
expect(contentDisplayedinParagraphTag[8].textContent).toContain(
103112
testAssessment
104113
);
105114
});
@@ -110,7 +119,7 @@ describe('ActivityDescriptionComponent', () => {
110119
fixture.detectChanges();
111120
const HTMLElement: HTMLElement = fixture.nativeElement;
112121
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
113-
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
122+
expect(contentDisplayedinParagraphTag[11].textContent).toContain(
114123
testComments
115124
);
116125
});
@@ -125,7 +134,7 @@ describe('ActivityDescriptionComponent', () => {
125134
fixture.detectChanges();
126135
const HTMLElement: HTMLElement = fixture.nativeElement;
127136
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
128-
expect(contentDisplayedinParagraphTag[9].textContent).toContain(
137+
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
129138
component.SAMMVersion +
130139
testSAMM[0] +
131140
component.ISOVersion +

src/app/component/activity-description/activity-description.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface activityDescription {
1616
level: string;
1717
tags: string[];
1818
activityName: string;
19+
uuid: string;
1920
description: string;
2021
risk: string;
2122
measure: string;
@@ -48,6 +49,7 @@ export class ActivityDescriptionComponent implements OnInit {
4849
level: '',
4950
tags: [''],
5051
activityName: '',
52+
uuid: '',
5153
description: '',
5254
risk: '',
5355
measure: '',
@@ -109,6 +111,7 @@ export class ActivityDescriptionComponent implements OnInit {
109111
data['description'],
110112
''
111113
);
114+
this.currentActivity.uuid = this.defineStringValues(data['uuid'], '');
112115
this.currentActivity.risk = this.defineStringValues(data['risk'], '');
113116
this.currentActivity.tags = this.defineStringArrayValues(
114117
data['tags'],
@@ -278,7 +281,6 @@ export class ActivityDescriptionComponent implements OnInit {
278281
this.accordion.forEach(element => {
279282
element.openAll();
280283
});
281-
console.log(this.currentActivity.teamsImplemented);
282284
}
283285

284286
// Close all function

src/app/component/circular-heatmap/circular-heatmap.component.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<div class="overlay-details" [hidden]="!showOverlay">
66
<div
77
*ngIf="activityDetails; then activityTrue; else activityFalse"></div>
8-
<!-- Team Based Assessment -->
98
<ng-template #activityTrue>
109
<div class="overlay-modal">
1110
<mat-accordion multi="true" class="overlay-accordion">
@@ -83,8 +82,7 @@ <h2>Nothing to show</h2>
8382
</mat-expansion-panel-header>
8483
<ng-template matExpansionPanelContent>
8584
<ul>
86-
<li
87-
*ngFor="let implement of activityDetails.implementation">
85+
<li *ngFor="let implement of activityDetails.implementation">
8886
<a href="{{ implement.url }}">{{ implement.name }}</a>
8987
</li>
9088
</ul>
@@ -116,9 +114,7 @@ <h2>Nothing to show</h2>
116114
Knowledge:
117115
{{ activityDetails.difficultyOfImplementation.knowledge }}
118116
</p>
119-
<p>
120-
Time: {{ activityDetails.difficultyOfImplementation.time }}
121-
</p>
117+
<p>Time: {{ activityDetails.difficultyOfImplementation.time }}</p>
122118
<p>
123119
Resources:
124120
{{ activityDetails.difficultyOfImplementation.resources }}

src/app/component/circular-heatmap/circular-heatmap.component.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { from, single } from 'rxjs';
1414

1515
export interface activitySchema {
1616
activityName: string;
17-
// ifActivityDone: boolean;
1817
teamsImplemented: any;
1918
}
2019

@@ -32,12 +31,13 @@ export interface cardSchema {
3231
styleUrls: ['./circular-heatmap.component.css'],
3332
})
3433
export class CircularHeatmapComponent implements OnInit {
35-
maxLevelOfActivitys: number = -1;
34+
Routing: string = '/activity-description';
35+
maxLevelOfActivities: number = -1;
3636
showActivityCard: boolean = false;
3737
cardHeader: string = '';
3838
cardSubheader: string = '';
3939
currentDimension: string = '';
40-
activitysData: any[] = [];
40+
activityData: any[] = [];
4141
ALL_CARD_DATA: cardSchema[] = [];
4242
radial_labels: string[] = [];
4343
YamlObject: any;
@@ -67,7 +67,7 @@ export class CircularHeatmapComponent implements OnInit {
6767
for (let x in this.YamlObject['strings']['en']['maturity_levels']) {
6868
var y = parseInt(x) + 1;
6969
this.radial_labels.push('Level ' + y);
70-
this.maxLevelOfActivitys = y;
70+
this.maxLevelOfActivities = y;
7171
}
7272
});
7373
// Team Data
@@ -97,7 +97,7 @@ export class CircularHeatmapComponent implements OnInit {
9797
}
9898
}
9999
// console.log(this.segment_labels);
100-
for (var l = 0; l < this.maxLevelOfActivitys; l++) {
100+
for (var l = 0; l < this.maxLevelOfActivities; l++) {
101101
var allDimensionNames = Object.keys(this.YamlObject);
102102
for (var i = 0; i < allDimensionNames.length; i++) {
103103
var allSubDimensionInThisDimension = Object.keys(
@@ -286,14 +286,12 @@ export class CircularHeatmapComponent implements OnInit {
286286
break;
287287
}
288288
}
289-
290289
this.ALL_CARD_DATA[index]['Activity'][activityIndex]['teamsImplemented'][
291290
teamKey
292291
] =
293292
!this.ALL_CARD_DATA[index]['Activity'][activityIndex]['teamsImplemented'][
294293
teamKey
295294
];
296-
297295
this.saveState();
298296
this.reColorHeatmap();
299297
}
@@ -385,9 +383,10 @@ export class CircularHeatmapComponent implements OnInit {
385383
console.log('index', _self.ALL_CARD_DATA[index]['Activity']);
386384
_self.currentDimension = curr.Dimension;
387385
_self.cardSubheader = curr.Level;
388-
_self.activitysData = curr.Activity;
386+
_self.activityData = curr.Activity;
389387
_self.cardHeader = curr.SubDimension;
390388
_self.showActivityCard = true;
389+
//console.log(_self.activityData)
391390
})
392391
.on('mouseover', function (d) {
393392
//console.log(d.toElement.__data__.Name)
@@ -658,12 +657,10 @@ export class CircularHeatmapComponent implements OnInit {
658657
}
659658
}
660659
}
661-
662660
navigate(dim: string, subdim: string, activityName: string) {
663661
let navigationExtras = {
664662
dimension: dim,
665663
subDimension: subdim,
666-
667664
activityName: activityName,
668665
};
669666
this.yaml.setURI('./assets/YAML/generated/generated.yaml');
@@ -737,7 +734,6 @@ export class CircularHeatmapComponent implements OnInit {
737734
ResetIsImplemented() {
738735
for (var x = 0; x < this.ALL_CARD_DATA.length; x++) {
739736
if (this.ALL_CARD_DATA[x]['Done%'] > 0) {
740-
// this.ALL_CARD_DATA[x]['Done%'] = 0;
741737
for (var y = 0; y < this.ALL_CARD_DATA[x]['Activity'].length; y++) {
742738
var currActivityTeamsImplemented =
743739
this.ALL_CARD_DATA[x]['Activity'][y]['teamsImplemented'];

src/app/component/dependency-graph/dependency-graph.component.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export class DependencyGraphComponent implements OnInit {
4343
this.yaml.getJson().subscribe(data => {
4444
this.graphData = { nodes: [], links: [] };
4545
this.YamlObject = data[this.dimension][this.subDimension];
46-
this.populateGraphWithActivitiesCurrentactivityDependsOn(
46+
this.populateGraphWithActivitiesCurrentActivityDependsOn(
4747
this.activityName
4848
);
49-
this.populateGraphWithActivitiesThatDependsOnCurrentactivity(
49+
this.populateGraphWithActivitiesThatDependsOnCurrentActivity(
5050
this.activityName
5151
);
5252
//console.log({...this.graphData['nodes']})
@@ -56,41 +56,41 @@ export class DependencyGraphComponent implements OnInit {
5656
});
5757
}
5858

59-
populateGraphWithActivitiesCurrentactivityDependsOn(activity: string): void {
59+
populateGraphWithActivitiesCurrentActivityDependsOn(activity: string): void {
6060
this.checkIfNodeHasBeenGenerated(activity);
6161
try {
62-
var activitysThatCurrenactivityIsDependentOn =
62+
var activitysThatCurrenActivityIsDependentOn =
6363
this.YamlObject[activity]['dependsOn'];
6464
for (
6565
var j = 0;
66-
j < activitysThatCurrenactivityIsDependentOn.length;
66+
j < activitysThatCurrenActivityIsDependentOn.length;
6767
j++
6868
) {
6969
this.checkIfNodeHasBeenGenerated(
70-
activitysThatCurrenactivityIsDependentOn[j]
70+
activitysThatCurrenActivityIsDependentOn[j]
7171
);
7272
this.graphData['links'].push({
73-
source: activitysThatCurrenactivityIsDependentOn[j],
73+
source: activitysThatCurrenActivityIsDependentOn[j],
7474
target: activity,
7575
});
76-
this.populateGraphWithActivitiesCurrentactivityDependsOn(
77-
activitysThatCurrenactivityIsDependentOn[j]
76+
this.populateGraphWithActivitiesCurrentActivityDependsOn(
77+
activitysThatCurrenActivityIsDependentOn[j]
7878
);
7979
}
8080
} catch (e) {
8181
console.log(e);
8282
}
8383
//console.log({...this.graphData['nodes']})
8484
}
85-
populateGraphWithActivitiesThatDependsOnCurrentactivity(activity: string) {
86-
var allactivitys = Object.keys(this.YamlObject);
87-
for (var i = 0; i < allactivitys.length; i++) {
85+
populateGraphWithActivitiesThatDependsOnCurrentActivity(activity: string) {
86+
var allActivitys = Object.keys(this.YamlObject);
87+
for (var i = 0; i < allActivitys.length; i++) {
8888
try {
89-
if (this.YamlObject[allactivitys[i]]['dependsOn'].includes(activity)) {
90-
this.checkIfNodeHasBeenGenerated(allactivitys[i]);
89+
if (this.YamlObject[allActivitys[i]]['dependsOn'].includes(activity)) {
90+
this.checkIfNodeHasBeenGenerated(allActivitys[i]);
9191
this.graphData['links'].push({
9292
source: activity,
93-
target: allactivitys[i],
93+
target: allActivitys[i],
9494
});
9595
}
9696
} catch {

0 commit comments

Comments
 (0)