Skip to content

Support defining additional keys to sanitize for actuator endpoints #25384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nathankooij opened this issue Feb 22, 2021 · 3 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@nathankooij
Copy link

After adopting the Spring Boot Admin (SBA) some colleagues astutely observed that we were "leaking" some secrets as SBA provides convenient access to the configprops and env actuator endpoints. Fortunately we can change the keys which values would get sanitized with the following two properties: management.endpoint.configprops.keys-to-sanitize and management.endpoint.env.keys-to-sanitize. However, setting these overwrites all defaults which we would like to keep (since they make a lot of sense). Our current solution is to copy all defaults and then add our own (we do this in a central place that is applied to all our applications). Consequently, we now need to make ensure that this list is kept up-to-date while also limiting configurability of our internal downstream applications. Ideally, we could keep the default configuration but add to it.

So if possible I would like to suggest a additional-keys-to-sanitize property to be introduced which would allow one to set additional keys to sanitize while keeping the defaults.

Additionally, it would be great if the Sanitizer could also apply the same special handling to url keys that it does for the keys of Sanitizer#URI_USERINFO_KEYS, as these also can contain sensitive credentials, such that we do not have to filter the entire value.

We observed this behavior on Spring Boot 2.3.8, but looking at the code of 2.4.x this behavior is still there.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 22, 2021
@wilkinsona
Copy link
Member

@nathankooij Out of interest, what are the keys that you've added? Separate to allowing additional keys to be specified, it might be worth us changing the defaults too if they sound common.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Feb 22, 2021
@nathankooij
Copy link
Author

@nathankooij Out of interest, what are the keys that you've added? Separate to allowing additional keys to be specified, it might be worth us changing the defaults too if they sound common.

@wilkinsona we added url, urls, since we have some URLs with basic auth credentials inside, but the current sanitization is only applied to uri(s). We also added private.* since e.g. we had a property called privateKeyId. I don't know if that last one would hold universally, but works for our use case.

@wilkinsona
Copy link
Member

Thanks. I think it makes sense to sanitise url and urls by default. I've opened #25387. I'm not so sure about private though and my feeling at the moment is that we should leave that one.

@philwebb philwebb added type: enhancement A general enhancement and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Feb 22, 2021
@philwebb philwebb added this to the 2.5.x milestone Feb 22, 2021
@wilkinsona wilkinsona self-assigned this Feb 24, 2021
@wilkinsona wilkinsona modified the milestones: 2.5.x, 2.5.0-M3 Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants