Skip to content

Commit 930bb12

Browse files
committed
add referenceLabel
1 parent 9eaf69b commit 930bb12

5 files changed

Lines changed: 88 additions & 92 deletions

File tree

data-new/BuildAndDeployment/Sub-Dimensions.yaml

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ Build:
5757
implementation:
5858
- *ci-cd
5959
- Container technologies and orchestration like Docker, Kubernetes
60-
samm2: i-secure-build|A|1
61-
iso27001-2017:
62-
- 12.1.1
63-
- 14.2.2
60+
references:
61+
samm2: i-secure-build|A|1
62+
iso27001-2017:
63+
- 12.1.1
64+
- 14.2.2
6465
Signing of code:
6566
risk: Unauthorized manipulation of source code might be difficult to spot.
6667
measure: Digitally signing commits helps to prevent unauthorized manipulation
@@ -74,10 +75,11 @@ Build:
7475
implementation: ~
7576
dependsOn:
7677
- Defined build process
77-
samm: OA3-B
78-
samm2: i-secure-build|A|2
79-
iso27001-2017:
80-
- 14.2.6
78+
references:
79+
samm: OA3-B
80+
samm2: i-secure-build|A|2
81+
iso27001-2017:
82+
- 14.2.6
8183
Signing of artifacts:
8284
risk: Unauthorized manipulation of artifacts might be difficult to spot. For
8385
example, this may result in images with malicious code in the Docker registry.
@@ -94,10 +96,13 @@ Build:
9496
- <a href="https://in-toto.github.io/">in-toto</a>
9597
dependsOn:
9698
- Defined build process
97-
samm: OA3-B
98-
samm2: i-secure-build|A|1
99-
iso27001-2017:
100-
- 14.2.6
99+
references:
100+
samm:
101+
- OA3-B
102+
samm2:
103+
- i-secure-build|A|1
104+
iso27001-2017:
105+
- 14.2.6
101106
Deployment:
102107
Backup before deployment:
103108
risk: If errors are experienced during the deployment process you want to deploy
@@ -114,11 +119,12 @@ Deployment:
114119
complex environments, a Point in Time Recovery for databases should be implemented.
115120
dependsOn:
116121
- Defined deployment process
117-
samm: OE2-A
118-
samm2: TODO
119-
iso27001-2017:
120-
- "12.3"
121-
- 14.2.6
122+
references:
123+
samm: OE2-A
124+
samm2: TODO
125+
iso27001-2017:
126+
- "12.3"
127+
- 14.2.6
122128
Blue/Green Deployment:
123129
risk: A new artifacts version can have unknown defects.
124130
measure: By having multiple production environments, a deployment can be performant
@@ -134,14 +140,15 @@ Deployment:
134140
Deployments</a>
135141
dependsOn:
136142
- Smoke Test
137-
samm2: TODO
138-
iso27001-2017:
139-
- 17.2.1
140-
- 12.1.1
141-
- 12.1.2
142-
- 12.1.4
143-
- 12.5.1
144-
- 14.2.9
143+
references:
144+
samm2: TODO
145+
iso27001-2017:
146+
- 17.2.1
147+
- 12.1.1
148+
- 12.1.2
149+
- 12.1.4
150+
- 12.5.1
151+
- 14.2.9
145152
Defined deployment process:
146153
risk: Deployments without a defined process are error prone thus allowing old
147154
or untested artifact to be deployed.
@@ -154,10 +161,11 @@ Deployment:
154161
usefulness: 4
155162
level: 1
156163
implementation: Jenkins, Docker
157-
samm2: i-secure-deployment|A|1
158-
iso27001-2017:
159-
- 12.1.1
160-
- 14.2.2
164+
references:
165+
samm2: i-secure-deployment|A|1
166+
iso27001-2017:
167+
- 12.1.1
168+
- 14.2.2
161169
Environment depending configuration parameters:
162170
risk: Attackers who compromise source code can see confidential access information
163171
like database credentials.
@@ -170,11 +178,12 @@ Deployment:
170178
usefulness: 4
171179
level: 2
172180
implementation: ""
173-
samm: SA2-A
174-
samm2: i-secure-deployment|B|1
175-
iso27001-2017:
176-
- 9.4.5
177-
- 14.2.6
181+
references:
182+
samm: SA2-A
183+
samm2: i-secure-deployment|B|1
184+
iso27001-2017:
185+
- 9.4.5
186+
- 14.2.6
178187
Handover of confidential parameters:
179188
risk:
180189
- Attackers who compromise a system can see confidential access information
@@ -194,14 +203,15 @@ Deployment:
194203
implementation: ""
195204
dependsOn:
196205
- Environment depending configuration parameters
197-
samm: SA2-A
198-
samm2: i-secure-deployment|B|2 TODO might be 1
199-
iso27001-2017:
200-
- 14.1.3
201-
- 13.1.3
202-
- 9.4.3
203-
- 9.4.1
204-
- 10.1.2
206+
references:
207+
samm: SA2-A
208+
samm2: i-secure-deployment|B|2 TODO might be 1
209+
iso27001-2017:
210+
- 14.1.3
211+
- 13.1.3
212+
- 9.4.3
213+
- 9.4.1
214+
- 10.1.2
205215
Rolling update on deployment:
206216
risk: While a deployment is performed, the application can not be reached.
207217
measure: A deployment without downtime is performed*.

detail.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,40 +80,22 @@ function printDetail($dimension, $subdimension, $activityName, $dimensions, $rep
8080
}
8181

