Use this open-source repository security checklist to review access, code changes, automation, dependencies, releases, and recovery procedures before a release or after a change in your team or tooling. It is designed for maintainers, contributors, and small engineering teams that want a repeatable way to secure a Git repository without turning every review into an ad hoc investigation.
Overview
Repository security is broader than protecting the Git server. A secure open-source project also needs clear permissions, trustworthy pull requests, controlled CI/CD execution, safe dependency updates, protected release credentials, and a recovery plan. A weakness in any one of these areas can undermine the others. For example, a private deployment token exposed to an untrusted build job may be more consequential than a missing repository setting.
Use the checklist below as a working document. Mark each item as complete, not applicable, or requiring follow-up. Record the owner and review date for unresolved items. The exact names of settings vary between a hosted Git service, a self-hosted Git repository, and a broader developer cloud platform, but the control objectives remain similar.
| Control area | Primary location | What to verify |
|---|---|---|
| Access and branch rules | Repository | Roles, protected branches, review requirements, and administrative access are documented. |
| Build and deployment trust | CI system | Runners, triggers, permissions, artifacts, and secrets are isolated and limited. |
| Runtime and recovery | Cloud environment | Production access, network boundaries, logs, backups, and restoration steps are controlled. |
Checklist by scenario
1. Baseline repository review
- List every user, team, bot, deploy key, and application with repository access.
- Remove inactive accounts and credentials that no longer have a clear owner.
- Apply least privilege: contributors should receive only the permissions needed for their work.
- Require multi-factor authentication where the hosting service supports it, especially for maintainers and administrators.
- Protect the default branch and release branches against direct pushes, forced updates, and deletion.
- Require pull-request review before merging changes into protected branches.
- Require successful tests and relevant status checks before a merge is accepted.
- Define who can bypass branch rules and review those exceptions regularly.
- Keep repository ownership, security contacts, contribution guidance, and supported versions current.
Branch protection should reflect how the project actually works. A small project may need one approval and a passing test suite, while a larger project may separate code owners, release maintainers, and infrastructure administrators. The important point is that sensitive changes cannot quietly bypass the project’s normal review path.
2. New contributor or maintainer onboarding
- Assign a role with the minimum access required rather than copying an existing administrator’s permissions.
- Explain protected branches, review expectations, responsible disclosure, and the process for handling suspected secrets.
- Use a separate account for personal work and do not share maintainer credentials.
- Confirm that the contributor understands which workflows execute code from pull requests.
- Record the date, approver, role, and expected review date for elevated access.
- Remove temporary access when the onboarding task or maintenance period ends.
Onboarding is a useful security checkpoint because it exposes undocumented assumptions. Pair this review with an open-source contributor onboarding checklist so repository access and project norms are addressed together.
3. Pull requests and code review
- Require review from an appropriate maintainer for source, workflow, dependency, and infrastructure changes.
- Use code ownership rules or an equivalent process for sensitive directories.
- Review changes to CI configuration as production-impacting changes, not ordinary documentation edits.
- Check new scripts for shell injection, unsafe downloads, excessive permissions, and untrusted input handling.
- Do not approve a pull request solely because automated checks pass; inspect the change and its dependencies.
- Keep review conversations in the project’s normal channels and document exceptional approvals.
For projects that accept contributions from unknown users, treat pull-request code as untrusted until it has passed the appropriate checks. Avoid exposing production credentials or sensitive repository data to jobs that can execute contributor-controlled code.
4. CI/CD runners, secrets, and deployment
- Separate trusted jobs from jobs that build or test unreviewed pull-request code.
- Prefer short-lived credentials or narrowly scoped tokens where the CI system and cloud environment support them.
- Store secrets in the CI secret manager or cloud secret store rather than in repository files, issue comments, logs, or build artifacts.
- Review which branches and events can trigger deployment workflows.
- Restrict deployment jobs to approved branches, tagged releases, or an explicit promotion step.
- Prevent secrets from being printed by scripts, test failures, debugging output, or diagnostic commands.
- Pin or otherwise control the versions of important actions, plugins, base images, and build tools.
- Use isolated or disposable runners for untrusted workloads when practical.
- Review artifact retention and access; build outputs may contain source code, configuration, or credentials.
Document the boundary between repository settings, the CI/CD platform, and the cloud account. The CI/CD environment and secrets management guide provides a useful companion review, while the CI/CD troubleshooting guide can help investigate unexpected workflow behavior without weakening controls.
5. Dependencies and source integrity
- Enable dependency alerts or an equivalent review process where available.
- Define who triages vulnerable dependencies and how severity, exploitability, and upgrade effort are assessed.
- Review dependency changes in pull requests rather than merging them without inspection.
- Use lockfiles or another reproducible versioning method appropriate to the language and build system.
- Check changes to package registries, installation scripts, container images, and build tooling.
- Remove unused dependencies and stale automation to reduce the project’s attack surface.
Security updates need a release path. A dependency bot can create a useful signal, but maintainers still need to test, review, and communicate changes. See the dependency update workflow for a repeatable triage and release process.
6. Releases, issues, and disclosure
- Limit who can create, modify, or publish releases and package artifacts.
- Protect signing keys, package credentials, container registry tokens, and other release secrets outside the repository.
- Verify that release notes do not disclose private configuration, internal URLs, or sensitive incident details.
- Provide a visible method for reporting vulnerabilities privately when public issue tracking is not appropriate.
- Define who receives a report, how it is acknowledged, how affected versions are assessed, and when a fix can be disclosed.
- Moderate issues and discussions to remove secrets, exploit instructions aimed at active systems, and personal information.
- Train maintainers to avoid requesting credentials or sensitive logs in public threads.
What to double-check
Before marking a repository secure, inspect the places that are easy to overlook:
- History: Search current files, recent commits, tags, and release assets for credentials or private configuration. Removing a value from the latest commit does not necessarily remove it from history.
- Automation permissions: Compare the permissions granted to workflow tokens with what each job actually needs. A test job should not automatically inherit deployment authority.
- Fork behavior: Confirm how pull requests from forks run, which secrets are withheld, and whether comments or labels can trigger privileged workflows.
- Administrative paths: Test whether a maintainer can bypass reviews, alter workflow files, change branch rules, or publish an artifact without a second person noticing.
- Cloud access: Review the identities used by deployments, container registries, databases, storage, and Kubernetes workloads. The repository may be secure while the deployment identity remains over-privileged.
- Backups: Confirm that repository data, issues, discussions, release metadata, and important CI configuration can be restored. A backup that has never been tested is an assumption, not a recovery plan.
For cloud-hosted projects, keep repository security and runtime security connected but distinct. A production readiness review for open-source Docker apps can help extend the checklist to images, hosting, and deployment operations. Teams running Kubernetes should also maintain a documented upgrade runbook that includes access and rollback checks.
Common mistakes
- Giving everyone maintainer access: Convenience makes it difficult to attribute changes and increases the impact of a compromised account.
- Protecting only the default branch: Release, staging, infrastructure, and configuration branches may also influence production.
- Assuming private variables make a workflow safe: A secret can still be exposed if an untrusted job can access it or print it.
- Ignoring workflow files during review: CI configuration can change what code runs, what data it can read, and where it can deploy.
- Relying on automated dependency updates without triage: Automation creates candidate changes; maintainers remain responsible for testing and release decisions.
- Publishing vulnerability details too early: Public issue discussions can expose affected users before a fix or mitigation is available.
- Keeping old credentials “just in case”: Unused keys increase uncertainty. Revoke them, then document the replacement path.
- Skipping restoration tests: Backups help only when the team knows where they are, who can access them, and how to restore them under pressure.
When to revisit
Run this checklist before a significant release, after adding a maintainer, when permissions change, and whenever the repository moves between hosting or CI systems. Repeat it after introducing a new deployment target, package registry, container workflow, or automation integration. A scheduled semiannual review is a practical baseline for projects that change continuously; teams with sensitive production access or frequent contributor turnover may choose a shorter interval.
Also revisit the checklist during seasonal planning cycles and after a security incident, even when the incident appears unrelated to the repository. Review the project’s hosting settings, recommended security features, dependency tooling, runner behavior, and vulnerability disclosure guidance after major platform or workflow changes. Keep the checklist versioned with the project and record the last review, open actions, owners, and due dates.
To turn this article into an operating routine, copy the checklist into the project’s maintenance documentation, assign one owner for each unresolved item, and schedule the next review before closing the current one. Pair it with the broader open-source project operations checklist so security is reviewed alongside releases, contributor health, documentation, and continuity planning.