# Environment protection rules

Tier 1 key, `key:environment-protection-rules`. Page: https://ghtier.com/tier/keys-policies/environment-protection-rules

Decides who must approve a deployment and from which branches, which is the gate in front of production secrets.

**Related permissions:** [Administration: Write (repository)](https://ghtier.com/tier/permissions/administration-write.md) (Tier 1), [Environments: Write (repository)](https://ghtier.com/tier/permissions/environments-write.md) (Tier 1)

**Defenses (checklist):** [Put production secrets in environments with required reviewers](https://ghtier.com/checklist/cicd-environment-reviewers.md)

**Strange findings:** [Write access reads every repository secret](https://ghtier.com/strange-findings/finding-write-reads-all-secrets.md), [A workflow can create an environment, without any protection rules](https://ghtier.com/strange-findings/finding-workflow-creates-unprotected-environment.md), [On Free and Team, environment reviewers only work in public repositories](https://ghtier.com/strange-findings/finding-team-plan-environment-rules-public-only.md), [A reusable workflow gets an empty string for a secret it was not passed](https://ghtier.com/strange-findings/finding-reusable-workflow-missing-secret-is-empty.md)

**Audit log events that show it:** [environment.remove_protection_rule](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise), [environment.update_protection_rule](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise), [environment.delete](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise)

**Sources:**
- [GitHub Docs: Managing environments for deployment](https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments)

From ghtier (https://ghtier.com). Every entry and link: https://ghtier.com/data/graph.json. Tiers: https://ghtier.com/tier.