8282
printReferences($element);
83-
84-
if (array_key_exists("samm", $element) && !empty($element['samm'])) {
85-
$samm = $element['samm'];
86-
echo "<div><b>OWASP SAMM 1 Mapping:</b> $samm</div>";
87-
}
88-
if (array_key_exists("samm2", $element) && !empty($element['samm2'])) {
89-
$samm = $element['samm2'];
90-
echo "<div><b>OWASP SAMM 2 Mapping:</b> $samm</div>";
91-
}
92-
if (array_key_exists("iso27001-2017", $element) && !empty($element['iso27001-2017'])) {
93-
echo "<div><b>ISO27001:2017 Controls Mapping:</b></div>";
94-
95-
echo "<ul>";
96-
foreach ($element['iso27001-2017'] as $isocontrol) {
97-
echo "<li>$isocontrol</li>";
98-
}
99-
echo "</ul>";
100-
}
10183
}
10284

10385
function printReferences($element) {
10486
if (!array_key_exists("references", $element)) {
10587
return;
10688
}
10789
$actionLabels = readYaml("data/strings.yml#/actionLabels");
108-
$referenceLabels = readYaml("data/strings.yml#/strings/en/references");
10990

11091
$references = $element['references'];
11192
foreach ($references as $r => $values) {
112-
$label = $referenceLabels[$r]['label'] ? $referenceLabels[$r]['label'] : $r ;
93+
$label = getReferenceLabel($r);
11394
echo "<div><h3>$label</h3></div>";
11495
echo "<ul><li>". implode("</li><li>", $values) ."</li></ul>";
11596
}
11697

11798

11899
}
100+
echo var_dump($dimensions);
119101
printDetail($dimension, $subdimension, $activityName, $dimensions);

functions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ function getActions($dimensions) {
3030
}
3131
}
3232

33+
function getReferenceLabel($reference_id) {
34+
$referenceLabels = readYaml("data/strings.yml#/strings/en/references");
35+
return $referenceLabels[$reference_id]["label"] ?? $reference_id;
36+
}
3337

3438
// TODO create testcases
3539

mappings.php

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,38 @@
1111

1212
$mappingExists = array();
1313
$noMappingExists = array();
14+
$sort = $_GET["sort"] ?? "activity";
1415

15-
if(array_key_exists("sort", $_GET)) {
16-
$sort = $_GET["sort"];
17-
}else {
18-
$sort = "activity";
16+
17+
$referenceLabels = readYaml("data/strings.yml#/strings/en/references");
18+
19+
function formCheck($reference_id) {
20+
if($_GET['sort'] == $reference_id) {
21+
$checked = "checked";
22+
}
23+
$reference_label = $referenceLabels[$reference_id]["label"] ?? $reference_id;
24+
echo '
25+
<div class="form-check">
26+
<input class="form-check-input" type="radio" name="sort" id="exampleRadios2" value="'.$reference_id.'"
27+
'. $checked. '
28+
<label class="form-check-label" for="exampleRadios2">'. $reference_label.'</label>
29+
</div>
30+
';
1931
}
2032

2133
?>
22-
2334
<form method="get">
2435
<div class="form-check">
25-
<input class="form-check-input" type="radio" name="sort" id="exampleRadios1" value="activity" <?php if($_GET['sort'] == "activity") echo "checked"; ?>>
26-
<label class="form-check-label" for="exampleRadios1">
27-
Activity
28-
</label>
29-
</div>
30-
<div class="form-check">
31-
<input class="form-check-input" type="radio" name="sort" id="exampleRadios2" value="samm2" <?php if($_GET['sort'] == "samm2") echo "checked"; ?>>
32-
<label class="form-check-label" for="exampleRadios2">
33-
SAMM 2
34-
</label>
35-
</div>
36-
<div class="form-check">
37-
<input class="form-check-input" type="radio" name="sort" id="exampleRadios3" value="iso27001-2017" <?php if($_GET['sort'] == "iso27001-2017") echo "checked"; ?>>
38-
<label class="form-check-label" for="exampleRadios3">
39-
ISO27001:27001
40-
</label>
36+
<input class="form-check-input" type="radio" name="sort" id="exampleRadios1" value="activity"
37+
<?php if($_GET['sort'] == "activity") echo "checked"; ?>>
38+
<label class="form-check-label" for="exampleRadios1"> Activity </label>
39+
</div>
40+
<?php
41+
foreach($referenceLabels as $r) {
42+
echo formCheck($r);
43+
}
44+
?>
45+
4146
</div>
4247
<div class="form-check">
4348
<input type="checkbox" class="form-check-input" name="performed" id="exampleCheck1" value="true" <?php if($showPerformed) {echo " checked=checked";}?>>
@@ -85,13 +90,7 @@
8590
<table class="table">
8691
<thead>
8792
<tr>
88-
<?php
89-
if($sort == "iso27001-2017") {
90-
echo '<th scope="col">ISO 27001 Control</th>';
91-
}else {
92-
echo '<th scope="col">' . $sort . '</th>';
93-
}
94-
?>
93+
<?php echo '<th scope="col">' . $sort . '</th>'; ?>
9594
<th scope="col">Dimension</th>
9695
<th scope="col">Subdimension</th>
9796
<th scope="col">Actvity</th>

scutter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ function toggle() {
161161
<form action="?" method="get">
162162
<input name="aggregated" type="hidden"
163163
<?php
164-
if($_GET['aggregated'] == "true") {
164+
$aggregated = $_GET['aggregated'] ?? null;
165+
if($aggregated == "true") {
165166
echo "value='false'";
166167
}else {
167168
echo "value='true'";
@@ -171,7 +172,7 @@ function toggle() {
171172
</input>
172173
<button id="">
173174
<?php
174-
if($_GET['aggregated'] == "true") {
175+
if($aggregated == "true") {
175176
echo "Show specific values";
176177
}else {
177178
echo "Show total values";

0 commit comments

Comments
 (0)