forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetail.php
More file actions
133 lines (116 loc) · 4.51 KB
/
detail.php
File metadata and controls
133 lines (116 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
$title = "Details for '" . htmlspecialchars($_GET['element']) . "'";
include_once "head.php";
?>
<body>
<?php
include_once "data.php";
include_once "navi.php";
$dimension = $_GET['dimension'];
$subdimension = $_GET['subdimension'];
$elementName = $_GET['element'];
function hasSecurityProperties($element)
{
foreach ($element as $securityPropertyName => $securityPropertyDescription) {
if ($securityPropertyName == "availability") {
return true;
} else if ($securityPropertyName == "integrity") {
return true;
} else if ($securityPropertyName == "confidentiality") {
return true;
} else if ($securityPropertyName == "authorization") {
return true;
} else if ($securityPropertyName == "authentication") {
return true;
} else if ($securityPropertyName == "non-repudiation") {
return true;
}
}
return false;
}
function printDetail($dimension, $subdimension, $elementName, $dimensions, $report = false)
{
$element = $dimensions[$dimension][$subdimension][$elementName];
if ($element == null) { //Whitelist approach for security reasons (deny XSS)
//echo "Sorry, we could not found the element";
return;
}
if ($report) {
$headerWeight = 3;
} else {
$headerWeight = 1;
}
$pageH1 = "";
if (!$report) {
$pageH1 .= $dimension;
if ($dimension != $subdimension) {
$pageH1 .= " -> $subdimension";
}
$pageH1 .= ": $elementName";
} else {
$pageH1 .= "$elementName";
}
echo "<h$headerWeight>$pageH1</h$headerWeight>";
echo build_table_tooltip($element, $headerWeight + 1);
echo "<hr/>";
/*
if (hasSecurityProperties($element["securityProperties"])) {
echo "<h" . ($headerWeight + 1) . ">Security Properties</h" . ($headerWeight + 1) . ">";
foreach ($element["securityProperties"] as $securityPropertyName => $securityPropertyDescription) {
if ($securityPropertyName == "availability") {
$securityPropertyName = "Verfügbarkeit";
} else if ($securityPropertyName == "integrity") {
$securityPropertyName = "Integrität";
} else if ($securityPropertyName == "confidentiality") {
$securityPropertyName = "Vertraulichkeit";
} else if ($securityPropertyName == "authorization") {
$securityPropertyName = "Autorisierung";
} else if ($securityPropertyName == "authentication") {
$securityPropertyName = "Authentifizierung";
} else if ($securityPropertyName == "non-repudiation") {
$securityPropertyName = "Nicht Abstreitbarkeit";
}
echo "<div><b>" . ucfirst($securityPropertyName) . ":</b> $securityPropertyDescription</div>";
}
}
*/
if (array_key_exists("dependsOn", $element) || array_key_exists("implementation", $element) || array_key_exists("comment", $element)) {
echo "<h" . ($headerWeight + 1) . ">Additional Information</h" . ($headerWeight + 1) . ">";
if (array_key_exists("dependsOn", $element)) {
$dependsOn = $element['dependsOn'];
$dependencies = "";
$first = true;
foreach ($dependsOn as $dimensionElement) {
if (!$first) {
$dependencies .= ", ";
}
$dependencies .= $dimensionElement;
$first = false;
}
echo "<div><b>Dependencies:</b> $dependencies</div>";
}
}
if (array_key_exists("implementation", $element) && !empty($element['implementation'])) {
$implementation = $element['implementation'];
echo "<div><b>Implementation hints:</b> ";
if(is_array($implementation)){
echo "<ul>";
foreach($implementation as $implementationElement) {
echo "<li>$implementationElement</li>";
}
echo "</ul>";
}else {
echo $implementation;
}
echo "</div>";
}
if (array_key_exists("comment", $element) && !empty($element['comment'])) {
$comment = $element['comment'];
echo "<div><b>Comments:</b> $comment</div>";
}
if (array_key_exists("samm", $element) && !empty($element['samm'])) {
$samm = $element['samm'];
echo "<div><b>OWASP SAMM 1 Mapping:</b> $samm</div>";
}
}
printDetail($dimension, $subdimension, $elementName, $dimensions);