Skip to content

Commit b12ccdd

Browse files
docs(security): rewrite security policy and add RFC 9116 security.txt (#1394)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent db3dd85 commit b12ccdd

5 files changed

Lines changed: 104 additions & 34 deletions

File tree

.github/workflows/ci-security-scan.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Security
22

33
# CodeQL SAST scanning is handled by GitHub's Default Setup (enabled in repo settings).
44
# This provides automatic scanning on push/PR with incremental analysis and zero maintenance.
5-
# This workflow handles dependency scanning (Trivy) and secret detection (TruffleHog).
5+
# This workflow handles dependency scanning (Trivy), secret detection (TruffleHog), and
6+
# a freshness check on the RFC 9116 security.txt Expires field.
67

78
on:
89
workflow_call:
@@ -27,6 +28,8 @@ jobs:
2728
display-name: "Dependencies"
2829
- scan-type: secrets
2930
display-name: "Secrets"
31+
- scan-type: policy
32+
display-name: "Policy"
3033
permissions:
3134
security-events: write
3235
contents: read
@@ -58,3 +61,21 @@ jobs:
5861
base: ${{ github.event_name == 'pull_request' && github.base_ref || '' }}
5962
head: ${{ github.event_name == 'pull_request' && 'HEAD' || '' }}
6063
extra_args: --debug --only-verified
64+
65+
# RFC 9116 requires a valid Expires date. Fail before it lapses so an
66+
# active branch is forced to renew it — a stale file signals abandonment.
67+
- name: security.txt freshness
68+
if: matrix.scan-type == 'policy'
69+
run: |
70+
file="webapp/public/.well-known/security.txt"
71+
expires="$(grep -i '^Expires:' "$file" | head -1 | cut -d' ' -f2)"
72+
if [ -z "$expires" ]; then
73+
echo "::error file=$file::Missing required RFC 9116 Expires field"
74+
exit 1
75+
fi
76+
days=$(( ( $(date -u -d "$expires" +%s) - $(date -u +%s) ) / 86400 ))
77+
echo "security.txt expires in $days day(s) ($expires)"
78+
if [ "$days" -lt 30 ]; then
79+
echo "::error file=$file::Expires is $days day(s) away (<30); renew it per RFC 9116"
80+
exit 1
81+
fi

CONTRIBUTING.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Read the [local development guide](https://ls1intum.github.io/Hephaestus/contributor/local-development) on how to set up your environment.
44

5+
## Maintenance Status
6+
7+
Hephaestus is a research project at TUM, actively developed but maintained primarily by one person. Issues and pull requests are triaged on a best-effort basis. Security reports are the exception and get priority — see [SECURITY.md](SECURITY.md) for how to report vulnerabilities privately.
8+
59
## Identity and Transparency
610

711
To ensure a transparent and trustworthy environment, we have established different guidelines for members of our organization and external contributors.
@@ -45,28 +49,29 @@ We use **Semantic Release** to automatically version and release our application
4549

4650
**❌ Will NOT Trigger Release** (Scope Overrides):
4751

48-
| Pattern | Example | Why |
49-
|---------|---------|-----|
50-
| `*(ci):` | `fix(ci): update workflow` | CI/GitHub Actions only |
51-
| `*(config):` | `chore(config): update renovate.json` | **TOOLING only** (see warning below) |
52-
| `*(deps-dev):` | `chore(deps-dev): update test lib` | Dev dependencies only |
53-
| `*(scripts):` | `fix(scripts): fix build script` | Build/dev scripts only |
54-
| `*(no-release):`| `feat(no-release): internal feature` | Explicit opt-out |
52+
| Pattern | Example | Why |
53+
| ---------------- | ------------------------------------- | ------------------------------------ |
54+
| `*(ci):` | `fix(ci): update workflow` | CI/GitHub Actions only |
55+
| `*(config):` | `chore(config): update renovate.json` | **TOOLING only** (see warning below) |
56+
| `*(deps-dev):` | `chore(deps-dev): update test lib` | Dev dependencies only |
57+
| `*(scripts):` | `fix(scripts): fix build script` | Build/dev scripts only |
58+
| `*(no-release):` | `feat(no-release): internal feature` | Explicit opt-out |
5559

5660
> ⚠️ **`config` scope warning:** Only use for tooling config files like `.prettierrc`, `renovate.json`, `eslint.config.js`. Do NOT use for:
61+
>
5762
> - Runtime config (`application.yml`) → use `server`
5863
> - Dockerfiles → use service scope (`webapp`, `server`, etc.)
5964
> - Production compose files → use `docker`
6065
6166
**✅ WILL Trigger Release**:
6267

63-
| Type | Version | Example |
64-
|------|---------|---------|
65-
| `feat:` | **Minor** | `feat(webapp): add dark mode` |
66-
| `fix:` | **Patch** | `fix(api): handle null response` |
67-
| `perf:` | **Patch** | `perf: optimize query` |
68-
| `revert:` | **Patch** | `revert: undo change` |
69-
| `!:` | **Major** | `feat!: new api structure` |
68+
| Type | Version | Example |
69+
| --------- | --------- | -------------------------------- |
70+
| `feat:` | **Minor** | `feat(webapp): add dark mode` |
71+
| `fix:` | **Patch** | `fix(api): handle null response` |
72+
| `perf:` | **Patch** | `perf: optimize query` |
73+
| `revert:` | **Patch** | `revert: undo change` |
74+
| `!:` | **Major** | `feat!: new api structure` |
7075

7176
**❌ Will NOT Trigger Release** (Type-Based):
7277
`docs:`, `style:`, `refactor:`, `test:`, `build:`, `chore:`, `ci:`

SECURITY.md

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,54 @@
11
# Security Policy
22

3+
## Reporting a Vulnerability
4+
5+
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
6+
7+
Report privately via [GitHub private vulnerability reporting](https://github.com/ls1intum/Hephaestus/security/advisories/new) — it keeps the report confidential and credits you in the resulting advisory. If you cannot use GitHub, email [felixtj.dietrich@tum.de](mailto:felixtj.dietrich@tum.de) with the subject "Hephaestus Security Vulnerability Report".
8+
9+
Please include as much as you can:
10+
11+
- The affected component (application server, webapp, webhook receiver, deployment configuration, ...)
12+
- Steps to reproduce, ideally with a proof of concept
13+
- The impact — what an attacker could achieve
14+
- Any suggested fix or mitigation
15+
16+
## What to Expect
17+
18+
Security reports are triaged before other work.
19+
20+
- **Initial response within 14 days.**
21+
- We follow **coordinated disclosure**: please give us time to ship a fix before disclosing publicly. If we cannot agree on a timeline, we treat **90 days** from your report as the default disclosure date, shortened when a vulnerability is being actively exploited.
22+
- Confirmed vulnerabilities are fixed as soon as feasible and published as [GitHub Security Advisories](https://github.com/ls1intum/Hephaestus/security/advisories). You are credited unless you prefer to stay anonymous.
23+
24+
We do not run a bug bounty program.
25+
26+
## Safe Harbor
27+
28+
We consider good-faith security research conducted under this policy to be authorized, and we will not pursue or support legal action against you for it. If a third party takes action against you for such research, we will make our authorization known. In return, only access the minimum data needed to demonstrate an issue, and do not degrade, disrupt, or destroy data or service.
29+
330
## Supported Versions
431

5-
At this time, there are no officially supported versions of this project for security updates. We are actively developing and improving the project. Please check back later for updates on supported versions.
32+
Hephaestus is pre-1.0 and released continuously from `main`; **only the latest release is supported**. There are no maintenance branches or backports.
633

7-
## Reporting a Vulnerability
34+
## Scope
835

9-
We take the security of our project seriously. If you discover a vulnerability, please follow the steps below to report it:
36+
In scope: the code in this repository — the Spring Boot application server (including the webhook receiver), the React webapp, and the deployment/Docker configuration we ship.
1037

11-
1. **Contact Information**: Send an email to [felixtj.dietrich@tum.de] with the subject line "Security Vulnerability Report".
38+
Out of scope:
1239

13-
2. **Details to Include**:
14-
- A description of the vulnerability.
15-
- Steps to reproduce the vulnerability.
16-
- Potential impact of the vulnerability.
17-
- Any available patches or suggestions for fixing the issue.
40+
- Vulnerabilities in third-party dependencies without a Hephaestus-specific exploit path — report those upstream
41+
- Denial-of-service, volumetric attacks, and scanner output without a demonstrated impact
42+
- Social engineering or phishing of maintainers or users
43+
- Testing against deployments you do not operate — **do not test against our production instances**; run your own (see the [local development guide](https://ls1intum.github.io/Hephaestus/contributor/local-development))
1844

19-
3. **Response Time**:
20-
- You can expect an initial acknowledgment of your report within 48 hours.
21-
- We will provide regular updates on the status of your report as we investigate and address the issue.
45+
## Automated Security Measures
2246

23-
4. **Handling of the Vulnerability**:
24-
- If the vulnerability is confirmed, we will work to release a patch as soon as possible.
25-
- You will be credited for your discovery if you wish, or you can remain anonymous.
26-
- If the report is declined, we will provide a detailed explanation as to why it does not meet the criteria for a security vulnerability.
47+
Independent of this reporting channel, the project runs:
2748

28-
5. **Confidentiality**:
29-
- Please do not disclose the vulnerability publicly until we have had an opportunity to address it.
49+
- **Dependency updates**: [Renovate](https://docs.renovatebot.com/) (Mend-hosted) with vulnerability alerts prioritized and auto-merged ([`renovate.json`](renovate.json))
50+
- **Dependency & secret scanning in CI**: Trivy filesystem scan and TruffleHog ([`ci-security-scan.yml`](.github/workflows/ci-security-scan.yml))
51+
- **Static analysis**: GitHub CodeQL
52+
- **Native alerts**: GitHub secret scanning and Dependabot dependency alerts
3053

31-
Thank you for helping us keep our project safe and secure!
54+
A machine-readable [`security.txt`](https://hephaestus.aet.cit.tum.de/.well-known/security.txt) ([RFC 9116](https://www.rfc-editor.org/info/rfc9116/)) points to this policy.

webapp/docker/nginx.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ server {
128128
add_header Permissions-Policy "geolocation=(), camera=(), microphone=(), payment=()" always;
129129
}
130130

131+
# ==========================================================================
132+
# RFC 9116 security.txt - plain text, must not fall through to the SPA shell
133+
# ==========================================================================
134+
location = /.well-known/security.txt {
135+
types { } default_type "text/plain; charset=utf-8";
136+
add_header Cache-Control "no-cache" always;
137+
add_header X-Content-Type-Options "nosniff" always;
138+
add_header X-Frame-Options "DENY" always;
139+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
140+
add_header Cross-Origin-Opener-Policy "same-origin" always;
141+
add_header Permissions-Policy "geolocation=(), camera=(), microphone=(), payment=()" always;
142+
try_files $uri =404;
143+
}
144+
131145
# ==========================================================================
132146
# SPA routing - using error_page pattern to avoid duplicate headers
133147
# ==========================================================================
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Hephaestus security policy: https://github.com/ls1intum/Hephaestus/blob/main/SECURITY.md
2+
Contact: https://github.com/ls1intum/Hephaestus/security/advisories/new
3+
Contact: mailto:felixtj.dietrich@tum.de
4+
Policy: https://github.com/ls1intum/Hephaestus/blob/main/SECURITY.md
5+
Canonical: https://hephaestus.aet.cit.tum.de/.well-known/security.txt
6+
Preferred-Languages: en, de
7+
Expires: 2027-07-16T00:00:00Z

0 commit comments

Comments
 (0)