Skip to content

Commit a87320e

Browse files
authored
Merge pull request #589 from devsecopsmaturitymodel/wurstbrot-patch-3
add new YAML
2 parents b27e6bd + 840eae9 commit a87320e

7 files changed

Lines changed: 5385 additions & 421 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,23 @@ jobs:
2020
with:
2121
persist-credentials: false # This is important if you have branch protection rules!
2222
- name: Semantic Release
23+
id: semantic
2324
uses: cycjimmy/semantic-release-action@v4
2425
with:
2526
branch: 'main'
27+
extra_plugins: |
28+
@semantic-release/changelog
2629
env:
2730
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2831
- name: Get Semantic Release Version
2932
id: get-version
3033
run: |
31-
echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')"
34+
version="${{ steps.semantic.outputs.new_release_version }}"
35+
if [ -z "$version" ]; then
36+
# No new release in this run (e.g. scheduled build) -> fall back to latest tag
37+
version="$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')"
38+
fi
39+
echo "version=${version}" >> "$GITHUB_OUTPUT"
3240
3341
- name: show version
3442
run: |

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN mkdir -p /usr/src/app/dist/dsomm/assets && \
1919
echo "branch: \"${GIT_BRANCH:-unknown}\"" >> /usr/src/app/dist/dsomm/assets/build-info.yaml
2020

2121

22-
FROM wurstbrot/dsomm-yaml-generation:4.2.0 AS yaml
22+
FROM wurstbrot/dsomm-yaml-generation:5.0.0 AS yaml
2323

2424
FROM caddy:2.10.2
2525
ENV PORT=8080

‎README.md‎

Lines changed: 72 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,55 @@ In case you would like to perform a DevSecOps assessment, the following tools ar
5858
## Container
5959

6060
1. Install [Docker](https://www.docker.com)
61-
2. Run `docker pull wurstbrot/dsomm:latest && docker run --rm -p 8080:8080 wurstbrot/dsomm:latest`
61+
2. Run
62+
```bash
63+
docker pull wurstbrot/dsomm:latest && docker run --rm -p 8080:8080 wurstbrot/dsomm:latest
64+
```
6265
3. Browse to <http://localhost:8080> (on macOS and Windows browse to <http://192.168.99.100:8080> if you are using docker-machine instead
6366
of the native docker installation)
6467

65-
For customized DSOMM, take a look at https://github.com/wurstbrot/DevSecOps-MaturityModel-custom.
68+
For customized DSOMM, take a look at https://github.com/wurstbrot/DevSecOps-MaturityModel-custom.
6669

67-
You can download your current state from the circular heatmap and mount it again via
70+
### Use the latest model data
6871

6972
```bash
70-
wget https://raw.githubusercontent.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data/main/src/assets/YAML/generated/generated.yaml # or go to /circular-heatmap and download edited yaml (bottom right)
71-
docker run -p 8080:8080 -v /tmp/generated.yaml:/srv/assets/YAML/generated/generated.yaml wurstbrot/dsomm:latest
73+
wget https://raw.githubusercontent.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data/refs/heads/main/generated/model.yaml
74+
docker run -p 8080:8080 -v "$PWD/model.yaml:/srv/assets/YAML/default/model.yaml" wurstbrot/dsomm:latest
7275
```
7376

74-
.
75-
76-
This approach also allows teams to perform self assessment with changes tracked in a repository.
77+
If the old model version is still referenced, clear your browser cache!
78+
79+
### Download and upload the current state
80+
81+
1. Go to `/circular-heatmap`.
82+
2. Download team progress and team evidence via buttons in the bottom-right.
83+
3. Mount the downloaded YAML-files in the container:
84+
```bash
85+
docker run -p 8080:8080 \
86+
-v "$PWD/team-evidence.yaml:/srv/assets/YAML/team-evidence.yaml" \
87+
-v "$PWD/team-progress.yaml:/srv/assets/YAML/team-progress.yaml" \
88+
wurstbrot/dsomm:latest
89+
```
90+
This approach also allows teams to perform self-assessment with changes tracked in a repository.
91+
92+
### Docker Compose
93+
94+
You can also track everything in a repository with a `docker compose` setup.
95+
96+
1. Ensure all files you want to track are present (`model.yaml`, `meta.yaml`, etc.).
97+
2. Copy the upstream compose.yaml:
98+
```bash
99+
wget https://raw.githubusercontent.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/refs/heads/main/compose.yaml
100+
```
101+
3. Edit the file if necessary.
102+
4. Start the service:
103+
```bash
104+
docker compose up -d
105+
```
106+
5. Stop the service and delete the container:
107+
```bash
108+
docker compose down
109+
```
77110

78111
## Amazon EC2 Instance
79112

