-
Notifications
You must be signed in to change notification settings - Fork 0
Create security improvements for the project to ensure PROD-SAFETY #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6eb2c2c
Create SECURITY.md for security policy
tomtastisch ddf783f
docs(security): replace template with evidence-based production secur…
github-actions[bot] c3704d2
docs(audit): add evidence-based security policy benchmark matrix
github-actions[bot] fe74543
feat(audit): implement security claim evidence, scorecard, codeql bui…
github-actions[bot] c4549f1
fix(ci): unblock preflight and claims check; align with default code …
github-actions[bot] 22830e7
fix(ci): unblock preflight and security-claims with deterministic API…
github-actions[bot] 3fbe4e3
feat(audit): add cluster-7 code-analysis evidence pipeline
github-actions[bot] 391ba6c
docs(audit): harden cluster-8 governance baselines
github-actions[bot] 4f7943c
docs(audit): add cluster-7c prioritized refactor backlog
github-actions[bot] 163ec4f
fix(actions): prevent workflow_run cache-poisoning by trusted checkout
github-actions[bot] fd03743
refactor(security): narrow broad catches in entry points (package-a)
github-actions[bot] 5e84900
refactor(core): consolidate fail-closed error handling helpers
github-actions[bot] ac983ef
fix(review): address copilot findings across workflows, audit scripts…
github-actions[bot] ff14d15
fix(ci): drop unused security-events permission in claims workflow
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
tomtastisch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload SARIF to code scanning | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: artifacts/ci/scorecard/results.sarif | ||
tomtastisch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload Artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ci-scorecard | ||
| path: artifacts/ci/scorecard/ | ||
| if-no-files-found: error | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
tomtastisch marked this conversation as resolved.
Show resolved
Hide resolved
tomtastisch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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` | ||
tomtastisch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - `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` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.