Repository navigation
v0.49.0 #7022
v0.49.0
#7022
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Atlantis v0.49.0
v0.49.0 is a breaking release, for three reasons:
Every behavior change is also documented, in a Behavior change note, on the docs page where you would look for that setting. Read Breaking changes before you upgrade.
Upgrade checklist
--default-tf-version(and--default-tf-distribution opentofuif you use OpenTofu) so Atlantis downloads the binary. If downloads are blocked, mount or copy a binary into the image instead. The image no longer ships one.--gh-hostnamematches the host in your repositories' clone URLs. Webhooks whose clone URL is on a different host are now rejected.allow_custom_workflows: truetogether withallowed_workflows, check that every project'sworkflowis in the allow-list. Repo configs that used to pass can now be rejected.diris a symlink to somewhere outside the repository.-out,-generate-config-out,-state,-state-outand-backupare now blocked after--, and that--blocked-extra-argscan no longer unblock anything.-var-file: the allowlist now applies toapply,importandstate rmas well asplan. Paths containing..are refused, and so are repo symlinks that point outside the repository and the allowlist.state rm: ifstateis in--allow-commands,state rmnow has to meet the project'sapply_requirementsandimport_requirements.--api-secretis set, sendX-Atlantis-TokenonGET /api/locks. Check that/api/planand/api/applycallers send clean, repo-relativepaths[].directoryvalues with no leading/and no globs.apply_requirements: [approved]now uses each reviewer's latest review. On Gitea, dismissed and stale approvals no longer count, and any push that changes the diff makes approvals stale.planandapplyis rejected and has to be re-planned.Breaking changes
Docker images
The Docker images no longer include Terraform or OpenTofu
latest,vX.Y.ZandvX.Y.Z-debianimages no longer bundle Terraform or OpenTofu binaries, and they set no default Terraform version. This was announced in the v0.48.0 release notes. The-alpine-slimand-debian-slimimages from v0.48.0 were the intermediate step toward this and are no longer published. If you pinned one, switch to the unsuffixed,-alpineor-debiantag, which now contain the same thing. If you build the image yourself, use--target alpineor--target debian; the-slimtargets are gone.terraformortofubinary onPATH, or on the version the image used to set by default.terraform not found in $PATH. Set --default-tf-version ....--default-tf-version(ATLANTIS_DEFAULT_TF_VERSION, or HelmdefaultTFVersion) so Atlantis downloads that version at startup. Repos can still pin their own version withterraform_version.--default-tf-distribution opentofu(HelmdefaultTFDistribution).PATHyourself: mount one, or buildFROM ghcr.io/runatlantis/atlantisand copy one in. Set--tf-download=falseso Atlantis uses it and doesn't try to download.Carried over from v0.47.1 (#6792)
v0.47.1 fixed a shell-injection vulnerability (GHSA-rjh2-4xgw-p2hj) and changed behavior along the way, but its release notes didn't call that a breaking change. If you are upgrading from v0.47.0 or earlier, these apply to you.
Terraform and conftest commands no longer run through a shell
sh -c. Commands now run as argument vectors.extra_argsentry is passed as exactly one argument. Shell operators (;,&&,|, redirections), globbing and word splitting no longer apply.$WORKSPACEand$DIRare still expanded in operator-configuredextra_args, but no longer in arguments typed in a PR comment after--.pathand eachextra_argsentry are still split on whitespace. Quote a path that contains a space.extra_argsrelied on shell behavior, for example two flags in one entry, a pipe, a redirection or a glob.$VARreferences in comment arguments and expected them to expand.runstep, which still runs with a shell by design.Workspace names are validated everywhere
atlantis.yaml, the-wcomment flag, the Terraform Cloud workspace read from HCL, and the API are validated. A name can't contain/,\,..,$, whitespace or control characters, can't be., and can't start with-or~.$never worked, because the shell expanded it.workspacekey, or the comment is rejected with the offending value and a reason such ascannot contain '/' or '\'.Server-side repo config
allowed_workflowsis now checked for every project (GHSA-56q6-8vmp-v2qm)allow_custom_workflows: true, a bug stopped theallowed_workflowscheck at the first project that used a repo-local workflow. Projects after that one were never checked. Now every project is checked.allow_custom_workflows: true,allowed_overrides: [workflow]and a non-emptyallowed_workflows, whoseatlantis.yamlhas a later project naming a server-side workflow that is not inallowed_workflows.workflow '<name>' is not allowed for this repo.allowed_workflowsin the server-side config, or change the project to use an allowed workflow.A project
dirthat symlinks outside the repository is rejected (GHSA-9q39-mgw7-5789)dir(or a parent directory in its path) is a symlink pointing outside the clone. That includes absolute targets and../targets that leave the repository. Symlinks that stay inside the repository (for exampledir->modules/x) still work.project path traversal detected: .... A path that cannot be resolved for any other reason (for example a file where a directory is expected) now fails withresolving project path: .... Before, Atlantis ignored that case.dirsymlink keeps the existingdir "<dir>" does not existerror. If anything other than a regular file (for example a symlink) sits at the plan file path inside the project directory, Atlantis deletes it before planning.Comment commands
More Terraform flags are blocked after
--, and--blocked-extra-argsnow adds to the list instead of replacing it (GHSA-chm7-fjpm-927x)-chdir,-plugin-dir,-out,-generate-config-out,-state,-state-out,-backup. Before, only-chdirand-plugin-dirwere blocked.-and--spellings and the=valueform.--blocked-extra-argsnow adds to the built-in list. Before, setting it replaced the defaults, so an operator could unblock-chdiror-plugin-dirthat way. That is no longer possible.atlantis plan -- -generate-config-out=..., which some teams use to generate config forimportblocks.--blocked-extra-argsto allow one of the default flags.-stateor-backuptoatlantis state rmin comments. Those are blocked too.flag "<arg>" is not allowed in extra args.-generate-config-outor the other flags, put them inextra_argsof a workflow you control (server-side, or a repo workflow the server allows). Workflowextra_argsare not checked.--blocked-extra-args, you can drop the--entries. Nothing breaks if you leave them.The comment
-var-fileallowlist covers more commands, spellings and paths (GHSA-chm7-fjpm-927x)--var-file-allowlist(default:--data-dir) is now enforced onapply,importandstate rm, not onlyplan.--var-fileand values that contain=...element is refused, even if it would resolve inside the repository (for exampleenvs/../common.tfvars).-var-filein comment extra args is checked. Workflowextra_argsare not.-var-filein comments on these commands with a path outside the repository and the allowlist, a path containing.., or a path that goes through a committed symlink leading outside the repository.var file path <p> is not allowed by the current allowlist: [...]var file path <p> must not contain '..' elementsvar file path <p> resolves to <r>, which is not allowed by the current allowlist: [...]var file path <p> is a symbolic link whose target does not exist--var-file-allowlist.atlantis state rmnow enforces apply and import requirements (GHSA-cxvq-66x3-pwhw)state rmused to skip command requirements entirely. It now has to meet every requirement in the project'sapply_requirementsplus every one in itsimport_requirements. There is no separatestate_rm_requirementskey.statein--allow-commandsand projects that setapply_requirementsorimport_requirements(approved,mergeable,undiverged,policies_passed).state rmis refused with the usual requirement messages, ending inbefore running state. For example:Pull request must be approved according to the project's approval rules before running state.state rm, or loosen the requirements for that project. If Atlantis can't fetch the PR status,approvedandmergeablecount as not met.API
GET /api/locksrequiresX-Atlantis-Tokenwhen an API secret is set (GHSA-xgrg-fpp6-q6fm)--api-secretset. Web basic auth never covered/api/paths.GET /api/lockswithout a token on servers that have--api-secretset. If no API secret is set, the endpoint stays open.UNAUTHORIZEDand messageinvalid or missing API token. The 401 body uses the newer API error envelope, not the old top-level lock-list body.X-Atlantis-Token: <api secret>.paths[].directoryis validated on/api/planand/api/apply(GHSA-mwfx-fvfc-7q5w)What changed: non-empty directories have to be clean, repo-relative paths. The request is now rejected for:
/..that leaves the repository* ? [ ] { }Valid values are cleaned:
./diranddir/both becomedir. An empty directory is still allowed.Who is affected: API callers that send any of these. Before v0.49.0:
/modules/vpcran inmodules/vpcbut didn't match that directory'satlantis.yamlproject, so it ran with default project settings./meant the repo root.envs/*matched configured projects by pattern. The API docs already said globs were unsupported, but the code accepted them. That undocumented behavior is gone.How to tell: HTTP 400 with
invalid directory "<dir>": directory must be a clean repo-relative path.What to do: send directories relative to the repo root, with no leading slash. Use
.for the repo root. List each project directory explicitly instead of using a glob.VCS
GitHub clone URLs must be on the configured GitHub host, and head and base repos must share a host (GHSA-6mjf-4m52-m5cq)
--gh-hostname(defaultgithub.com). The check runs on webhooks, on API plan/apply requests, and when a comment command fetches the pull from GitHub. The comparison ignores case and port. A clone URL with no host is rejected.--gh-hostnameis not the host GitHub puts in clone URLs. For example: an internal alias or IP address, or a reverse-proxy name that differs from the GHES hostname.parsing pull data: ... expected clone url host "<gh-hostname>" but had "<host>". Check your webhook deliveries in GitHub for 400s after upgrading.failed to parse repository: ..., and comment commands fail with the same host error.head repo host "<x>" does not match base repo host "<y>", not running commandat warn level.--gh-hostnameto the hostname that appears in your repositories' clone URLs.Approval checks use each reviewer's latest review (GitHub, Gitea) (GHSA-fm5f-jg8p-x2vw)
apply_requirements: [approved](andimport_requirements/state rm), Atlantis now reads every page of reviews and takes each reviewer's most recent approve or request-changes review.approved. On Gitea, any push that changes the diff invalidates every existing approval until reviewers approve again.Pull request must be approved according to the project's approval rules before running apply.even though an old approval is visible on the PR.Apply
Apply is refused when the plan file differs from the one recorded at plan time (GHSA-5vwh-xc92-8h64)
planstep, Atlantis records a SHA-256 of the plan file with the project's plan status.applyrejects a plan file that no longer matches that hash, and deletes the file.planstep leaves no plan file now fails at plan time instead of at apply.runsteps in the plan stage can still post-process the file.runsteps record no hash and are not checked. Plans recorded before the upgrade carry no hash and are still accepted.pre_workflow_hooksor tooling that rewrite or replace the plan file betweenatlantis planandatlantis apply. Workflows whose plan stage includesplanbut somehow don't leave the plan file at the expected path.plan file for dir "<d>" workspace "<w>" project "<p>" does not match the plan that was recorded when it was created; run `atlantis plan`.plan step did not write a plan file for dir "<d>" workspace "<w>" project "<p>".atlantis planagain. Don't modify the plan file after the plan stage finishes. Any post-processing has to happen inside the plan stage, before Atlantis records the hash.PlanHashis a new field in stored project status and inPlanSuccessAPI responses. Old stored data decodes unchanged.Setup
GitHub App setup flow is bound to the browser that started it (GHSA-rx6x-hrg2-g435)
/github-app/setupnow issues a one-timestatenonce and anHttpOnlycookie, both valid for 10 minutes./github-app/exchange-codeonly accepts a callback that carries both.Atlantis already has GitHub credentials) in the same process. Before, that only happened after a restart with credentials configured, so record the credentials shown before leaving the page.GitHub app setup state is not valid for this browser, start again from /github-app/setuporGitHub app setup state expired, start again from /github-app/setup.--web-basic-authwhile setting up.Non-breaking fixes
output: hideon customrunandmultienvsteps now also hides output when the step fails, in both the PR comment and the job message. Themultienvparse error no longer echoes the offending line; it now reads likeinvalid environment variable definition: misquoted at offset 8.envsteps are unchanged.Security fixes
atlantis.yamlcould skip the server'sallowed_workflowscheck.apply_requirements: [approved]./api/planand/api/applydid not validatepaths[].directoryat the API boundary. (The authentication half was fixed in v0.45.0; constant-time basic auth is GHSA-48vm.)GET /api/locksexposed lock metadata without an API token.-var-fileallowlist could be bypassed, allowing arbitrary file reads on the Atlantis server.atlantis state rmignored apply and import requirements.output: hideon customrunandmultienvsteps leaked output into PR comments when the step failed.stateparameter).Thank you to everyone who reported these issues, and to @chenrui333 and @pseudomorph for reviewing every fix.
Other changes
parallel_planis honored for API plans and drift detection (feat(api): honor parallel_plan for API plans and drift detection #6963).What's Changed
Breaking Changes 🛠
Provider GitLab
Security changes
Documentation
Dependencies
Other Changes 🔄
New Contributors
Full Changelog: v0.48.2...v0.49.0
This discussion was created from the release v0.49.0.
All reactions