external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

Hide the AWS assume role ExternalID

Open iul1an opened this issue 1 year ago • 1 comments

What would you like to be added: I would like for the AWS assume role ExternalID to not show up in logs, for example:

time="2024-02-21T18:20:30Z" level=info msg="Instantiating new Kubernetes client"
time="2024-02-21T18:20:30Z" level=info msg="Using inCluster-config based on serviceaccount-token"
time="2024-02-21T18:20:30Z" level=info msg="Created Kubernetes client https://172.20.0.1:443"
time="2024-02-21T18:20:31Z" level=info msg="Assuming role: arn:aws:iam::xxxxxx:role/xxxxxxxxx with external id xxxxxxxxxxx"

Why is this needed: Even if ExternalID is not a password, it's still an exploitable piece of information, and it's printed in the logs, regardless of the loglevel.

Other information If there are no objections, I can work on patching this :) The relevant code that needs to be changed is:

To adjust the message about assuming the AWS role: https://github.com/kubernetes-sigs/external-dns/blob/6ca3e40d1e5e5d752dedcc9e42f014e5292777da/provider/aws/session.go#L60-L70

To hide the field when the whole config is printed, by setting the secure tag: https://github.com/kubernetes-sigs/external-dns/blob/6ca3e40d1e5e5d752dedcc9e42f014e5292777da/pkg/apis/externaldns/types.go#L87

iul1an avatar Feb 22 '24 11:02 iul1an

Hey @iul1an , if there are no objections I can help too :)

omerap12 avatar May 03 '24 18:05 omerap12

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 01 '24 19:08 k8s-triage-robot

/remove-lifecycle stale

iul1an avatar Aug 02 '24 12:08 iul1an