Skip to content

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.
@brandonc brandonc force-pushed the brandonc/tmp_cli_config branch from abf27e7 to c9de504 Compare November 9, 2022 03:32
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