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

Use $RUNNER_TEMP when TF_CLI_CONFIG_FILE not in use #270

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brandonc
Copy link

@brandonc brandonc commented Nov 9, 2022

I suspect that if you don't specify the TF_CLI_CONFIG_FILE environment variable, the default config that is written to $HOME directory could be overwritten/leaked to multiple runners when using non-ephemeral, self-hosted runners.

When TF_CLI_CONFIG_FILE is not in use, I replaced the usage of $HOME with the directory $RUNNER_TEMP, whose setup/cleanup is managed by the runner framework and exported a TF_CLI_CONFIG_FILE to be used by terraform in subsequent steps.

Fixes #269

@brandonc brandonc requested a review from a team as a code owner November 9, 2022 03:16
@brandonc brandonc force-pushed the brandonc/tmp_cli_config branch 2 times, most recently from 4faeb26 to abf27e7 Compare November 9, 2022 03:24
If you don't specify the TF_CLI_CONFIG_FILE environment variable, the
default config is written to $HOME directory, which could theoretically
be shared by multiple runners when using self-hosted runners.

When TF_CLI_CONFIG_FILE is _not_ in use, I replaced the usage of
$HOME with the directory $RUNNER_TEMP, whose setup/cleanup is
managed by the runner framework and exported a TF_CLI_CONFIG_FILE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clobbering the CLI config file by default
1 participant