Skip to content

Commit 5067904

Browse files
committed
Merge branch 'main' of https://github.com/CERTCC/SSVC into publish
2 parents 7066658 + 39f40c2 commit 5067904

File tree

413 files changed

+6550
-2335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

413 files changed

+6550
-2335
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- Remove this template and add a description of the changes you are proposing.
2+
- Edit the title of the PR to be a concise summary of the changes. The title should
3+
be descriptive enough to give a reviewer a good idea of what the PR is about, and
4+
not just a reference to an issue number. PR titles are used in the commit log
5+
and release notes, so they need to convey meaning on their own.
6+
- Most pull requests should be in response to an issue, and ideally a PR will
7+
resolve or close one or more issues.
8+
- If a PR only partially resolves an issue,
9+
we suggest spawning one or more child issues from the main issue to identify what portion
10+
of the issue is resolved by the PR, and what work remains to be done.
11+
- Please use [github keyword syntax](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests)
12+
(closes, fixes, resolves, etc.) to reference relevant issues.
13+
- Using bulleted lists with the issue id at the end lets github automatically
14+
link the issue and provide the title inline. E.g.: `- resolves #99999`
15+
- CoPilot summaries are welcome in the PR description, but please provide a brief
16+
description of the changes in your own words as well. CoPilot can be good at the _what_,
17+
but not so good at the _why_.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Lint Markdown (Changes)"
2+
on:
3+
push:
4+
paths:
5+
- '**/*.md'
6+
- .github/workflows/lint_md_changes.yml
7+
pull_request:
8+
paths:
9+
- '**/*.md'
10+
- .github/workflows/lint_md_changes.yml
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: tj-actions/changed-files@v45
20+
id: changed-files
21+
with:
22+
files: '**/*.md'
23+
separator: ","
24+
- uses: DavidAnson/markdownlint-cli2-action@v19
25+
if: steps.changed-files.outputs.any_changed == 'true'
26+
with:
27+
globs: ${{ steps.changed-files.outputs.all_changed_files }}
28+
separator: ","
29+
config: .markdownlint.yml
30+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,4 @@ dmypy.json
129129
.pyre/
130130
ssvc2-applier-wip.xlsx
131131
_version.py
132+
node_modules

.markdownlint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
default: true
2+
# disable noisy rules
3+
# 0004 Unordered List style
4+
# Force dash style for unordered lists
5+
MD004:
6+
style: "dash"
7+
# 013 Line length
8+
# Disabled because we have a lot of long lines. We should fix this eventually.
9+
MD013: false
10+
# 033 Inline HTML
11+
# Disabled because we use inline HTML (<br/> in table cells for example)
12+
MD033: false
13+
# MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md040.md
14+
MD040: false
15+
# 041 First line in file should be a top level header
16+
# Disabled because we use `include-markdown` plugin for merging markdown files
17+
MD041: false
18+
# 046 Code block style
19+
# Disabled because mkdocs-material uses indented blocks for admonitions
20+
MD046: false
21+
# 049 emphasis style
22+
# Force asterisk style for emphasis
23+
MD049:
24+
style: "asterisk"
25+
# 050 strong style
26+
# Force asterisk style for strong
27+
MD050:
28+
style: "asterisk"
29+

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# How to contribute
22

33
Thanks for your help on improving our stakeholder-specific vulnerability categorization work.
4-
To account for different stakeholder perspectives, we benefit from a diverse group of contributors.
4+
To account for different stakeholder perspectives, we benefit from a diverse group of contributors.
55

