kubernetes-sigs / external-dns

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Apache License 2.0
7.56k stars 2.54k forks source link

Hide the AWS assume role ExternalID #4277

Open iul1an opened 6 months ago

iul1an commented 6 months ago

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

omerap12 commented 4 months ago

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

k8s-triage-robot commented 1 month ago

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

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

You can:

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

/lifecycle stale

iul1an commented 1 month ago

/remove-lifecycle stale