@@ -93,34 +126,32 @@ service docker start
93126
docker run -d -p 80:8080 wurstbrot/dsomm:latest
94127
```
95128

96-
## Generating the `generated.yaml` File
97-
98-
The `generated.yaml` file is dynamically created during the build process. If you don’t see this file after setup, follow these steps to generate it:
129+
## Generating the `model.yaml` file
99130

100-
**1. Clone the Required Repository:**
101-
The `generated.yaml` file is built via the DevSecOps-MaturityModel-data repository. Make sure you have cloned and set it up correctly.
131+
The `model.yaml` file is dynamically created during the build process. If you don’t see this file after setup, follow these steps to generate it:
102132

103-
**2. Run the Build Command:**
104-
Navigate to the project directory and run the following command:
105-
- *Using npm:*
133+
1. **Clone the Required Repository:**
134+
The `model.yaml` file is built via the [DevSecOps-MaturityModel-data repository](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data). Make sure you have cloned and set it up correctly.
106135

107-
```sh
108-
npm run build
109-
````
110-
111-
- *Using yarn:*
112-
113-
```sh
114-
yarn build
115-
```
136+
2. **Run the Build Command:**
137+
Navigate to the project directory and run the following command:
138+
- Using `npm`:
139+
```bash
140+
npm run build
141+
```
142+
- Using `yarn`:
143+
```bash
144+
yarn build
145+
```
116146

117147
*If the file is missing, ensure all dependencies are installed and that you have the correct access to the `DevSecOps-MaturityModel-data` repository.*
118148

119149
## Activity Definitions
120150
The definition of the activities are in the [data-repository](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data).
121151

122152
## Teams and Groups
123-
To customize these teams, you can create your own [meta.yaml](src/assets/YAML/meta.yaml) file with your unique team definitions.
153+
154+
To customize these teams, you can create your own [meta.yaml](src/assets/YAML/meta.yaml) file with your unique team definitions.
124155

125156
Assessments within the framework can be based on either a team or a specific application, which can be referred to as the context. Depending on how you define the context or teams, you may want to group them together.
126157

@@ -129,21 +160,27 @@ Here are a couple of examples to illustrate this, in breakers the DSOMM word:
129160
- Multiple teams (teams) can belong to a larger department (group).
130161

131162
Feel free to create your own [meta.yaml](src/assets/YAML/meta.yaml) file to tailor the framework to your specific needs and mount it in your environment (e.g. kubernetes or docker).
163+
132164
Here is an example to start docker with customized meta.yaml:
133-
```
165+
166+
```bash
134167
# Customized meta.yaml
135168
cp src/assets/YAML/meta.yaml .
136-
docker run -v $(pwd)/meta.yaml:/srv/assets/YAML/meta.yaml -p 8080:8080 wurstbrot/dsomm
169+
docker run -v "$PWD/meta.yaml:/srv/assets/YAML/meta.yaml" -p 8080:8080 wurstbrot/dsomm
137170
138-
# Customized meta.yaml and generated.yaml
171+
# Customized meta.yaml and model.yaml
139172
cp src/assets/YAML/meta.yaml .
140-
cp $(pwd)/src/assets/YAML/generated/generated.yaml .
141-
docker run -v $(pwd)/meta.yaml:/srv/assets/YAML/meta.yaml -v $(pwd)/generated.yaml:/srv/assets/YAML/generated/generated.yaml -p 8080:8080 wurstbrot/dsomm
173+
cp "$PWD/src/assets/YAML/generated/model.yaml" .
174+
docker run \
175+
-v "$PWD/meta.yaml:/srv/assets/YAML/meta.yaml" \
176+
-v "$PWD/model.yaml:/srv/assets/YAML/default/model.yaml" \
177+
-p 8080:8080 wurstbrot/dsomm
142178
```
143179

144180
In the corresponding [dimension YAMLs](https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel-data/tree/main/src/assets/YAML/default), use:
145-
```
146-
[...]
181+
182+
```yaml
183+
#[...]
147184
teamsImplemented:
148185
Default: false
149186
B: true
@@ -156,7 +193,8 @@ In the corresponding [dimension YAMLs](https://github.com/devsecopsmaturitymodel
156193
157194
_2025-04-01:_ All fixes of **critical** findings are deployed to production.
158195
```
159-
The `|` is yaml syntax to indicate that the evidence spans multiple lines. Markdown
196+
197+
The `|` is YAML syntax to indicate that the evidence spans multiple lines. Markdown
160198
syntax can be used. The evidence is currently visible on the activity from the Matrix page.
161199

162200
# Back link

‎compose.yaml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
dsomm:
3+
image: wurstbrot/dsomm:latest
4+
container_name: dsomm
5+
ports:
6+
- "8080:8080"
7+
volumes:
8+
## uncomment the following line to add a modified meta.yaml
9+
## (see: https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel#teams-and-groups)
10+
# - ./meta.yaml:/srv/assets/YAML/meta.yaml
11+
- ./model.yaml:/srv/assets/YAML/default/model.yaml
12+
- ./team-evidence.yaml:/srv/assets/YAML/team-evidence.yaml
13+
- ./team-progress.yaml:/srv/assets/YAML/team-progress.yaml
14+
## add other files if needed

‎src/app/app.component.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
}
7777

7878
.content {
79-
padding: 24px;
79+
padding: 12px;
8080
animation: fadeSlide 1s ease;
8181
height: 100%;
8282
box-sizing: border-box;

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

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@ export class CircularHeatmapComponent {
346346
) {
347347
let _self = this;
348348
var imageWidth = 1200;
349-
var marginAll = 5;
349+
var marginAll = 0;
350350
var margin = {
351351
top: marginAll,
352352
right: marginAll,
353353
bottom: marginAll,
354354
left: marginAll,
355355
};
356356
var bbWidth = imageWidth - Math.max(margin.left + margin.right, margin.top + margin.bottom) * 2; // bounding box
357-
var segmentLabelHeight = bbWidth * 0.0166; // Magic fudge number. to match the longest label within one sector
357+
var segmentLabelHeight = 42;
358358
var outerRadius = bbWidth / 2 - segmentLabelHeight;
359359
var innerRadius = outerRadius / (maxLevel + 1);
360360
var segmentHeight = (outerRadius - innerRadius) / maxLevel;
@@ -504,10 +504,11 @@ export class CircularHeatmapComponent {
504504
// console.log(d3.selectAll(".circular-heat")["_groups"][0].length)
505505
var id = 1;
506506

507-
//Segment labels
508-
var segmentLabelFontSize = (segmentLabelHeight * 2) / 3;
509-
var segmentLabelOffset = (segmentLabelHeight * 1) / 3;
510-
var r =
507+
var segmentLabelOffset = 7;
508+
var labelLineSpacing = 1.1;
509+
var labelLineHeight = (segmentLabelHeight - segmentLabelOffset) / 2;
510+
var segmentLabelFontSize = labelLineHeight / labelLineSpacing;
511+
var labelBaseRadius =
511512
innerRadius + Math.ceil(data.length / numSegments) * segmentHeight + segmentLabelOffset;
512513
var labels = svg
513514
.append('g')
@@ -518,27 +519,59 @@ export class CircularHeatmapComponent {
518519
'translate(' + (margin.left + offset) + ',' + (margin.top + offset) + ')'
519520
);
520521

522+
function wordWrap(text: string, maxLen = 18): string[] {
523+
if (text.length <= maxLen) return [text];
524+
var mid = Math.floor(text.length / 2);
525+
for (var d = 0; d <= mid; d++) {
526+
if (text[mid + d] === ' ')
527+
return [text.substring(0, mid + d), text.substring(mid + d + 1)];
528+
if (mid - d >= 0 && text[mid - d] === ' ')
529+
return [text.substring(0, mid - d), text.substring(mid - d + 1)];
530+
}
531+
return [text];
532+
}
533+
534+
var wrappedLabels = segmentLabels.map((l: string) => wordWrap(l));
535+
var hasMultiLine = wrappedLabels.some((parts: string[]) => parts.length > 1);
536+
var outerLabelRadius = hasMultiLine ? labelBaseRadius + labelLineHeight : labelBaseRadius;
537+
538+
function arcPath(radius: number): string {
539+
return 'm0 -' + radius + ' a' + radius + ' ' + radius + ' 0 1 1 -1 0';
540+
}
541+
542+
var labelPathIds = ['segment-label-path-' + id + '-outer'];
521543
labels
522544
.append('def')
523545
.append('path')
524-
.attr('id', 'segment-label-path-' + id)
525-
.attr('d', 'm0 -' + r + ' a' + r + ' ' + r + ' 0 1 1 -1 0');
546+
.attr('id', labelPathIds[0])
547+
.attr('d', arcPath(outerLabelRadius));
548+
549+
if (hasMultiLine) {
550+
labelPathIds.push('segment-label-path-' + id + '-inner');
551+
labels
552+
.append('def')
553+
.append('path')
554+
.attr('id', labelPathIds[1])
555+
.attr('d', arcPath(labelBaseRadius));
556+
}
526557

527-
labels
528-
.selectAll('text')
529-
.data(segmentLabels)
530-
.enter()
531-
.append('text')
532-
.append('textPath')
533-
.attr('text-anchor', 'middle')
534-
.attr('xlink:href', '#segment-label-path-' + id)
535-
.style('font-size', segmentLabelFontSize + 'px')
536-
.attr('startOffset', function (d, i) {
537-
return ((i + 0.5) * 100) / numSegments + '%'; // shift ½ segment to center
538-
})
539-
.text(function (d: any) {
540-
return d;
558+
wrappedLabels.forEach(function (parts: string[], i: number) {
559+
var startOffset = ((i + 0.5) * 100) / numSegments + '%';
560+
parts.forEach(function (line: string, lineIndex: number) {
561+
var pathId =
562+
lineIndex === 0 && parts.length > 1
563+
? labelPathIds[0]
564+
: labelPathIds[hasMultiLine ? 1 : 0];
565+
labels
566+
.append('text')
567+
.append('textPath')
568+
.attr('text-anchor', 'middle')
569+
.attr('xlink:href', '#' + pathId)
570+
.style('font-size', segmentLabelFontSize + 'px')
571+
.attr('startOffset', startOffset)
572+
.text(line);
541573
});
574+
});
542575
var cursors = svg
543576
.append('g')
544577
.classed('cursors', true)

0 commit comments

Comments
 (0)