Skip to content
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

After PR approval, it's possible to plan and apply any directory #1508

Closed
jasonrberk opened this issue Apr 15, 2021 · 13 comments · Fixed by #2440
Closed

After PR approval, it's possible to plan and apply any directory #1508

jasonrberk opened this issue Apr 15, 2021 · 13 comments · Fixed by #2440
Labels
bug Something isn't working security

Comments

@jasonrberk
Copy link

I'm curious if others noticed this and how they might be dealing with it.

If I run a plan, and get an approval, I could then run another plan, in an entirely different directory (using -d) and apply it w/o getting another approval. The gist of it is that once I get an approval on my first plan, it seems like I can plan / approve anything. Seems like the plan command should dismiss any approvals so that I have to apply what was approved.

it feels like I'm just missing something, but testing seems to indicate otherwise.

@mwarkentin
Copy link
Contributor

You can configure github to dismiss approvals when further commits are added to a branch.

@jasonrberk
Copy link
Author

atlantis is not a commit on a branch, it's a PR comment....

@mwarkentin
Copy link
Contributor

Oh, good point - sorry I misread the concern earlier. I guess the mitigation would be that anything in that other directory should automatically trigger a plan in that dir if there is any diff from main branch when you open the PR? And if there aren't any diffs, than that plan should be a no-op?

@jasonrberk
Copy link
Author

so I open my PR..... plan my destroy changes.... and my coworker approves the plan, like so:

pre-approval

after the approval, I run another plan on a completely unrelated module (ie: folder). Nobody sees this plan or approves it

post-approval

notice, both plans were applied and auto merged, but nobody ever saw the second plan or approved it. This seems like something I'd want to button up, or else, once you get any approvals, you can plan / apply anything you want, so long as you don't push any other commits to your branch (as mentioned above).

maybe this is fallout from our TG repo strategy, but our repo layout seems fairly standard from my understanding of TG.

I see two obvious options so far:

  1. another webhook that watches for atlantis comments, and dismisses any approvals
  2. override the plan command to dismiss the approvals before running any plan

@mwarkentin
Copy link
Contributor

Ok, doing a destroy plan wasn't something I'd thought of. 👍

@carmo-evan
Copy link

+1 on plan dismissing existing approvals.

@jamengual
Copy link
Contributor

is this still an issue with v0.19.8?

@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Aug 26, 2022
@jasonrberk
Copy link
Author

jasonrberk commented Aug 26, 2022

is this still an issue with v0.19.8?

is there a specific PR / changelog that updated behavior? I'm on 0.17.2 but plan to upgrade soon....I hope

EDIT: I assume you are referring to https://www.runatlantis.io/docs/apply-requirements.html#undiverged

that seems like it would solve the issue....

I don't see anything wrong with closing this now....I can always open it (or a new issue) later

@jamengual
Copy link
Contributor

you will need to look at the changelog but we have fixed a number of issues lately

@krzysztof-magosa
Copy link

IMO it would make sense to dismiss any approvals granted before completing all plans (as an option).
anyway approvers should review all plans to be sure that there are no undesired side-effects (e.g. caused by potential manual change to environment).

@github-actions github-actions bot added the Stale label Oct 25, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@nitrocode nitrocode removed waiting-on-response Waiting for a response from the user Stale labels Oct 31, 2022
@nitrocode nitrocode reopened this Oct 31, 2022
@nitrocode
Copy link
Member

@jasonrberk could you update and see if you are still getting the issue with the latest release?

@gregoirefra
Copy link

+1 on this, we are using the latest version of Atlantis and it's still possible to have the apply_requirement set to mergeable, approve the PR first and then create a plan that is applied afterwards without any more/new review

@jasonrberk
Copy link
Author

sorry. I no longer work at the company where I set this all up. I might be setting it up at my new employer. If so I'll comment back, but it looks like @gregoirefra validated the concern still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security
Projects
None yet
8 participants