Skip to content

Commit 12b7b01

Browse files
authored
Merge pull request #57 from ioggstream/ioggstream-53
Configurable references
2 parents b456a38 + 10919fd commit 12b7b01

11 files changed

Lines changed: 355 additions & 244 deletions

File tree

assets/css/common.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
html {
33
overflow-y: scroll;
44
}
5+
6+
.form-radio {
7+
display: inline-block;
8+
}

data-new/BuildAndDeployment/Sub-Dimensions.yaml

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ Build:
3030
time: 2
3131
resources: 2
3232
usefulness: 2
33+
level: 2
3334
implementation:
3435
- Container technologies and orchestration like Docker, Kubernetes
3536
- *ci-cd
36-
level: 2
37-
samm2: i-secure-build|A|2
38-
iso27001-2017:
39-
- 14.2.6
37+
references:
38+
samm2:
39+
- "samm2:i-secure-build|A|2"
40+
iso27001-2017:
41+
- "iso27001-2017:14.2.6"
4042
Defined build process:
4143
risk:
4244
- Performing builds without a defined process is error prone; for example, as
@@ -55,10 +57,12 @@ Build:
5557
implementation:
5658
- *ci-cd
5759
- Container technologies and orchestration like Docker, Kubernetes
58-
samm2: i-secure-build|A|1
59-
iso27001-2017:
60-
- 12.1.1
61-
- 14.2.2
60+
references:
61+
samm2:
62+
- i-secure-build|A|1
63+
iso27001-2017:
64+
- 12.1.1
65+
- 14.2.2
6266
Signing of code:
6367
risk: Unauthorized manipulation of source code might be difficult to spot.
6468
measure: Digitally signing commits helps to prevent unauthorized manipulation
@@ -72,10 +76,11 @@ Build:
7276
implementation: ~
7377
dependsOn:
7478
- Defined build process
75-
samm: OA3-B
76-
samm2: i-secure-build|A|2
77-
iso27001-2017:
78-
- 14.2.6
79+
references:
80+
samm: OA3-B
81+
samm2: i-secure-build|A|2
82+
iso27001-2017:
83+
- 14.2.6
7984
Signing of artifacts:
8085
risk: Unauthorized manipulation of artifacts might be difficult to spot. For
8186
example, this may result in images with malicious code in the Docker registry.
@@ -92,10 +97,13 @@ Build:
9297
- <a href="https://in-toto.github.io/">in-toto</a>
9398
dependsOn:
9499
- Defined build process
95-
samm: OA3-B
96-
samm2: i-secure-build|A|1
97-
iso27001-2017:
98-
- 14.2.6
100+
references:
101+
samm:
102+
- OA3-B
103+
samm2:
104+
- i-secure-build|A|1
105+
iso27001-2017:
106+
- 14.2.6
99107
Deployment:
100108
Backup before deployment:
101109
risk: If errors are experienced during the deployment process you want to deploy
@@ -112,11 +120,14 @@ Deployment:
112120
complex environments, a Point in Time Recovery for databases should be implemented.
113121
dependsOn:
114122
- Defined deployment process
115-
samm: OE2-A
116-
samm2: TODO
117-
iso27001-2017:
118-
- "12.3"
119-
- 14.2.6
123+
references:
124+
samm:
125+
- OE2-A
126+
samm2:
127+
- TODO
128+
iso27001-2017:
129+
- "12.3"
130+
- 14.2.6
120131
Blue/Green Deployment:
121132
risk: A new artifacts version can have unknown defects.
122133
measure: By having multiple production environments, a deployment can be performant
@@ -132,14 +143,16 @@ Deployment:
132143
Deployments</a>
133144
dependsOn:
134145
- Smoke Test
135-
samm2: TODO
136-
iso27001-2017:
137-
- 17.2.1
138-
- 12.1.1
139-
- 12.1.2
140-
- 12.1.4
141-
- 12.5.1
142-
- 14.2.9
146+
references:
147+
samm2:
148+
- TODO
149+
iso27001-2017:
150+
- 17.2.1
151+
- 12.1.1
152+
- 12.1.2
153+
- 12.1.4
154+
- 12.5.1
155+
- 14.2.9
143156
Defined deployment process:
144157
risk: Deployments without a defined process are error prone thus allowing old
145158
or untested artifact to be deployed.
@@ -152,10 +165,11 @@ Deployment:
152165
usefulness: 4
153166
level: 1
154167
implementation: Jenkins, Docker
155-
samm2: i-secure-deployment|A|1
156-
iso27001-2017:
157-
- 12.1.1
158-
- 14.2.2
168+
references:
169+
samm2: i-secure-deployment|A|1
170+
iso27001-2017:
171+
- 12.1.1
172+
- 14.2.2
159173
Environment depending configuration parameters:
160174
risk: Attackers who compromise source code can see confidential access information
161175
like database credentials.
@@ -168,11 +182,14 @@ Deployment:
168182
usefulness: 4
169183
level: 2
170184
implementation: ""
171-
samm: SA2-A
172-
samm2: i-secure-deployment|B|1
173-
iso27001-2017:
174-
- 9.4.5
175-
- 14.2.6
185+
references:
186+
samm:
187+
- SA2-A
188+
samm2:
189+
- i-secure-deployment|B|1
190+
iso27001-2017:
191+
- 9.4.5
192+
- 14.2.6
176193
Handover of confidential parameters:
177194
risk:
178195
- Attackers who compromise a system can see confidential access information
@@ -192,14 +209,15 @@ Deployment:
192209
implementation: ""
193210
dependsOn:
194211
- Environment depending configuration parameters
195-
samm: SA2-A
196-
samm2: i-secure-deployment|B|2 TODO might be 1
197-
iso27001-2017:
198-
- 14.1.3
199-
- 13.1.3
200-
- 9.4.3
201-
- 9.4.1
202-
- 10.1.2
212+
references:
213+
samm: SA2-A
214+
samm2: i-secure-deployment|B|2 TODO might be 1
215+
iso27001-2017:
216+
- 14.1.3
217+
- 13.1.3
218+
- 9.4.3
219+
- 9.4.1
220+
- 10.1.2
203221
Rolling update on deployment:
204222
risk: While a deployment is performed, the application can not be reached.
205223
measure: A deployment without downtime is performed*.
@@ -271,7 +289,7 @@ Deployment:
271289
resources: 1
272290
usefulness: 3
273291
level: 2
274-
samm2: i-secure-deployment|A|2
292+
samm2: samm2:i-secure-deployment|A|2
275293
iso27001-2017:
276294
- 15.1.1
277295
- 15.1.2

