Skip to content

Commit a06ffda

Browse files
authored
Publish v2025.9.3 (#1035)
2 parents 5f45f98 + 5682f6e commit a06ffda

39 files changed

+1114
-1242
lines changed

.github/copilot-instructions.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# GitHub Copilot Instructions for SSVC
2+
3+
This repository contains the **Stakeholder-Specific Vulnerability Categorization (SSVC)** project, which provides a system for prioritizing actions during vulnerability management.
4+
5+
## Project Overview
6+
7+
SSVC is a modular decision-making framework for vulnerability management that includes:
8+
- Python modules for decision points, decision tables, and outcomes
9+
- MkDocs-based documentation website
10+
- Interactive calculators and policy explorers
11+
- JSON/CSV data files for decision tables
12+
- Docker and Make-based development and deployment
13+
14+
## Technology Stack
15+
16+
- **Primary Language**: Python 3.x
17+
- **Package Management**: uv (package and project manager)
18+
- **Build Tool**: Make
19+
- **Documentation**: MkDocs with Material theme
20+
- **Testing**: pytest
21+
- **Data Models**: Pydantic for JSON schema validation
22+
- **Scientific Computing**: NumPy, SciPy, scikit-learn
23+
- **Web Framework**: FastAPI (for API endpoints)
24+
- **Containerization**: Docker and Docker Compose
25+
26+
## Project Structure
27+
28+
- `/src/ssvc/` - Core Python modules for SSVC functionality
29+
- `decision_points/` - Decision point definitions
30+
- `decision_tables/` - Decision table implementations
31+
- `api/` - FastAPI application
32+
- `outcomes/` - Outcome definitions
33+
- `dp_groups/` - Decision point groups
34+
- `registry/` - Registry functionality
35+
- `/docs/` - Markdown documentation source files
36+
- `/data/` - JSON and CSV data files for decision tables
37+
- `/src/test/` - Unit tests
38+
- `/docker/` - Docker configurations
39+
- `/obsolete/` - Deprecated code (do not modify)
40+
41+
## Make Commands
42+
43+
Use `make help` to see all available commands. Common targets include:
44+
45+
- `make dev` - Set up development environment
46+
- `make test` - Run tests locally
47+
- `make docker_test` - Run tests in Docker
48+
- `make docs_local` - Serve documentation locally (http://localhost:8000/SSVC/)
49+
- `make docs` - Build and run documentation in Docker
50+
- `make api_dev` - Run API locally with auto-reload
51+
- `make api` - Build and run API in Docker
52+
- `make mdlint_fix` - Run markdown linting with auto-fix
53+
- `make regenerate_json` - Regenerate JSON files from Python modules
54+
55+
## Development Workflow
56+
57+
## Coding Conventions
58+
59+
### Python Code
60+
61+
- Follow PEP 8 style guidelines
62+
- Use type hints for function signatures and return types
63+
- Use Pydantic models for data validation
64+
- Document classes and functions with docstrings
65+
- Prefer explicit imports over wildcard imports
66+
- Module structure uses absolute imports from `ssvc` package
67+
68+
### Naming Conventions
69+
70+
- Python files: `snake_case.py`
71+
- Classes: `PascalCase`
72+
- Functions/variables: `snake_case`
73+
- Constants: `UPPER_SNAKE_CASE`
74+
75+
## Testing Requirements
76+
77+
### Test Structure
78+
79+
- Unit tests use pytest framework
80+
- Tests are located in `/src/test/`
81+
- Test files follow pattern: `test_*.py`
82+
- Run tests with: `make test` or `uv run pytest -v`
83+
84+
### Test Coverage
85+
86+
- Write tests for new Python modules
87+
- Ensure decision points and tables have corresponding tests
88+
- Test JSON schema validation
89+
- Validate data model serialization/deserialization
90+
91+
### Before Committing
92+
93+
1. Run all tests: `make test`
94+
2. Ensure no test failures
95+
3. Fix any linting issues: `make mdlint_fix`
96+
4. Verify documentation builds: `make docs_local`
97+
98+
## Documentation
99+
100+
### Writing Documentation
101+
102+
- Documentation uses MkDocs with Material theme
103+
- Files are in Markdown format in `/docs/`
104+
- Use Python exec blocks for dynamic content generation
105+
- Include examples and code snippets
106+
- Follow existing documentation structure
107+
108+
### Documentation Features
109+
110+
- Automatic API documentation via mkdocstrings
111+
- Python module imports for dynamic content generation
112+
- BibTeX citations via mkdocs-bibtex
113+
- Add markdown files to site navigation by specifying them in `mkdocs.yml`
114+
- Include markdown files in other markdown files with `mkdocs-include-markdown-plugin`
115+
- Dynamically generate content from python code blocks using the `markdown-exec` plugin
116+
117+
## Data Files
118+
119+
### JSON Files
120+
121+
- Located in `/data/json/`
122+
- Generated from Python Pydantic models
123+
- Use JSON schema validation
124+
125+
### CSV Files
126+
127+
- Located in `/data/csv/`
128+
- Define decision table outcomes
129+
- Generated from python modules (The python data objects are authoritative)
130+
- Allows users to explore customizing SSVC for specific environments
131+
132+
## Common Pitfalls
133+
134+
1. **Import Paths**: Use absolute imports like `from ssvc.module import Class`, not relative imports
135+
2. **PYTHONPATH**: When running scripts directly, set `export PYTHONPATH=$PYTHONPATH:$(pwd)/src`
136+
3. **JSON Regeneration**: After modifying decision points/tables, regenerate JSON with `make regenerate_json`
137+
4. **Docker Context**: Some make targets use Docker, others run locally - check the Makefile
138+
5. **Package Management**: Use `make` commands or `uv` directly, not pip
139+
6. **Obsolete Code and Documentation**: Never modify files in `/obsolete/`, `/doc/`, or `/pdfs/` directories
140+
141+
## API Development
142+
143+
- FastAPI application is in `/src/ssvc/api/`
144+
- Run locally with auto-reload: `make api_dev` (serves on http://127.0.0.1:8000/docs)
145+
- Run in Docker: `make api` (serves on http://127.0.0.1:8001/SSVC/)
146+
147+
## Git Workflow
148+
149+
- Create feature branches for new work
150+
- Write descriptive commit messages
151+
- Reference issue numbers in commits when applicable
152+
- Keep commits focused and atomic
153+
- Run tests before pushing
154+
155+
## Additional Resources
156+
157+
- Main documentation: https://certcc.github.io/SSVC/
158+
- Source repository: https://github.com/CERTCC/SSVC
159+
- SSVC Calculator: https://certcc.github.io/SSVC/ssvc-calc/
160+
- Contributing guide: See CONTRIBUTING.md
161+
- Project wiki: https://github.com/CERTCC/SSVC/wiki
162+
163+
## Special Notes
164+
165+
- This project uses a MIT (SEI)-style license with Carnegie Mellon University copyright (see LICENSE file)
166+
- Decision points and tables follow SSVC specification
167+
- Backward compatibility is important for existing data files
168+
- Documentation changes should be reflected in both `/docs/` and `/src/README.md` when applicable

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ updates:
88
- package-ecosystem: "uv" # See documentation for possible values
99
directories:
1010
- "/"
11-
- "/src" # Location of package manifests
1211
schedule:
1312
interval: "weekly"
1413
groups:

.github/workflows/deploy_site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ jobs:
4343
run: |
4444
python -m pip install --upgrade pip
4545
python -m pip install uv
46-
uv sync --project=src --no-dev
46+
uv sync --no-dev
4747
4848
- name: Setup Pages
4949
uses: actions/configure-pages@v5
5050

5151
- name: Build Site
5252
run: |
5353
export PYTHONPATH=src:$PYTHONPATH
54-
uv run --project=src mkdocs build --clean --config-file mkdocs.yml
54+
uv run mkdocs build --clean --config-file mkdocs.yml
5555
5656
- name: Upload artifact
5757
uses: actions/upload-pages-artifact@v4

.github/workflows/link_checker.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ on:
1111
# run on any PR that changes this workflow
1212
- .github/workflows/linkchecker.yml
1313
# run on any PR that changes the pip requirements
14-
- requirements.txt
15-
- src/pyproject.toml
14+
- pyproject.toml
1615
# let us trigger it manually
1716
workflow_dispatch:
1817

@@ -31,13 +30,13 @@ jobs:
3130
- name: Install dependencies
3231
run: |
3332
python -m pip install --upgrade pip uv
34-
uv sync --dev --project=src
33+
uv sync --dev
3534
3635
- name: Build Site
3736
run: |
38-
uv run --project=src mkdocs build --verbose --clean --config-file mkdocs.yml
37+
uv run mkdocs build --verbose --clean --config-file mkdocs.yml
3938
4039
- name: Check links
4140
run: |
42-
uv run --project=src linkchecker site/index.html
41+
uv run linkchecker site/index.html
4342

.github/workflows/python-app.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip uv
31-
uv sync --project=src --dev --frozen
31+
uv sync --dev --frozen
3232
# - uses: psf/black@stable
3333
- name: Test with pytest
3434
run: |
35-
uv run --project=src pytest
35+
uv run pytest
3636
- name: Build
3737
run: |
38-
uv build --project=src
38+
uv build
3939
- name: Upload Artifacts
40-
uses: actions/upload-artifact@v4
40+
uses: actions/upload-artifact@v5
4141
with:
4242
name: ssvc
4343
path: src/dist/ssvc-*.tar.gz

.markdownlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ignores:
2+
- .github/**
13
default: true
24
# disable noisy rules
35
# 0004 Unordered List style

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Project-specific vars
22
MKDOCS_PORT=8765
33
DOCKER_DIR=docker
4-
PROJECT_DIR = ./src
54
DOCKER_COMPOSE=docker-compose --project-directory $(DOCKER_DIR)
6-
UV_RUN=uv run --project $(PROJECT_DIR)
5+
UV_RUN=uv run
76

87
# Targets
98
.PHONY: all test docs api docker_test clean help mdlint_fix up down regenerate_json
@@ -13,15 +12,15 @@ all: help
1312

1413
dev:
1514
@echo "Set up dev environment..."
16-
uv sync --dev --project $(PROJECT_DIR)
15+
uv sync --dev
1716

1817
mdlint_fix:
1918
@echo "Running markdownlint..."
2019
markdownlint --config .markdownlint.yml --fix .
2120

2221
test:
2322
@echo "Running tests locally..."
24-
uv run --project $(PROJECT_DIR) pytest -v
23+
$(UV_RUN) pytest -v
2524

2625
docker_test:
2726
@echo "Building the latest test image..."
@@ -60,7 +59,7 @@ regenerate_json:
6059
clean:
6160
@echo "Cleaning up Docker resources..."
6261
$(DOCKER_COMPOSE) down --rmi local || true
63-
rm -rf $(PROJECT_DIR)/.venv $(PROJECT_DIR)/uv.lock
62+
6463
help:
6564
@echo "Usage: make [target]"
6665
@echo ""

docker/Dockerfile

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /
33
RUN pip install --upgrade pip uv
44
WORKDIR /app
55

6-
ENV VIRTUAL_ENV=/app/.venv
7-
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
8-
9-
RUN python -m venv "${VIRTUAL_ENV}"
106
FROM base AS dependencies
117

12-
ARG BASE_DIR=..
13-
ARG SRC_DIR=${BASE_DIR}/src
14-
158
# Copy the files we need
16-
COPY ${BASE_DIR}/ /app
9+
COPY . /app
1710
# Set the environment variable
1811
ENV PYTHONPATH=/app/src
19-
COPY ${SRC_DIR}/pyproject.toml /app/src/pyproject.toml
20-
COPY ${SRC_DIR}/uv.lock /app/src/uv.lock
2112

2213
# install requirements
23-
RUN uv sync --project=/app/src --frozen
24-
14+
RUN uv sync --frozen
2515

2616
FROM dependencies AS test
17+
2718
ENV PYTHONPATH=/app/src
2819
# Install pytest and dev dependencies
29-
RUN uv sync --project=/app/src --frozen --dev
20+
RUN uv sync --frozen --dev
3021
# Run the unit tests
31-
CMD ["uv", "run", "--project=/app/src", "pytest"]
22+
CMD ["uv", "run", "pytest"]
3223

3324
FROM dependencies AS docs
34-
CMD ["uv", "run", "--project=/app/src", "mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]
25+
CMD ["uv", "run", "mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]
3526

3627
FROM dependencies AS registry_api
37-
CMD ["uv", "run", "--project=/app/src", "uvicorn", "ssvc.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
28+
CMD ["uv", "run", "uvicorn", "ssvc.api.main:app", "--host", "0.0.0.0", "--port", "8000"]

docker/env_example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# copy or link this file to .env in this directory
2+
# this helps avoid docker image/container naming collisions
3+
COMPOSE_PROJECT_NAME=ssvc
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
!!! tip "Default Automatable Values"
2+
3+
If nothing is known about [*Automatable*](/reference/decision_points/automatable.md), the safer answer to assume is [*yes*](/reference/decision_points/automatable.md).
4+
[*Value Density*](/reference/decision_points/value_density.md) should always be answerable; if the product is uncommon, it is probably
5+
[*diffuse*](/reference/decision_points/value_density.md).

0 commit comments

Comments
 (0)