Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:
env:
LC_ALL: C.UTF-8
LANG: C.UTF-8
CI_DEFER_ARTIFACT_LINK_RESOLUTION: "1"

defaults:
run:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/code-analysis-evidence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: code-analysis-evidence

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
code-analysis-evidence:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.102

- name: Verify code analysis evidence
run: bash tools/audit/verify-code-analysis-evidence.sh

- name: Validate result schema
if: always()
run: dotnet restore --locked-mode tools/ci/checks/ResultSchemaValidator/ResultSchemaValidator.csproj && dotnet build -c Release tools/ci/checks/ResultSchemaValidator/ResultSchemaValidator.csproj && dotnet tools/ci/checks/ResultSchemaValidator/bin/Release/net10.0/ResultSchemaValidator.dll --schema tools/ci/schema/result.schema.json --result artifacts/ci/code-analysis-evidence/result.json

- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-code-analysis-evidence
path: |
artifacts/ci/code-analysis-evidence/
artifacts/audit/code_inventory.json
artifacts/audit/callgraph_inventory.json
artifacts/audit/dead_code_candidates.json
artifacts/audit/redundancy_candidates.json
artifacts/audit/hardening_candidates.json
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/nuget-online-convergence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
verify-convergence:
if: github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.event == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

permissions:
contents: read
attestations: write
id-token: write

jobs:
version-policy:
Expand Down Expand Up @@ -91,6 +93,7 @@ jobs:
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -139,6 +142,28 @@ jobs:
NUGET_API_KEY: ${{ steps.nuget_login.outputs.NUGET_API_KEY }}
run: bash tools/ci/release/publish_nuget.sh "${{ steps.nupkg.outputs.path }}"

- name: Attest package provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: "${{ steps.nupkg.outputs.path }}"

- name: Verify package attestation
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
mkdir -p artifacts/nuget
gh attestation verify "${{ steps.nupkg.outputs.path }}" --repo "${{ github.repository }}" > artifacts/nuget/attestation-verify.txt

- name: Upload attestation verification artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: nuget-attestation-verify
path: artifacts/nuget/attestation-verify.txt
if-no-files-found: error

- name: Gate 4 - SVT post-publish (git version == package version == nuget version)
shell: bash
run: bash tools/ci/release/gate4_verify_postpublish.sh "${GITHUB_REF_NAME#v}" "${{ steps.nupkg.outputs.path }}"
45 changes: 45 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: scorecard

on:
branch_protection_rule:
schedule:
- cron: '23 3 * * 1'
push:
branches: ["main"]
workflow_dispatch:

permissions:
security-events: write
id-token: write
contents: read
actions: read

jobs:
scorecard:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Prepare scorecard artifact directory
run: mkdir -p artifacts/ci/scorecard

- name: Run OpenSSF Scorecard
uses: ossf/scorecard-action@v2.3.3
with:
results_file: artifacts/ci/scorecard/results.sarif
results_format: sarif
publish_results: true

- name: Upload SARIF to code scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: artifacts/ci/scorecard/results.sarif

- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-scorecard
path: artifacts/ci/scorecard/
if-no-files-found: error
46 changes: 46 additions & 0 deletions .github/workflows/security-claims-evidence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: security-claims-evidence

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
security-claims-evidence:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.102

- name: Assert required CLI tools
run: command -v gh && command -v jq

- name: Verify security claims
env:
GH_TOKEN: ${{ secrets.SECURITY_CLAIMS_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: bash tools/audit/verify-security-claims.sh

- name: Validate result schema
if: always()
run: dotnet restore --locked-mode tools/ci/checks/ResultSchemaValidator/ResultSchemaValidator.csproj && dotnet build -c Release tools/ci/checks/ResultSchemaValidator/ResultSchemaValidator.csproj && dotnet tools/ci/checks/ResultSchemaValidator/bin/Release/net10.0/ResultSchemaValidator.dll --schema tools/ci/schema/result.schema.json --result artifacts/ci/security-claims-evidence/result.json

- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-security-claims-evidence
path: artifacts/ci/security-claims-evidence/
if-no-files-found: error
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Delegationshinweis: `ArchiveProcessing` ist bei path-basierten Archivpfaden eine
- [Dokumentationsindex](https://github.com/tomtastisch/FileClassifier/blob/main/docs/001_INDEX_CORE.MD)
- [API-Kernübersicht](https://github.com/tomtastisch/FileClassifier/blob/main/docs/010_API_CORE.MD)
- [Architektur und Flows](https://github.com/tomtastisch/FileClassifier/blob/main/docs/020_ARCH_CORE.MD)
- [Audit Index](https://github.com/tomtastisch/FileClassifier/blob/main/docs/audit/000_INDEX.MD)
- [HMAC Key Setup (SSOT)](https://github.com/tomtastisch/FileClassifier/blob/main/docs/secure/001_HMAC_KEY_SETUP.MD)
- [Migration: Hashing Rename](https://github.com/tomtastisch/FileClassifier/blob/main/docs/migrations/001_HASHING_RENAME.MD)
- [Governance und Policies](https://github.com/tomtastisch/FileClassifier/blob/main/docs/governance/001_POLICY_CI.MD)
Expand All @@ -167,6 +168,9 @@ Delegationshinweis: `ArchiveProcessing` ist bei path-basierten Archivpfaden eine
dotnet build FileClassifier.sln -v minimal
dotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release -v minimal
python3 tools/check-docs.py
bash tools/audit/verify-security-claims.sh
bash tools/audit/generate-code-analysis-json.sh
gh attestation verify artifacts/nuget/*.nupkg --repo tomtastisch/FileClassifier
python3 tools/check-policy-roc.py --out artifacts/policy_roc_matrix.tsv
bash tools/ci/bin/run.sh versioning-svt
bash tools/ci/bin/run.sh naming-snt
Expand Down
106 changes: 106 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Sicherheitsrichtlinie (SECURITY.md)

## 1. Zweck und Geltungsbereich
Diese Richtlinie beschreibt die Meldung, Bearbeitung und koordinierte Offenlegung von
Sicherheitsluecken im Repository `tomtastisch/FileClassifier`.

Die Ausgestaltung ist an bewaehrten Prozessen orientiert, insbesondere:
- ISO/IEC 29147 (Vulnerability Disclosure)
- ISO/IEC 30111 (Vulnerability Handling Processes)

Hinweis: Diese Richtlinie ist ein operatives Projekt-Policy-Dokument und kein
Zertifizierungs- oder Rechtsgutachten.

## 2. Unterstuetzte Versionen (Security Fixes)
Security-Fixes werden nur fuer den aktuell unterstuetzten Major bereitgestellt.

| Version | Security-Support |
| ------- | ---------------- |
| 5.x | Ja |
| < 5.0 | Nein |

## 3. Meldung einer Sicherheitsluecke
Bitte melde Sicherheitsluecken **nicht** ueber oeffentliche Issues.

Primarer Meldeweg:
- GitHub Private Vulnerability Reporting / Security Advisory:
[Repository Security](https://github.com/tomtastisch/FileClassifier/security)
(dort "Report a vulnerability" verwenden)

Wenn die Plattform technisch nicht verfuegbar ist, bitte einen Issue ohne technische
Exploit-Details erstellen und auf vertraulichen Kontakt hinweisen.

## 4. Erforderliche Angaben in der Meldung
Bitte liefere nach Moeglichkeit:
- betroffene Version(en) und Umgebung
- klare Reproduktionsschritte
- erwartetes vs. tatsaechliches Verhalten
- Impact-Einschaetzung (Vertraulichkeit, Integritaet, Verfuegbarkeit)
- Proof-of-Concept in minimaler, sicherer Form
- bekannte Mitigations/Workarounds

## 5. Prozess und Reaktionszeiten (kompaktes SLA)
- Eingangsbestaetigung: in der Regel innerhalb von **5 Werktagen**
- Triage und Priorisierung: risikobasiert (Schweregrad, Ausnutzbarkeit, Reichweite)
- Behebungsplanung und Kommunikation: nach Risiko, Komplexitaet und Release-Zyklus

Es besteht kein Anspruch auf sofortige Behebung; wir arbeiten risikoorientiert und
koordinieren die Kommunikation transparent im Advisory-Prozess.

## 6. Safe Harbor fuer gutglaeubige Sicherheitsforschung
Wir begruessen verantwortungsvolle, gutglaeubige Forschung innerhalb folgender Leitplanken:
- keine absichtliche Datenexfiltration, Datenveraenderung oder dauerhafte Stoerung
- keine Denial-of-Service-Tests oder Lastspitzen gegen Produktions-/fremde Systeme
- kein Social Engineering, kein Phishing, keine physische Angriffe
- keine automatisierten Massen-Scans ohne vorherige Abstimmung
- nur notwendige, minimale Testtiefe zur Nachweisfuehrung
- unverzuegliche vertrauliche Meldung bei Fund

Wenn du in gutem Glauben und im Rahmen dieser Leitplanken handelst, betrachten wir das
als verantwortungsvolle Forschung und streben eine kooperative Loesung an.

## 7. Koordinierte Offenlegung
Wir verfolgen koordiniertes Disclosure:
- Oeffentliche Details erst nach verfuegbarem Fix oder abgestimmter Mitigation
- Zeitfenster werden fallbezogen zwischen Maintainern und meldender Person abgestimmt
- Credits werden auf Wunsch im Advisory genannt

## 8. Nicht unterstuetzte Meldungskanaele
- Oeffentliche GitHub Issues/Discussions fuer ungepatchte Schwachstellen
- Veroeffentlichung von Exploit-Details vor abgestimmter Offenlegung

## 9. Nachweisbarkeit und Einsatz in sicherheitsrelevanten Umgebungen
Dieses Repository trifft **keine** Aussage ueber formale Zertifizierung (z. B. ISO 27001,
IEC 62443, Common Criteria) des Produkts oder eines Betreiber-ISMS.

Der Einsatz in sicherheitsrelevanten oder systemkritischen Architekturen ist nur
verantwortbar, wenn die betreibende Organisation zusaetzliche, eigene Kontrollen
nachweisbar umsetzt (z. B. Threat Modeling, Haertung, Betriebsmonitoring, Incident Response,
Schluesselmanagement, Netzwerksegmentierung, Backup/Restore-Tests, Change-Management).

Nachweisbare, repo-seitige Sicherheitsmechanismen (Stand dieses Projekts):
- Security-Vulnerability-Meldeweg via GitHub Repository Security
- CI-Gate `security-nuget` fuer Vulnerability- und Deprecation-Scans
- Branch-Protection mit festen Required Contexts auf `main`
- Release-Publish via OIDC Trusted Publishing fuer NuGet (kein statischer API-Key im
regulaeren Publish-Pfad)

Empfohlener Mindestnachweis vor Produktiveinsatz:
```bash
dotnet build FileClassifier.sln -v minimal
dotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release -v minimal
bash tools/ci/bin/run.sh security-nuget
python3 tools/check-docs.py
```

Optional fuer erweiterten Nachweis:
```bash
bash tools/ci/bin/run.sh tests-bdd-coverage
bash tools/ci/bin/run.sh api-contract
bash tools/ci/bin/run.sh pack
bash tools/ci/bin/run.sh consumer-smoke
bash tools/ci/bin/run.sh package-backed-tests
```

Vielen Dank fuer verantwortungsvolle Meldungen und die Unterstuetzung der
Sicherheit von FileClassifier.
41 changes: 41 additions & 0 deletions docs/audit/000_INDEX.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Audit Index

## Scope
Central index for evidence-hardening artifacts that support claims in `SECURITY.md` without modifying `SECURITY.md` itself.

## Documents
- `docs/audit/000_HASHING_BASELINE.MD`
- `docs/audit/000_INDEX.MD`
- `docs/audit/002_AUDIT_CONTRACT_AND_GUARDRAILS.MD`
- `docs/audit/011_SECURITY_BENCHMARK.MD`
- `docs/audit/003_SECURITY_ASSERTION_TRACEABILITY.MD`
- `docs/audit/004_CERTIFICATION_AND_ATTESTATION_ROADMAP.MD`
- `docs/audit/005_CODE_ANALYSIS_METHOD.MD`
- `docs/audit/006_CODE_REVIEW_FINDINGS.MD`
- `docs/audit/007_THREAT_MODEL.MD`
- `docs/audit/008_INCIDENT_RESPONSE_RUNBOOK.MD`
- `docs/audit/009_SUPPLY_CHAIN_BASELINE.MD`
- `docs/audit/010_REFACTOR_BACKLOG.MD`

## Machine Evidence
- `artifacts/ci/security-claims-evidence/`
- `artifacts/ci/code-analysis-evidence/`
- `artifacts/audit/code_inventory.json`
- `artifacts/audit/callgraph_inventory.json`
- `artifacts/audit/dead_code_candidates.json`
- `artifacts/audit/redundancy_candidates.json`
- `artifacts/audit/hardening_candidates.json`

## Repro Commands
```bash
bash tools/audit/verify-security-claims.sh
bash tools/audit/verify-code-analysis-evidence.sh
bash tools/audit/generate-code-analysis-json.sh
python3 tools/check-docs.py
```

## External Assurance
- OpenSSF Scorecard workflow: `.github/workflows/scorecard.yml`
- Artifact attestations in release workflow: `.github/workflows/release.yml`
- Deep analysis evidence workflow: `.github/workflows/code-analysis-evidence.yml`
- GitHub Code Scanning Default Setup (configured): `gh api repos/<owner>/<repo>/code-scanning/default-setup`
Loading
Loading