Secrets, Environment Variables & Security in CI
Context
Every CI/CD pipeline deals with secrets: API keys for third-party services, cloud provider credentials for deployment, database URLs for integration tests, tokens to pull private npm packages. The naive approach puts the secret in the repository as a plain environment variable or a .env file. This has caused some of the most damaging security incidents in software history. Secrets committed to git are permanent; they appear in every clone, every fork, every git log, and every GitHub archive export, long after the original file is deleted.
GitGuardian's 2026 secret-sprawl scan of public GitHub found 29 million exposed credentials on the platform in a single year. The pattern is always the same: a developer accidentally commits a credential, often in a configuration file or environment file, often "just temporarily." Attackers continuously scan public repositories and leaked data for credential patterns. A 2022 Comparitech honeypot experiment that planted a live AWS key in a public repository found it discovered and abused within about a minute.
Frontend CI pipelines face a specific compounding risk: build tools like Vite and Next.js have a convention of exposing environment variables prefixed with VITE_ or NEXT_PUBLIC_ into the client-side JavaScript bundle. Any variable with this prefix is intentionally made public: it is inlined as a string literal into the JavaScript that ships to every browser. A developer who puts a secret API key into VITE_API_SECRET has shipped that secret to every user who loads the application.
This article covers secret storage and injection, the public-variable distinction, secret scanning, keyless cloud authentication via OIDC, dependency security, and supply chain integrity, using GitHub Actions as the worked example throughout. The same primitives, an encrypted secret store and OIDC federation to the cloud provider, exist in GitLab CI, CircleCI, and Buildkite.
Visual
The following diagram shows the correct secret lifecycle: from creation to use in CI, with the key constraint that secrets never enter the client-side JavaScript bundle.
Example
1. GitHub Actions secrets: repository, environment, and organization scopes
GitHub Actions has three scopes for encrypted secrets:
- Repository secrets: available to all workflows in one repository
- Environment secrets: available only to workflows deploying to a named environment (e.g.,
production), and can require manual approval - Organization secrets: available to selected repositories across an organization
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
name: Deploy to production
runs-on: ubuntu-latest
# Specifying an environment gates this job on environment protection rules.
# Secrets defined on the 'production' environment are available here.
environment: production
steps:
- uses: actions/checkout@v4
- name: Deploy
env:
# Repository secret — available in all workflows
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Environment secret — only available when environment: production is set
DEPLOY_API_KEY: ${{ secrets.DEPLOY_API_KEY }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
./scripts/deploy.shIn the Actions UI, secrets are configured under Settings → Secrets and variables → Actions. Environment secrets are under Settings → Environments → [environment name] → Secrets.
Secrets are never printed in logs. If a workflow step attempts to echo $SECRET_VALUE, GitHub Actions redacts the value and prints ***. This redaction covers a direct echo of a known secret value. It does not catch a secret that has been transformed, encoded, concatenated, or embedded in a larger string before being printed, so a script that builds a URL or JSON payload containing the secret can still leak it past the redaction.
2. OIDC keyless authentication to AWS
OIDC eliminates the need for a stored AWS access key. The workflow receives a short-lived JWT from GitHub's OIDC provider and exchanges it for temporary AWS credentials.
Step 1: Configure AWS to trust GitHub's OIDC provider (one-time setup, typically via Terraform).
# terraform/github-oidc.tf
resource "aws_iam_openid_connect_provider" "github" {
url = "https://token.actions.githubusercontent.com"
client_id_list = ["sts.amazonaws.com"]
# AWS has verified GitHub's OIDC provider against its trusted root CA
# store since July 2023 and no longer uses this value to validate the
# connection. The Terraform aws_iam_openid_connect_provider resource still
# requires a thumbprint_list argument, so this is kept for compatibility
# with older provider versions only.
thumbprint_list = ["6938fd4d98bab03faadb97b34396831e3780aea1"]
}
resource "aws_iam_role" "github_actions_deploy" {
name = "github-actions-deploy"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Principal = { Federated = aws_iam_openid_connect_provider.github.arn }
Action = "sts:AssumeRoleWithWebIdentity"
Condition = {
StringEquals = {
# Audience must match the AWS STS audience; this alone does not
# restrict which repository can assume the role.
"token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
}
StringLike = {
# Restricts to pushes on main in this specific repository.
# Omitting this condition would let any GitHub repository assume this role.
"token.actions.githubusercontent.com:sub" = "repo:your-org/your-repo:ref:refs/heads/main"
}
}
}]
})
}
resource "aws_iam_role_policy_attachment" "deploy_s3" {
role = aws_iam_role.github_actions_deploy.name
policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess" # scope more tightly in production
}Step 2: Use OIDC in the GitHub Actions workflow. No static credentials are stored.
# .github/workflows/deploy.yml
name: Deploy to S3 (OIDC)
on:
push:
branches: [main]
permissions:
id-token: write # Required to request the OIDC JWT
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::123456789012:role/github-actions-deploy
aws-region: us-east-1
# No access-key-id or secret-access-key needed.
# The action requests an OIDC token from GitHub and exchanges it
# for temporary STS credentials automatically.
- name: Build
run: pnpm build
- name: Deploy to S3
run: aws s3 sync dist/ s3://my-production-bucket --deleteThe temporary credentials returned by STS are valid for one hour and cannot be used after the workflow ends: there is no long-lived key for an attacker to steal.
3. VITE_*: what is safe vs. what is dangerous
# .env.production — values that WILL be bundled into public JavaScript
# SAFE: Stripe publishable key is designed to be public
VITE_STRIPE_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxxx
# SAFE: public analytics measurement ID
VITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX
# SAFE: public CDN base URL
VITE_CDN_URL=https://cdn.example.com
# SAFE: feature flag client key (read-only, public endpoint)
VITE_GROWTHBOOK_CLIENT_KEY=sdk-abc123
# ---
# DANGEROUS: this WILL be bundled and visible to all users
# VITE_STRIPE_SECRET_KEY=sk_live_xxxxxxxxxxxx <-- never do this
# DANGEROUS: database connection string in a public bundle
# VITE_DATABASE_URL=postgresql://user:pass@host/db <-- never do this
# DANGEROUS: private API key with server-side privileges
# VITE_OPENAI_API_KEY=sk-xxxxxxxxxxxx <-- never do thisFor secrets that your build process needs at build time (fetching content from a CMS, calling a private API to generate static pages), pass them as plain environment variables without the VITE_ prefix. They will be available to your build scripts but will not be included in the client bundle.
# .github/workflows/build.yml
- name: Build
env:
# Available in build scripts and SSR code — NOT bundled into client JS
CMS_API_KEY: ${{ secrets.CMS_API_KEY }}
# VITE_PUBLIC_URL is bundled — intentionally public
VITE_PUBLIC_URL: https://example.com
run: pnpm build4. Secret scanning with gitleaks
gitleaks scans git history for credential patterns. Run it as a CI step to catch secrets before merging.
# .github/workflows/security.yml
name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
secret-scan:
name: Secret scanning
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Scan full history, not just the latest commit
fetch-depth: 0
- name: Run gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITLEAKS_LICENSE is required for organization repositories (not personal accounts)
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}A .gitleaks.toml file in the repository root allows customizing detection rules and allowlisting known false positives (test fixtures, example values):
# .gitleaks.toml
[allowlist]
description = "Global allowlist"
# Allowlist specific files (e.g., test fixtures with example credentials)
paths = [
"tests/fixtures/",
"docs/examples/",
]
# Allowlist specific commit SHAs (for pre-existing historical commits
# that cannot be rewritten without disrupting the team)
commits = [
"abc1234",
]
# Allowlist regex patterns that are known to be non-secrets
regexes = [
"example_api_key_here",
"YOUR_API_KEY_HERE",
"sk_test_placeholder",
]GitHub's native push protection (enabled in repository Settings → Code security → Secret scanning → Push protection) blocks pushes containing detected secrets. This catches accidents at push time, before the secret ever reaches the remote.
5. Dependency security: npm audit and lockfile integrity
# .github/workflows/security.yml (continued)
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install (lockfile integrity check)
# --frozen-lockfile fails if the lockfile is out of sync with package.json
# This prevents silently installing different packages than committed
run: pnpm install --frozen-lockfile
- name: Audit dependencies
# --audit-level=high fails on high-severity vulnerabilities
# Omit --audit-level to fail on any severity
run: pnpm audit --audit-level=high
# For npm: npm audit --audit-level=highFor projects that cannot immediately fix every vulnerability (transitive dependencies with no available patch), allow the audit step to warn without blocking, and enforce only on critical severity:
- name: Audit dependencies (non-blocking, warns on moderate and above)
run: pnpm audit --audit-level=moderate || true
- name: Audit dependencies (blocking on critical)
run: pnpm audit --audit-level=critical6. Dependabot for automated dependency updates
Dependabot opens pull requests to update dependencies when new versions are published. Combined with a CI pipeline that runs tests and audit, safe updates are merged with minimal manual effort.
# .github/dependabot.yml
version: 2
updates:
# Update npm dependencies
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Asia/Taipei"
# Group minor and patch updates into a single PR to reduce noise
groups:
non-major:
update-types:
- "minor"
- "patch"
# Open a maximum of 5 PRs at once to avoid overwhelming the team
open-pull-requests-limit: 5
# Only auto-merge PRs that pass all required checks
# (Configure auto-merge separately in repository settings)
# Update GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"Renovate (an alternative to Dependabot) provides more sophisticated grouping, scheduling, and auto-merge logic. The configuration lives in renovate.json at the repository root.
7. npm provenance, trusted publishing, and SLSA attestation
npm provenance (available since npm 9.5 / Node 18) attaches a signed attestation to a published package. The attestation links the published package to the specific GitHub Actions run that built it, the git commit SHA, the repository, and the branch. Any user who installs the package can verify the provenance.
npm trusted publishing reached general availability in July 2025 and is now the recommended way to publish from GitHub Actions or GitLab CI. Configure the package's trusted publisher on npmjs.com (package settings → Trusted Publisher) to accept id-token: write from a specific repository, workflow filename, and optional environment. Once configured, the workflow needs no stored NPM_TOKEN, and provenance is generated automatically:
# .github/workflows/publish.yml (recommended: trusted publishing, no stored token)
name: Publish to npm
on:
release:
types: [published]
permissions:
id-token: write # Required for OIDC and provenance signing
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Publish
run: npm publish --access public
# No NODE_AUTH_TOKEN. npm exchanges this workflow's OIDC token for
# short-lived publishing credentials because the trusted publisher
# was configured on npmjs.com for this repository and workflow file.Packages published from a CI platform that does not yet support trusted publishing, or before a trusted publisher has been configured, fall back to a stored token:
- name: Publish with provenance (legacy fallback: stored token)
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}The published package is visible on npmjs.com with a provenance attestation that links it to the specific Actions run and commit SHA. Consumers can verify it:
# Verify provenance of an installed package
npm audit signatures
# Output (if provenance is present):
# audited 1 package in 0.5s
# 1 package has a verified registry signature
# 1 package has a verified attestationSLSA (Supply-chain Levels for Software Artifacts) is a broader framework for supply chain security. A standard npm publish --provenance run from a normal GitHub Actions job, as shown above, produces SLSA Build Level 2 provenance: the build is tracked and the provenance is signed, but the build platform is not isolated from the workflow's own build steps. SLSA Build Level 3 adds run-to-run isolation and non-falsifiable provenance, meaning the signing material is inaccessible to user-controlled build steps. Reaching Level 3 requires a hardened, isolated builder, such as a reusable-workflow builder like the SLSA Node.js builder from the slsa-framework project, not a standard workflow job. The actions/attest-build-provenance action (current major version v4, itself a thin wrapper over the newer actions/attest, which GitHub recommends for new implementations) generates SLSA provenance attestations for any build artifact, not just npm packages:
# Job-level permissions required: id-token: write, attestations: write,
# artifact-metadata: write
- name: Generate SLSA provenance attestation
uses: actions/attest-build-provenance@v4
with:
subject-path: dist/Best Practices
MUST NOT commit secrets (API keys, tokens, passwords, certificates) to version control under any circumstances. Secrets in git history are considered permanently compromised, since any clone made before the removal still retains a copy. Teams MUST rotate any secret discovered in history immediately and MUST add all .env* file patterns to .gitignore before the first commit.
MUST NOT place sensitive credentials in VITE_* or NEXT_PUBLIC_* environment variables. These prefixes perform build-time string substitution: the value is inlined as a literal string into the JavaScript bundle that ships to every browser. Teams MUST restrict these prefixes to genuinely public values, such as a Stripe publishable key, and MUST pass secrets to build steps as unprefixed environment variables that remain server-side only.
SHOULD pin third-party GitHub Actions to a full-length commit SHA, not a mutable tag. A tag like @v4 can be repointed by the action's maintainer, or by an attacker who compromises the maintainer's credentials, to point at different code without changing the version string a workflow references. Dependabot can keep SHA pins current by opening a pull request with the new commit SHA and a comment noting the corresponding version tag.
MUST store CI secrets in the CI platform's encrypted secret store and inject them at runtime only. GitHub Actions encrypted secrets, GitLab CI variables, and equivalent stores are designed for this purpose. Teams MUST NOT pass secrets as plain workflow inputs, workflow environment defaults, or hardcoded values in YAML files where they would appear in logs or repository history.
SHOULD use OIDC for CI-to-cloud authentication instead of long-lived static credentials. OIDC tokens are short-lived (typically 15–60 minutes), automatically scoped to the specific repository and branch, and leave a traceable audit trail in the cloud provider. Teams SHOULD configure AWS, GCP, or Azure to trust GitHub's OIDC provider rather than storing long-lived access keys as CI secrets that require manual rotation.
SHOULD enable automated secret scanning and dependency auditing as CI steps. Running gitleaks on full git history catches secrets committed before push protection was enabled. Running pnpm audit --audit-level=high surfaces known high-severity vulnerabilities in dependencies. Teams SHOULD fail the build on critical audit findings rather than treating the audit step as informational.
SHOULD enable automated dependency update tooling (Dependabot or Renovate) to keep lockfiles current and minimize vulnerability exposure windows. Automated tools open pull requests when new versions are published; combined with CI that runs tests and audit, safe updates are merged with minimal manual effort. Teams SHOULD configure update schedules and grouping to reduce noise while ensuring high-severity patches are applied promptly.
SHOULD use --frozen-lockfile or npm ci on every CI install. Without the frozen flag, the package manager may silently resolve newer versions of dependency ranges, producing installs that differ from the committed lockfile. A lockfile mismatch SHOULD cause an explicit CI failure rather than a silent auto-fix that produces non-reproducible builds.
Design Thinking
Why secrets in git are catastrophic and permanent
Git is append-only by design. A commit that adds a file also permanently records the file's contents in the object database. Removing the file in a subsequent commit adds a new commit that excludes the file, but the original commit still exists. Anyone with a clone made before the removal already has the secret. Anyone who forks the repository inherits the history. Any git hosting service may have cached or archived the original commit content.
The standard advice, "force-push to rewrite history," is insufficient for public repositories. GitHub scans and caches repository content continuously. Any historical exposure must be treated as a full compromise: rotate the credential immediately, audit access logs for the period since the secret was accessible, and investigate whether unauthorized use occurred. Rotate the credential; rewriting history does not undo exposure that has already been cached or cloned.
The root cause is almost always convenience: developers create .env files locally, .env is not in .gitignore, and the file gets committed alongside the feature. The prevention is structural: generate a .gitignore that includes .env* from project initialization, use secret scanning to catch accidents before they reach the remote, and use CI secret stores as the canonical location for any credential that the pipeline needs.
Why VITE_* variables are public by design
Vite's VITE_ prefix convention exists to be explicit about intent: any variable with this prefix is deliberately exposed to client-side code. Vite performs a build-time string substitution: import.meta.env.VITE_API_URL becomes the literal string "https://api.example.com" in the bundled JavaScript. This is not a runtime lookup; it is a compile-time text replacement. The resulting JavaScript ships to every browser and is fully readable via DevTools' Sources panel or by downloading the bundle.
This design is correct and useful for genuinely public configuration: feature flags fetched from a public endpoint, public analytics IDs, public CDN URLs, public client-side API keys (like Stripe publishable keys). It is wrong for anything that should remain server-side, such as a database credential or a private API key.
The rule: if the value grants any write, spend, or read-private capability, such as an API key that can call a paid or authenticated endpoint, it is not VITE_*-safe. If the value only identifies a public-facing resource, such as a Stripe publishable key or a public analytics ID, it is safe to expose.
Next.js uses NEXT_PUBLIC_ for the same purpose and with the same constraint. Variables without the prefix are server-side only and are never included in the client bundle.
Why OIDC is superior to static credentials for CI
Traditional CI cloud authentication works by generating a long-lived API key or access token (an AWS IAM access key, a GCP service account key, a personal access token) and storing it as a CI secret. This key is then injected as an environment variable during the pipeline run, which uses it to authenticate to the cloud provider.
This approach has fundamental problems. The key does not expire automatically; it remains valid until manually rotated. It is stored as a secret in the CI platform, creating a secret that must itself be managed, audited, and rotated. Every pipeline run that uses the key generates activity indistinguishable from any other caller with that key. If the key leaks, for instance through a compromised runner, the attacker has persistent cloud access.
OIDC (OpenID Connect) eliminates static credentials entirely. When a GitHub Actions workflow runs, GitHub's OIDC provider issues a cryptographically signed JWT (JSON Web Token) that attests: "this is a GitHub Actions run, in repository org/repo, on branch main, triggered by a push event." The cloud provider (AWS, GCP, Azure) is configured to trust GitHub's OIDC provider and to grant specific IAM roles to tokens that match specific conditions (the correct repository, branch, and event type).
The workflow exchanges this OIDC token for short-lived cloud credentials (typically 15-minute to 1-hour AWS STS tokens). There is no static key to store, rotate, or leak. The token is automatically invalid after the workflow completes. The audit trail in the cloud provider shows exactly which GitHub Actions run generated each API call. Restricting the trust relationship to refs/heads/main means a PR from a fork cannot assume the production deployment role.
Why secret scanning must be automated
Secret scanning cannot be a manual review step. Pull request reviewers do not catch secrets reliably: they are looking at logic changes, not scanning line by line for credential patterns. The surface area is large: secrets can appear in source files, test fixtures, shell scripts, Docker files, GitHub Actions workflow files, and documentation.
Automated tools detect credential patterns using regular expressions and entropy analysis. GitHub's push protection is free and enabled by default on public repositories since 2024. On private repositories it requires GitHub Advanced Security, repackaged in 2025 as the standalone GitHub Secret Protection add-on. Where it is active, it scans every push for known credential formats and blocks the push if a match is found, catching accidents before the secret ever reaches the remote.
Tools like gitleaks and trufflehog scan repository history, allowing detection of secrets that were committed before push protection was enabled. Running these tools in CI ensures that secrets introduced in any form are caught before merging.
Why lockfiles matter for supply chain security
npm install and pnpm install download arbitrary code from a public registry. Without a lockfile, the installer resolves dependency ranges (^18.0.0) to the latest matching version at install time. Two installs of the same package.json on different days may install different code. A dependency maintainer who publishes a malicious update to a patch version has their update automatically installed by any project that uses a range specifier.
The lockfile pins every package to an exact version and content hash. npm ci and pnpm install --frozen-lockfile verify that the installed packages match the lockfile exactly. If there is a discrepancy, the install fails rather than silently installing different code, so a tampered or drifted dependency causes a CI failure instead of a silent bad install.
The lockfile does not prevent a dependency from having a vulnerability in its pinned version; that requires npm audit. But it does eliminate the attack surface of dependency substitution and unexpected version drift.
Common Mistakes
Using secrets in workflow run steps with shell debugging enabled. If a workflow step runs set -x (shell command tracing) and then uses a secret in a command, the traced output will include the secret value. GitHub Actions does redact known secret values from logs, but this redaction is not guaranteed for all output paths. Never enable shell tracing (set -x) in steps that process secrets.
Logging secrets inadvertently. Some CLI tools print all environment variables in verbose or debug mode. Running env in a step that has secrets injected prints all of them. Running a tool with --verbose or --debug may print the environment. Always check what a tool logs before enabling verbose output in a pipeline step with access to secrets.
Trusting a broad OIDC condition. When configuring the AWS IAM trust policy for OIDC, using repo:your-org/*:ref:refs/heads/main instead of repo:your-org/your-repo:ref:refs/heads/main allows any repository in the organization to assume the production deployment role. Pin the trust condition to the specific repository and branch.
Not scanning git history when enabling secret scanning for the first time. GitHub push protection prevents future leaks but does not retroactively detect secrets already in the repository history. When enabling secret scanning on an existing repository, run gitleaks git . or trufflehog git file://. --since-commit HEAD~500 to scan historical commits. Rotate any secrets found, even if the commits are old.
Publishing packages without provenance. npm provenance is opt-in and costs nothing for packages published from GitHub Actions. Without it, there is no way for consumers to verify that a published package came from the expected source and was not tampered with in transit. Enable --provenance for all package publications, or use trusted publishing, which generates it automatically.
Pinning third-party actions to a mutable tag instead of a commit SHA. In March 2025, tj-actions/changed-files (CVE-2025-30066) was compromised: an attacker retroactively repointed most of the action's version tags, including widely used ones, to a malicious commit that dumped CI runner secrets into build logs. Any workflow that referenced the action by tag (for example tj-actions/changed-files@v46) pulled the malicious code on its next run without any change to the workflow file itself; over 23,000 repositories were affected. A workflow that pins the same action to a full commit SHA is unaffected by a tag being repointed. Pin third-party actions to a commit SHA, and use Dependabot's github-actions ecosystem to open pull requests that update the pinned SHA when a new release is published.
Related Topics
- FEE-1500: CI/CD & Deployment Overview — the category overview and pipeline mental model
- FEE-1501: GitHub Actions for Frontend — GitHub Actions workflow structure; the foundation on which secrets injection is built
- FEE-806: Environment Variables in Vite and Next.js Builds — deep dive on
VITE_*andNEXT_PUBLIC_*conventions and how build-time substitution works - FEE-804: Package Management and npm audit — lockfile management,
npm ci, and the dependency audit workflow - FEE-1207: SSR & Server Component Security — NEXT_PUBLIC_ naming and env var hygiene that determines which variables reach the client bundle versus stay server-only
References
- Encrypted secrets — GitHub Docs: official documentation for repository, environment, and organization secrets in GitHub Actions, including access controls and redaction behavior
- Configuring OpenID Connect in Amazon Web Services — GitHub Docs: step-by-step guide for setting up OIDC trust between GitHub Actions and AWS IAM, including the trust policy JSON and workflow configuration
- Security hardening for GitHub Actions — GitHub Docs: comprehensive guide covering OIDC, secret handling, third-party action pinning, and runner security
- gitleaks — GitHub: open-source secret scanning tool; supports pre-commit hooks, CI integration, and custom rule configuration via TOML
- npm audit — npm Docs: reference for the
npm auditcommand, audit levels, and the JSON output format for programmatic use - Generating provenance statements — npm Docs: official documentation for the
--provenanceflag, what information is attested, and how consumers verify provenance - SLSA Framework: the Supply-chain Levels for Software Artifacts specification; covers threat model, levels, and how to achieve each level with existing tools
- About secret scanning — GitHub Docs: explanation of GitHub's automatic secret scanning, supported credential patterns, push protection, and notification behavior
- GitGuardian, "The State of Secrets Sprawl 2026," GitGuardian (2026). https://blog.gitguardian.com/the-state-of-secrets-sprawl-2026/ — independent scan of public GitHub; source for leaked-credential volume
- Comparitech, "It Takes Hackers 1 Minute to Find and Abuse Credentials Exposed on GitHub," Comparitech (2022). https://www.comparitech.com/blog/information-security/github-honeypot/ — honeypot experiment measuring time-to-abuse for a leaked AWS key
- Michael Meli, Matthew R. McNiece, and Bradley Reaves, "How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories," NDSS Symposium (2019). https://www.ndss-symposium.org/wp-content/uploads/2019/02/ndss2019_04B-3_Meli_paper.pdf — peer-reviewed longitudinal study of secret leakage on public GitHub
- Wiz Research, "GitHub Action tj-actions/changed-files Supply Chain Attack (CVE-2025-30066)," Wiz Blog (2025). https://www.wiz.io/blog/github-action-tj-actions-changed-files-supply-chain-attack-cve-2025-30066 — independent post-mortem of the tag-repointing compromise cited in Common Mistakes
- npm Docs, "Trusted publishing for npm packages." https://docs.npmjs.com/trusted-publishers/ — setup reference for OIDC-based publishing without a stored
NPM_TOKEN - GitHub Changelog, "Introducing GitHub Secret Protection and GitHub Code Security" (2025). https://github.blog/changelog/2025-03-04-introducing-github-secret-protection-and-github-code-security/ — source for the 2025 Advanced Security repackaging referenced in Design Thinking
- GitHub Changelog, "GitHub Actions – OIDC integration with AWS no longer requires pinning of intermediate TLS certificates" (2023). https://github.blog/changelog/2023-07-13-github-actions-oidc-integration-with-aws-no-longer-requires-pinning-of-intermediate-tls-certificates/ — source for the thumbprint_list note in the Terraform example