runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.74k stars 1.05k forks source link

Git credentials are exposed in atlantis logs #4060

Closed nnovaeshc closed 4 weeks ago

nnovaeshc commented 9 months ago

Community Note


Describe the user story Git credentials are exposed in atlantis logs (at least) when --write-git-creds. Even though there's a warning in atlantis documentation stating "This does write secrets to disk and should only be enabled in a secure environment.", i believe they shouldn't be exposed in the logs. I have provided below an excerpt of the log message and replaced my credentials with actualcredentialshere

1702650458045,"{""level"":""debug"",""ts"":""2023-12-15T14:27:38.045Z"",""caller"":""vcs/gh_app_creds_rotator.go:58"",""msg"":""Refreshing git tokens for Github App"",""json"":{}}"
1702650458045,"{""level"":""debug"",""ts"":""2023-12-15T14:27:38.045Z"",""caller"":""vcs/gh_app_creds_rotator.go:64"",""msg"":""token actualcredentialshere"",""json"":{}}"
1702650458052,"{""level"":""debug"",""ts"":""2023-12-15T14:27:38.052Z"",""caller"":""vcs/git_cred_writer.go:36"",""msg"":""git credentials file has expected contents, not modifying"",""json"":{}}"

Describe the solution you'd like Git credentials are masked or ommited

Describe the drawbacks of your solution N/A

Describe alternatives you've considered N/A

bschaatsbergen commented 9 months ago

I'll happily pick this up. Thanks for taking the time to raise this issue @nnovaeshc ๐Ÿ‘

nnovaeshc commented 5 months ago

@bschaatsbergen any updates on this?