Skip to content

Commit 19f8c86

Browse files
author
Douglas Jones
committed
security: SECURITY.md, Dependabot config, CodeQL scanning, CI workflow
1 parent 3f05e7e commit 19f8c86

4 files changed

Lines changed: 205 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Dependabot configuration for Codifide
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
4+
version: 2
5+
updates:
6+
# Python package dependencies
7+
- package-ecosystem: "pip"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
day: "monday"
12+
open-pull-requests-limit: 5
13+
labels:
14+
- "dependencies"
15+
- "python"
16+
# Only flag security updates automatically — version bumps are low priority
17+
# for a language runtime with no external runtime dependencies.
18+
ignore:
19+
- dependency-name: "*"
20+
update-types: ["version-update:semver-patch"]
21+
22+
# Rust crate dependencies
23+
- package-ecosystem: "cargo"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
day: "monday"
28+
open-pull-requests-limit: 5
29+
labels:
30+
- "dependencies"
31+
- "rust"
32+
ignore:
33+
- dependency-name: "*"
34+
update-types: ["version-update:semver-patch"]
35+
36+
# GitHub Actions
37+
- package-ecosystem: "github-actions"
38+
directory: "/"
39+
schedule:
40+
interval: "weekly"
41+
day: "monday"
42+
open-pull-requests-limit: 3
43+
labels:
44+
- "dependencies"
45+
- "github-actions"

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
test:
11+
name: Python tests (${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.9", "3.11", "3.12"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install package
28+
run: pip install -e ".[blob]"
29+
30+
- name: Run test suite
31+
run: python3 -m pytest tests/ -q --tb=short
32+
33+
- name: Verify dispatch index is current
34+
run: python3 -m codifide dispatch-index --check
35+
36+
- name: Verify capability manifest is current
37+
run: |
38+
python3 -m codifide capability > /tmp/live_manifest.json
39+
python3 -c "
40+
import json, sys
41+
live = json.load(open('/tmp/live_manifest.json'))
42+
checked = json.load(open('docs/capability-0.1.json'))
43+
# Strip generator version for comparison (version changes on every release)
44+
live.pop('generator', None)
45+
checked.pop('generator', None)
46+
if live != checked:
47+
print('docs/capability-0.1.json is stale — regenerate with: python3 -m codifide capability > docs/capability-0.1.json')
48+
sys.exit(1)
49+
print('Capability manifest is current.')
50+
"

.github/workflows/codeql.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "CodeQL — Security scanning"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
# Run weekly on Monday at 08:00 UTC
10+
- cron: "0 8 * * 1"
11+
12+
jobs:
13+
analyze:
14+
name: Analyze (${{ matrix.language }})
15+
runs-on: ubuntu-latest
16+
permissions:
17+
security-events: write
18+
packages: read
19+
actions: read
20+
contents: read
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- language: python
27+
build-mode: none
28+
- language: actions
29+
build-mode: none
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v3
37+
with:
38+
languages: ${{ matrix.language }}
39+
build-mode: ${{ matrix.build-mode }}
40+
# Queries: security-extended catches more than the default set.
41+
# security-and-quality adds style/maintainability on top.
42+
queries: security-extended
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@v3
46+
with:
47+
category: "/language:${{ matrix.language }}"

SECURITY.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Security Policy
2+
3+
## Supported versions
4+
5+
| Version | Supported |
6+
|---------|-----------|
7+
| 4.x | ✅ Current release — security fixes applied |
8+
| 3.x | ⚠️ Critical fixes only |
9+
| < 3.0 | ❌ No longer supported |
10+
11+
## Reporting a vulnerability
12+
13+
**Please do not report security vulnerabilities through public GitHub issues.**
14+
15+
Use GitHub's private vulnerability reporting instead:
16+
1. Go to the [Security tab](https://github.com/codifide/codifide-programming-language/security)
17+
2. Click **"Report a vulnerability"**
18+
3. Fill in the details
19+
20+
We will acknowledge receipt within **48 hours** and aim to provide a fix or
21+
mitigation within **14 days** for critical issues.
22+
23+
## What counts as a security vulnerability
24+
25+
- **Interpreter sandbox escapes** — a Codifide program that performs effects
26+
not declared in its `effects {}` signature, bypassing the transitive effect
27+
check
28+
- **Store integrity bypass** — a way to write to the symbol store without
29+
hash verification, or to read bytes that do not match the declared identity
30+
- **Path traversal in `io.read` / `io.write`** — bypassing the `..` defense
31+
- **HTTPS enforcement bypass in `http.get` / `http.post`** — making HTTP
32+
requests to non-HTTPS URLs
33+
- **Registry authentication bypass** — accessing `POST /symbols` without a
34+
valid `REGISTRY_WRITE_TOKEN`
35+
- **Denial of service** — inputs that cause the interpreter to hang, exhaust
36+
memory, or crash the host process
37+
38+
## What does not count
39+
40+
- Programs that produce wrong output due to a logic bug (use a regular issue)
41+
- Performance problems that do not constitute a DoS (use a regular issue)
42+
- Theoretical vulnerabilities without a proof of concept
43+
44+
## Security design notes
45+
46+
Codifide's security model is documented in the interpreter and store:
47+
48+
- **Effect enforcement** is transitive and checked at module load, not at
49+
runtime. A pure function cannot call an effectful one without the violation
50+
being caught before any code executes.
51+
- **Content addressing** means the store cannot return different bytes under
52+
the same identity — every read is hash-verified.
53+
- **The RPC server** binds to `127.0.0.1` only by default. It is not safe to
54+
expose over a network without a reverse proxy with TLS and authentication.
55+
- **`io.read` and `io.write`** reject paths containing `..` before any
56+
filesystem access.
57+
- **`http.get` and `http.post`** reject non-HTTPS URLs before any network
58+
request.
59+
60+
## Disclosure policy
61+
62+
We follow coordinated disclosure. We will credit reporters in the release
63+
notes unless they prefer to remain anonymous.

0 commit comments

Comments
 (0)