CI security gate for this site
GitHub ActionsCodeQLgitleaksnpm auditCycloneDXDependabotOWASP ZAPDockeraxe-coreLighthouse CI
Problem: a personal site is easy to ship once and let drift, and I built this one with an AI assistant, so I cannot vouch for it by having written every line. I wanted evidence that fails loudly instead of trust.
Approach: run a fixed set of checks on every push to main and every pull request, and keep the pipeline itself tight.
- Tests: type check, unit tests, build, and tests that inspect the built output (no inline styles or handlers, no unhashed scripts, no third-party loads, no broken links), also repeated inside the Docker image.
- Quality: axe accessibility scans, end-to-end tests in real Chrome, and Lighthouse CI with a required accessibility score of 100.
- Dependencies:
npm auditandnpm audit signatures, a CycloneDX SBOM artifact, and weekly Dependabot updates for npm and GitHub Actions. - Code and secrets: CodeQL for JavaScript and TypeScript, and gitleaks for secrets (with the full git history checked out), plus a weekly scheduled run of the security checks.
- Deployed site: a weekly OWASP ZAP baseline scan of the live site, which is passive and checks headers, the content security policy and cookies. It reports only for now and does not fail the run.
- Hygiene: actions pinned to commit SHAs,
npm ci --ignore-scripts, read-only workflow permissions, and a development container with all capabilities dropped. - A guard for the guard: tests that fail if the content security policy is loosened, if an action stops being pinned, or if a workflow gains a write permission.
Outcome: every change to the site runs through the same set of checks. The write-up, A security gate for a personal site, built with an AI assistant, covers how it was built and where it falls short.
What it does not do yet: on a free private repository GitHub offers no branch protection, so passing checks are a habit and not a requirement. CodeQL results are not uploaded to GitHub, nothing actively attacks the running site (the ZAP scan is passive), and the SBOM is neither signed nor attested. I plan to add SonarCloud (SAST), Snyk (SCA) and Renovate, none of which is set up yet.