-
Notifications
You must be signed in to change notification settings - Fork 41.2k
sanitize by default a key containing uri
or url
.
#6876
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
Conversation
That seems a bit agressive to me. I'd rather have something that parse the url to detect that a password is specified and santize that. It could be either a standard user:pass in an HTTP url or some parameter with a well-defined name (i.e. |
How does or |
I don't like it either. You don't want to santize the full URL, do you? You want to sanitize the credentials only. Wondering what others think. |
So how about making the Sanitizer exchangable so that custom implementations for the masking can be used? |
@joshiste it's already customizable https://github.com/spring-projects/spring-boot/blob/v1.4.0.RELEASE/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java#L51-L53 . |
Only the list of the regexes, but the |
@joshiste Sounds nice! class Sanitizer {
Sanitizer(SanitizePatterns patterns) {
// ...
}
} class SanitizePatterns {
private final List<SanitizePattern> patterns;
} and auto-configuration @Bean
@ConditionOnMissingBean
SanitizePatterns sanitizePatterns(List<SanitizePattern> patterns) {
SanitizePatterns patterns = new SanitizePatterns("password", "secret", "key", "token", ".*credentials.*", "vcap_services");
patterns.addAll(patterns);
return patterns;
} If a project want to mask other patterns, add @Bean
SanitizerPattern myPattern() {
return new SanitizerPattern("url");
} |
@joshiste please share that idea in a separate issue, thanks. |
Similar request in #6587 |
Another example: |
Spring Boot apps in Cloud foundry often expose credentials as the property whose key ends with
url
oruri
as follows:I hope those are hidden by default.