atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

Ability to disable arbitrary terraform command arguments

Open sw-carlin opened this issue 8 years ago • 5 comments

Being able to add arbitrary arguments to the Atlantis apply comment makes it fairly easy to circumvent access restrictions to protected environments. We should be able to disable this feature.

sw-carlin avatar Apr 20 '18 17:04 sw-carlin

Hi, can you elaborate on what you mean by this? Do you mean how you can add atlantis apply -- -var-file=foo? How does this allow access to protected environments (not saying it doesn't, just want to know the mechanism). Thanks!

lkysow avatar Apr 20 '18 17:04 lkysow

In the case of my project, we're supplying the environment name as a terraform variable. So you could write something like atlantis apply -- -var="env=prod" and bam, they've deployed to prod.

sw-carlin avatar Apr 22 '18 23:04 sw-carlin

@sw-carlin Would this be similar to another feature request I am also proposing at https://github.com/runatlantis/atlantis/issues/113 ?

mechastorm avatar Apr 24 '18 06:04 mechastorm

That's definitely related as they are using a similar multi-envrionment setup. I have decided that if my team uses Atlantis we'll convert to using workspaces which I guess solves this issue for us.

sw-carlin avatar May 06 '18 04:05 sw-carlin

This can be achieved via a custom workflow that doesn't use the built-in commands and so won't allow the extra args to be applied:

workflows:
  custom:
    apply:
      steps:
      - run: terraform apply -out $PLANFILE

lkysow avatar Apr 04 '19 00:04 lkysow