data.php

Lines changed: 22 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,24 @@
11
<?php
22
require_once("functions.php");
33

4-
$dimensions = array();
4+
// get form data
5+
$showPerformed = ($_GET['performed'] ?? false) == "true" ? "true" : false;
6+
$showPlanned = ($_GET['planned'] ?? false) == "true" ? "true" : false;
57

6-
$files = scandir("data");
8+
$dimensions = getDimensions();
79

8-
$dimensions = readYaml("data/dimensions.yaml");
9-
10-
ksort($dimensions);
11-
foreach ($dimensions as $dimensionName => $subDimension) {
12-
ksort($subDimension);
13-
foreach ($subDimension as $subDimensionName => $elements) {
14-
if (substr($subDimensionName, 0, 1) == "_")
15-
continue;
16-
$newElements = $elements;
17-
ksort($newElements);
18-
$dimensions[$dimensionName][$subDimensionName] = $newElements;
19-
}
20-
}
21-
22-
if (array_key_exists("performed", $_GET)) {
23-
$showPerformed = $_GET['performed'];
24-
25-
if ($showPerformed != "true") $showPerformed = false;
26-
} else {
27-
$showPerformed = false;
28-
}
29-
30-
if (array_key_exists("planned", $_GET)) {
31-
$showPlanned = $_GET['planned'];
32-
33-
if ($showPlanned != "true") $showPlanned = false;
34-
} else {
35-
$showPlanned = false;
36-
}
10+
// Create filteredDimensions
3711
$filteredDimensions = array();
38-
foreach ($dimensions as $dimensionName => $subDimension) {
39-
ksort($subDimension);
40-
foreach ($subDimension as $subDimensionName => $elements) {
41-
if (substr($subDimensionName, 0, 1) == "_")
12+
foreach(getActions($dimensions) as list($dimension, $subdimension, $activities)) {
13+
foreach ($activities as $activityName => $activity) {
14+
if (elementIsSelected($activityName) && !$showPerformed) {
4215
continue;
43-
$newElements = $elements;
44-
ksort($newElements);
45-
foreach ($newElements as $activityName => $activity) {
46-
if (elementIsSelected($activityName) && !$showPerformed) {
47-
continue;
48-
}
49-
50-
if (!elementIsSelected($activityName) && !$showPlanned) {
51-
continue;
52-
}
53-
$filteredDimensions[$dimensionName][$subDimensionName][$activityName] = $activity;
5416
}
5517

18+
if (!elementIsSelected($activityName) && !$showPlanned) {
19+
continue;
20+
}
21+
$filteredDimensions[$dimension][$subdimension][$activityName] = $activity;
5622
}
5723
}
5824

@@ -72,7 +38,7 @@ function getDifficultyOfImplementationWithDependencies($dimensions, $elementImpl
7238

7339
if (array_key_exists('dependsOn', $elementImplementation) && $aggregated == "true") {
7440
foreach ($elementImplementation['dependsOn'] as $dependency) {
75-
$dependencyElement = getElementByName($dimensions, $dependency);
41+
$dependencyElement = getActivity($dimensions, $dependency);
7642
getDifficultyOfImplementationWithDependencies($dimensions, $dependencyElement, $allElements);
7743

7844

@@ -100,7 +66,7 @@ function getDifficultyOfImplementation($dimensions, $elementImplementation)
10066

10167
if (array_key_exists('dependsOn', $elementImplementation) && $aggregated == "true") {
10268
foreach ($elementImplementation['dependsOn'] as $dependency) {
103-
$dependencyElement = getElementByName($dimensions, $dependency);
69+
$dependencyElement = getActivity($dimensions, $dependency);
10470
$value += getDifficultyOfImplementation($dimensions, $dependencyElement);
10571
}
10672
}
@@ -140,10 +106,8 @@ function getElementContent($element)
140106
if (!is_array($element)){
141107
return str_replace("\"", "'", $element);
142108
}
143-
144109
if (isAssoc($element)) {
145110
$contentString = "";
146-
147111
foreach ($element as $title => $elementContent) {
148112
$titleWithSpace = preg_replace('/(?<=[a-z])[A-Z]|[A-Z](?=[a-z])/', ' $0', $title);
149113
$contentString .= "<b>" . ucfirst($titleWithSpace) . "</b>";
@@ -182,6 +146,9 @@ function render_risk($risk) {
182146
}
183147
return $risk;
184148
}
149+
/**
150+
* Render an activity in a tooltip.
151+
*/
185152
function build_table_tooltip($array, $headerWeight = 2)
186153
{
187154
$mapKnowLedge = array("Very Low (one discipline)", "Low (one discipline)", "Medium (two disciplines)", "High (two disciplines)", "Very High (three or more disciplines)");
@@ -210,13 +177,14 @@ function build_table_tooltip($array, $headerWeight = 2)
210177
return $html;
211178
}
212179

213-
function getElementByName($dimensions, $name)
180+
181+
function getActivity($dimensions, $name)
214182
{
215183
foreach ($dimensions as $dimensionName => $subDimension) {
216-
foreach ($subDimension as $subDimensionName => $elements) {
217-
foreach ($elements as $activityName => $element) {
184+
foreach ($subDimension as $subDimensionName => $activities) {
185+
foreach ($activities as $activityName => $activity) {
218186
if ($activityName == $name) {
219-
return $element;
187+
return $activity;
220188
}
221189
}
222190
}

data/strings.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
#
55
strings:
66
en: &en
7+
references:
8+
samm2:
9+
label: OWASP SAMM VERSION 2
10+
description: |-
11+
https://owaspsamm.org/blog/2020/01/31/samm2-release/
12+
iso27001-2017:
13+
label: ISO27001 2017
14+
description: |-
15+
ISO 27001 / 2017
16+
samm:
17+
label: OWASP SAMM (Software Assurance Maturity Model)
18+
description: |-
19+
Software Assurance Maturity Model
20+
The Software Assurance Maturity Model (SAMM) is an open framework to help organizations formulate
21+
and implement a strategy for software security that is tailored
22+
to the specific risks facing the organization.
23+
724
labels: ["Very Low", "Low", "Medium", "High", "Very High"]
825
hardness: ["Very soft", "Soft", "Medium", "High", "Very high"]
926
maturity_levels: ["Level 1: Basic understanding of security practices" ,

0 commit comments

Comments
 (0)