-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anyone can approve custom policy exceptions #4962
Comments
I found a similar closed issue that might be relevant to your problem: Policy checks as a sets for different owners. This issue was closed by a pull request: feat(policies): Add granular policy_sets on April 21, 2023 [1]. To restrict the approval of custom policy exceptions to only the specified policy owners in Atlantis, you need to define the policy configuration in the server-side repo configuration. Here is an example configuration: policies:
owners:
users:
- nishkrishnan
policy_sets:
- name: deny_null_resource
path: <CODE_DIRECTORY>/policies/deny_null_resource/
source: local
- name: deny_local_exec
path: <CODE_DIRECTORY>/policies/deny_local_exec/
source: local
approve_count: 2
owners:
users:
- pseudomorph In this configuration:
By setting the **Approve Policies Error**
1 error occurred:
* policy set: test_policy user runatlantis is not a policy owner - please contact policy owners to approve failing policies This ensures that only the designated policy owners can approve the exceptions, maintaining control and compliance [2][3]. |
I think this wan mentioned over in #4243 too |
Community Note
Overview of the Issue
No matter what GHE teams or individuals I list in policy owners, anyone can approve our custom policysets.
Reproduction Steps
Seen this issue since v0.26.0 and have tried it up to the latest version to date.
1.
atlantis plan
2. plan fails policy check
3. user not on policy owner list runs
atlantis approve_policies
4. policy get exception
Environment details
Repo
atlantis.yaml
file:user3 would be able to approve anything even if he was not the PR owner
The text was updated successfully, but these errors were encountered: