jenkins-infra / helpdesk

Open your Infrastructure related issues here for the Jenkins project
https://github.com/jenkins-infra/helpdesk/issues/new/choose
16 stars 10 forks source link

[2022-03-16] AWS API key exposure (terraform backends) #2834

Closed dduportal closed 2 years ago

dduportal commented 2 years ago

What happened?

What could be the impacts?

How to avoid this from happening again?

Exchanges with different community members, through public and private channels, led to the following list of counter measure to avoid this problem to happen:

Short Term

What can we do right now?

Long Term

What should be think about to fix this in a better way?

Links

timja commented 2 years ago

Challenge: It means WAY more credentials to manage if we do 1:1 mapping (either in Jenkins and for the terraform init command)

Could you provide an example of why this is a lot more credentials? What information you're trying to hide here?

In the case of Azure the sensitive value is the ARM_ACCESS_KEY. You can even do away with that by using a managed identity or service principal

dduportal commented 2 years ago

Challenge: It means WAY more credentials to manage if we do 1:1 mapping (either in Jenkins and for the terraform init command)

Could you provide an example of why this is a lot more credentials? What information you're trying to hide here?

In the case of Azure the sensitive value is the ARM_ACCESS_KEY. You can even do away with that by using a managed identity or service principal

The backend configuration have the following settings currently (all are part of the backend config)

jglick commented 2 years ago

You should not be using AWS API keys. Either use instance identity, if the whole controller can be trusted to act as a logical unit of security; or https://plugins.jenkins.io/oidc-provider/#plugin-content-accessing-aws if you need something finer-grained or are just not running the controller in AWS or on a system which can easily support AWS identities at the infrastructure level.

timja commented 2 years ago

which relates to https://github.com/jenkins-infra/helpdesk/issues/2922#issuecomment-1120893431 for Azure