66
Please see our project documentation in the [wiki](https://github.com/CERTCC/SSVC/wiki) that accompanies this repository
77
for more information on how you can contribute to the project.
88

99
## Licenses
1010

1111
See [LICENSE](https://github.com/CERTCC/SSVC/blob/main/LICENSE)
12-
12+
1313
## Questions
1414

1515
If you have any questions, an [issue](https://github.com/CERTCC/SSVC/issues) or
1616
[discussion](https://github.com/CERTCC/SSVC/discussions) is the best way to get in touch with us.
17-

Dockerfile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
FROM python:3.12-slim-bookworm
2-
1+
FROM python:3.12-slim-bookworm AS base
2+
RUN pip install --upgrade pip
33
WORKDIR /app
44

5+
FROM base AS dependencies
6+
57
# install requirements
68
COPY requirements.txt .
79
RUN pip install -r requirements.txt
8-
910
# Copy the files we need
10-
COPY src/ .
11-
COPY data ./data
11+
COPY . /app
12+
# Set the environment variable
13+
ENV PYTHONPATH=/app/src
1214

15+
16+
FROM dependencies AS test
1317
# install pytest
1418
RUN pip install pytest
15-
1619
# run the unit tests \
17-
ENTRYPOINT ["pytest"]
18-
CMD ["test"]
20+
CMD ["pytest","src/test"]
21+
22+
FROM dependencies AS docs
23+
CMD ["mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The following license applies to software contained in this repository.
33
----
44
MIT License
55

6-
Copyright (c) 2020 Carnegie Mellon University
6+
Copyright (c) 2020-2025 Carnegie Mellon University
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Project-specific vars
2+
PFX=ssvc
3+
DOCKER=docker
4+
DOCKER_BUILD=$(DOCKER) build
5+
DOCKER_RUN=$(DOCKER) run --tty --rm
6+
PROJECT_VOLUME=--volume $(shell pwd):/app
7+
MKDOCS_PORT=8765
8+
9+
# docker names
10+
TEST_DOCKER_TARGET=test
11+
TEST_IMAGE = $(PFX)_test
12+
DOCS_DOCKER_TARGET=docs
13+
DOCS_IMAGE = $(PFX)_docs
14+
15+
# Targets
16+
.PHONY: all dockerbuild_test dockerrun_test dockerbuild_docs dockerrun_docs docs docker_test clean help
17+
18+
all: help
19+
20+
dockerbuild_test:
21+
@echo "Building the test Docker image..."
22+
$(DOCKER_BUILD) --target $(TEST_DOCKER_TARGET) --tag $(TEST_IMAGE) .
23+
24+
dockerrun_test:
25+
@echo "Running the test Docker image..."
26+
$(DOCKER_RUN) $(PROJECT_VOLUME) $(TEST_IMAGE)
27+
28+
dockerbuild_docs:
29+
@echo "Building the docs Docker image..."
30+
$(DOCKER_BUILD) --target $(DOCS_DOCKER_TARGET) --tag $(DOCS_IMAGE) .
31+
32+
dockerrun_docs:
33+
@echo "Running the docs Docker image..."
34+
$(DOCKER_RUN) --publish $(MKDOCS_PORT):8000 $(PROJECT_VOLUME) $(DOCS_IMAGE)
35+
36+
37+
docs: dockerbuild_docs dockerrun_docs
38+
docker_test: dockerbuild_test dockerrun_test
39+
40+
clean:
41+
@echo "Cleaning up..."
42+
$(DOCKER) rmi $(TEST_IMAGE) $(DOCS_IMAGE) || true
43+
44+
help:
45+
@echo "Usage: make [target]"
46+
@echo ""
47+
@echo "Targets:"
48+
@echo " all - Display this help message"
49+
@echo " docs - Build and run the docs Docker image"
50+
@echo " docker_test - Build and run the test Docker image"
51+
@echo ""
52+
@echo " dockerbuild_test - Build the test Docker image"
53+
@echo " dockerrun_test - Run the test Docker image"
54+
@echo " dockerbuild_docs - Build the docs Docker image"
55+
@echo " dockerrun_docs - Run the docs Docker image"
56+
@echo ""
57+
@echo " clean - Remove the Docker images"
58+
@echo " help - Display this help message"
59+
60+
61+

README.md

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SSVC aims to avoid one-size-fits-all solutions in favor of a modular decision-ma
1010
SSVC is mostly conceptual tools for vulnerability management.
1111
These conceptual tools (how to make decisions, what should go into a decision, how to document and communicate decisions clearly, etc.) are described here.
1212

13-
**Note:** This repository contains the _content_ for the main SSVC documentation hosted at
13+
**Note:** This repository contains the *content* for the main SSVC documentation hosted at
1414

1515
## [https://certcc.github.io/SSVC/](https://certcc.github.io/SSVC/)
1616

@@ -19,7 +19,6 @@ These conceptual tools (how to make decisions, what should go into a decision, h
1919

2020
---
2121

22-
2322
# What's here
2423

2524
Here's a quick overview of the main directories and files in this repository.
@@ -34,7 +33,7 @@ See [`project_docs/README.md`](project_docs/README.md) for more info.
3433
Directory with SSVC calculator using D3 graph.
3534
See [`ssvc-calc/README.md`](docs/ssvc-calc/README.md) for more info.
3635

37-
A demo version of `ssvc-calc` can be found at https://certcc.github.io/SSVC/ssvc-calc/
36+
A demo version of `ssvc-calc` can be found at <https://certcc.github.io/SSVC/ssvc-calc/>
3837

3938
## `/pdfs/*`
4039

@@ -82,12 +81,57 @@ The two methods just loop through their respective lookup tables until
8281
they hit a match, then return the outcome. Maybe not the best implementation,
8382
but it worked well enough for what was needed at the time.
8483

85-
8684
## Local development
8785

88-
Install prerequisites:
86+
The simplest way to get started with local development is to use Docker.
87+
We provide a Dockerfile that builds an image with all the dependencies needed to build the site.
88+
We also provide a `Makefile` that simplifies the process of building the site and running a local server,
89+
so you don't have to remember the exact `docker build` and `docker run` commands
90+
to get started.
91+
92+
### Make Commands
93+
94+
To display the available `make` commands, run:
95+
96+
```bash
97+
make help
98+
```
99+
100+
To preview any `make` command without actually executing it, run:
89101

90102
```bash
103+
make -n <command>
104+
```
105+
106+
### Run Local Server With Docker
107+
108+
The easiest way to get started is using make to build a docker image and run the site:
109+
110+
```bash
111+
make docs
112+
```
113+
114+
Then navigate to <http://localhost:8765/SSVC/> to see the site.
115+
116+
Note that the docker container will display a message with the URL to visit, for
117+
example: `Serving on http://0.0.0.0:8000/SSVC/` in the output. However, that port
118+
is only available inside the container. The host port 8765 is mapped to the container's
119+
port 8000, so you should navigate to <http://localhost:8765/SSVC/> to see the site.
120+
121+
Or, if make is not available:
122+
123+
```bash
124+
docker build --target docs --tag ssvc_docs .
125+
docker run --tty --rm -p 8765:8000 --volume .:/app ssvc_docs
126+
```
127+
128+
### Run Local Server Without Docker
129+
130+
If you prefer to run the site locally without Docker, you can do so with mkdocs.
131+
We recommend using a virtual environment to manage dependencies:
132+
133+
```bash
134+
python3 -m venv ssvc_venv
91135
pip install -r requirements.txt
92136
```
93137

@@ -97,32 +141,47 @@ Start a local server:
97141
mkdocs serve
98142
```
99143

100-
Navigate to http://localhost:8001/ to see the site.
144+
By default, the server will run on port 8001.
145+
This is configured in the `mkdocs.yml` file.
146+
Navigate to <http://localhost:8001/> to see the site.
101147

102148
(Hint: You can use the `--dev-addr` argument with mkdocs to change the port, e.g. `mkdocs serve --dev-addr localhost:8000`)
103149

104-
## Run tests
150+
## Run tests
105151

106152
We include a few tests for the `ssvc` module.
107153

108-
### With Docker
154+
### Run Tests With Docker
109155

110-
```bash
156+
The easiest way to run tests is using make to build a docker image and run the tests:
111157

112-
docker build -t ssvc_test .
113-
docker run -it --rm ssvc_test
158+
```bash
159+
make docker_test
114160
```
115161

116-
### Without Docker
162+
Or, if make is not available:
117163

118164
```bash
119-
pip install pytest # if you haven't already
165+
docker build --target test --tag ssvc_test .
166+
docker run --tty --rm --volume .:/app ssvc_test
167+
```
168+
169+
### Run Tests Without Docker
120170

121-
pytest # should find tests in src/test/*
171+
```bash
172+
pip install pytest
173+
pytest src/test
122174
```
123175

176+
## Environment Variables
124177

178+
If you encounter a problem with the `ssvc` module not being found, you may need to set the `PYTHONPATH` environment variable.
179+
The Dockerfile takes care of this in the Docker environment.
180+
When not running in Docker, make sure that the `src` directory is in your `PYTHONPATH`:
125181

182+
```bash
183+
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
184+
```
126185

127186
## Contributing
128187

@@ -147,5 +206,5 @@ To reference SSVC in an academic publication, please refer to the version presen
147206

148207
## References
149208

150-
1. Spring, J., Hatleback, E., Householder, A., Manion, A., and Shick, D. "Prioritizing Vulnerability Response: A Stakeholder-Specific Vulnerability Categorization." White Paper, Software Engineering Institute, Carnegie Mellon University (2019). https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=636379
151-
2. Spring, J., Hatleback, E., Householder, A., Manion, A., and Shick, D. "Towards Improving CVSS." White Paper, Software Engineering Institute, Carnegie Mellon University (2018). https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=538368
209+
1. Spring, J., Hatleback, E., Householder, A., Manion, A., and Shick, D. "Prioritizing Vulnerability Response: A Stakeholder-Specific Vulnerability Categorization." White Paper, Software Engineering Institute, Carnegie Mellon University (2019). <https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=636379>
210+
2. Spring, J., Hatleback, E., Householder, A., Manion, A., and Shick, D. "Towards Improving CVSS." White Paper, Software Engineering Institute, Carnegie Mellon University (2018). <https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=538368>

data/json/decision_points/automatable_2_0_0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"description": "Attackers can reliably automate steps 1-4 of the kill chain."
1818
}
1919
]
20-
}
20+
}

0 commit comments

Comments
 (0)