Skip to content

Harden CI against malicious PRs#10

Merged
devhardiyanto merged 1 commit into
mainfrom
feat/security-hardening
Jun 10, 2026
Merged

Harden CI against malicious PRs#10
devhardiyanto merged 1 commit into
mainfrom
feat/security-hardening

Conversation

@devhardiyanto

Copy link
Copy Markdown
Owner

Summary

Defense-in-depth against malicious contributor PRs and supply-chain attacks. None of this changes runtime behavior of phpvm — only what GitHub Actions allows.

  • CODEOWNERS — every PR auto-requests maintainer review. Workflows + install scripts + source files require code-owner approval (paired with branch protection rule, set via gh outside this PR).
  • dependabot.yml — weekly PRs that bump pinned action SHAs to latest release; prevents drift between SHA pin and current upstream version.
  • SHA-pinned actions/checkout (@v4.3.134e114876b0b11c390a56381ad16ebd13914f8d5). If the moving v4 tag is force-pushed by an attacker who compromises the action repo, our runners still execute the verified commit we pinned to.
  • permissions: contents: read at CI workflow level — defense-in-depth so any newly added job inherits read-only by default. release.yml keeps its explicit contents: write so writes remain visible per-workflow.

Test plan

  • CI green (all 3 checks pass with SHA-pinned checkout)
  • Confirm Dependabot picks up dependabot.yml (visible in Insights → Dependency graph → Dependabot)
  • After merge: configure branch protection + first-time contributor approval via gh commands provided in the chat

🤖 Generated with Claude Code

- CODEOWNERS: auto-request maintainer review on every PR, mandatory
  code-owner approval for workflows + install scripts + source files
- dependabot.yml: weekly PRs that bump pinned action SHAs to latest release
- Pin actions/checkout to SHA (v4.3.1) so an upstream compromise of the
  moving v4 tag does not silently execute attacker code in our runners
- Default workflow permissions to contents:read; release.yml keeps its
  explicit contents:write opt-in so writes are visible per-workflow
@devhardiyanto devhardiyanto merged commit 20d88ce into main Jun 10, 2026
3 checks passed
@devhardiyanto devhardiyanto deleted the feat/security-hardening branch June 10, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant