qa(security): add security coverage (deny/audit/gitleaks/fuzz/authz/SBOM)#28
Open
UberMetroid wants to merge 1 commit into
Open
qa(security): add security coverage (deny/audit/gitleaks/fuzz/authz/SBOM)#28UberMetroid wants to merge 1 commit into
UberMetroid wants to merge 1 commit into
Conversation
…BOM) - .github/workflows/security.yml: CI for cargo-deny, cargo-audit, gitleaks, cargo-fuzz smoke build, and CycloneDX SBOM generation. - .github/gitleaks.toml: secret-scanning config with rustle-specific allowlist (target/, dist/, tests/ui/, wordlists, Cargo.lock). - deny.toml: cargo-deny policy (licenses, advisory db, sources). - fuzz/: cargo-fuzz harness crate excluded from main workspace, with four self-contained targets: fuzz_scorer (statuses.rs), fuzz_encryption_roundtrip (encryption.rs), fuzz_holiday_date_math (holidays.rs), fuzz_pin_helper (cookie parsing + constant-time eq). - backend/tests/authz.rs: integration suite covering auth_middleware, bypass paths, cookie attributes, body size, lockout/rate limit, security headers, and path-traversal probes. - backend/src/lib.rs: minimal library shim so the integration tests can call real handler/middleware functions in-process via tower::ServiceExt::oneshot (no behavior change to existing bins). - backend/Cargo.toml: dev-deps for tower/http-body-util/hyper and shared-backend used by the test harness. - Cargo.toml: exclude fuzz/ from the main workspace.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Security Coverage for rustle
This PR adds security testing infrastructure without modifying production behavior.
What is new
.github/workflows/security.yml- CI jobs for cargo-deny, cargo-audit, gitleaks, cargo-fuzz smoke build, and CycloneDX SBOM generation..github/gitleaks.toml- Secret-scanning configuration with rustle-specific allowlist (target/, dist/, tests/ui/, wordlists, Cargo.lock).deny.toml- cargo-deny policy for advisory DB, licenses, and sources.fuzz/- cargo-fuzz harness crate excluded from the main workspace. Four self-contained targets:fuzz_scorer(port ofhelpers/statuses.rs)fuzz_encryption_roundtrip(port ofhelpers/encryption.rs)fuzz_holiday_date_math(port ofutils/holidays.rs+ Easter/Thanksgiving math)fuzz_pin_helper(cookie parsing + constant-time PIN comparison)backend/tests/authz.rs- 22 integration tests coveringauth_middleware, HTML/API bypass paths, cookie attributes (HttpOnly, SameSite=Strict, Path=/, Max-Age), security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Content-Security-Policy), PIN validation (empty, length mismatch, whitespace), lockout (429 after max_attempts), rate limit via /api/verify-pin, and path-traversal probes.backend/src/lib.rs- minimal library shim re-exportingauth,routes,utilsso the integration tests can call the real handler/middleware functions in-process viatower::ServiceExt::oneshot. No behavior change to the existingserver/shbinaries.backend/Cargo.toml- dev-deps fortower,http-body-util,hyper, andshared-backendused by the test harness.Cargo.toml- excludesfuzz/from the main workspace (cargo-fuzz requires a package manifest).Validation run locally
Notes and limitations
web-sys/gloo/Yew which require WebAssembly targets.backend/src/lib.rslibrary shim needed to makeauth/routes/utilsimportable from integration tests; the existing[[bin]]binaries continue to build and behave identically.cargo +nightly fuzz build; CI builds them on Linux x86_64 only.