Skip to content

ci: enable repository security features and protect release tags #63

Closed

Description

@abruption

What happened

Read-only repository API checks on 2026-09-28 (as an admin, so 403/404 below mean the feature is disabled, not hidden) show that several GitHub security controls are not enabled for a repository that publishes a process-signaling CLI through OIDC trusted publishing:

Control Observed
Dependabot alerts / vulnerability alerts disabled (403 Dependabot alerts are disabled, 404 Vulnerability alerts are disabled)
Dependabot security updates disabled
Code scanning (CodeQL default setup) not-configured, no analyses
Branch protection / rulesets on main none (404 Branch not protected, [])
Tag protection rulesets none
Immutable releases enabled: false
Release tags v0.1.0–v0.4.0 lightweight (not annotated or signed)
Actions sha_pinning_required false (all current workflow actions are nonetheless SHA-pinned)

Because release-please.yml publishes from release tags with id-token: write, an unprotected main and mutable tags mean a single compromised write credential can produce a trusted-publisher npm release without review.

What you expected

Baseline repository hardening that matches the project's safety posture and complements the existing secret scanning, push protection, and private vulnerability reporting.

Environment

  • Repository settings as of 2026-09-28, main at 6227e6c

Source evidence

  • Publish job trigger and OIDC permission:
    publish:
    needs: [release-please]
    if: ${{ needs.release-please.outputs.release_created == 'true' }}
    runs-on: ubuntu-latest
    permissions:
    contents: read
    id-token: write
    steps:
    - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    with:
    ref: ${{ needs.release-please.outputs.tag_name }}
    persist-credentials: false
    - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
    with:
    node-version: 24
    registry-url: https://registry.npmjs.org
    package-manager-cache: false
    - run: npm install --global [email protected]
    - run: npm ci
    - run: npm run check
    - run: npm run lint
    - run: npm test
    - run: npm run smoke:package
    - run: npm publish --provenance --access public
  • Documented trusted-publisher configuration without a deployment environment:
    | Environment name | Blank (the publish job has no GitHub environment) |

Acceptance criteria

  • Dependabot alerts (and optionally security updates) are enabled.
  • CodeQL default setup (JavaScript/TypeScript and Actions) is enabled.
  • A ruleset protects main (no force-push or deletion; required CI status checks) and v* tags (no update or deletion).
  • Immutable releases are enabled for future releases.
  • Optionally, "Require actions to be pinned to a full-length commit SHA" is enabled.

Scope and limitations

Checked

Activity

  1. added
    enhancement
    on Sep 28, 2026
  2. abruption commented on Sep 28, 2026

    @abruption
    OwnerAuthor

    Two related settings not listed in the table above (read-only API checks on 2026-09-28):

    Setting Observed Why it matters
    Actions workflow permissions: "Allow GitHub Actions to create and approve pull requests" (can_approve_pull_request_reviews) true Once a ruleset requires reviews, a workflow token with pull-requests: write (the Release Please job) could satisfy the approval requirement.
    Automatically delete head branches (delete_branch_on_merge) false Hygiene; merged branches accumulate.

    Suggested addition to the acceptance criteria: disable workflow PR approval and enable automatic head-branch deletion together with the ruleset.

  3. abruption commented on Sep 28, 2026

    @abruption
    OwnerAuthor

    Applied and verified on 2026-09-28 via the repository API:

    Control State
    Dependabot alerts (vulnerability alerts) enabled
    CodeQL default setup configured for actions and javascript-typescript; first analysis completed with 0 alerts
    main ruleset active: no deletion, no force push, pull request required, required checks lint, security-audit, package-smoke, git clone install, supported-tests; repository admins may bypass via pull request only (Release Please PRs created with GITHUB_TOKEN do not trigger CI)
    v* tag ruleset active: no update, deletion, or non-fast-forward; creation still allowed for Release Please
    Immutable releases enabled
    Workflow PR approval disabled; default workflow permissions read
    Delete head branches on merge enabled

    Not applied: the optional "require actions to be pinned to a full-length commit SHA" setting (all current workflow actions are already SHA-pinned). Dependabot security updates remain disabled; alerts are enabled.

  4. abruption commented on Sep 29, 2026

    @abruption
    OwnerAuthor

    Follow-up on 2026-09-29: "Allow GitHub Actions to create and approve pull requests" (can_approve_pull_request_reviews) has been re-enabled.

    GitHub uses this single setting for both creating and approving pull requests with GITHUB_TOKEN. With it disabled, Release Please could update its release branch but failed to open the release PR (GitHub Actions is not permitted to create or approve pull requests) on every push to main after the v0.4.1 fixes were merged.

    The approval-bypass concern above does not apply to the current protect-main ruleset, which requires 0 approving reviews. If required approvals are introduced later, switch Release Please to a dedicated GitHub App or fine-grained token and disable this setting again. Default workflow permissions remain read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions