Skip to content
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

Remove management.security.enabled from documentation #11383

Closed
mduesterhoeft opened this issue Dec 20, 2017 · 10 comments
Closed

Remove management.security.enabled from documentation #11383

mduesterhoeft opened this issue Dec 20, 2017 · 10 comments
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@mduesterhoeft
Copy link

management.security.enabled has been removed in spring-boot 2. But the docs still mention the property. Please adjust the documentation add a sample for the alternative way to disable security on the management endpoints.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 20, 2017
@bclozel bclozel added priority: normal type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 20, 2017
@bclozel bclozel added this to the 2.0.0.RC1 milestone Dec 20, 2017
@mbhave mbhave self-assigned this Dec 20, 2017
@mbhave
Copy link
Contributor

mbhave commented Dec 21, 2017

Also update this section for actuator security.

@mduesterhoeft
Copy link
Author

Additional feedback and migrating spring 1 management endpoint configuration to spring-boot:
I found this section a little confusing - https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints-security

If you deploy applications behind a firewall, you may prefer that all your actuator endpoints can be accessed without requiring authentication. You can do so by changing the management.endpoints.web.expose property, as follows:

My experience using actuator together with spring-security-oauth2 was that management.endpoints.web.expose=* is not enough to expose the enabled endpoins. I also had to use a WebSecurityConfigurerAdapter to permitAll on EndpointRequest.toAnyEndpoint()

@mbhave
Copy link
Contributor

mbhave commented Dec 21, 2017

Thanks for the feedback. That line refers more to the case where you don't have Spring Security on your classpath. In that case, on setting the management.endpoints.web.expose=* flag, all actuators will be available and will not require authentication. (likely case being that you're behind a firewall).

If Spring Security is on the classpath and no other WebSecurityConfigurerAdapter is present, setting the management.endpoints.web.expose=* flag enables all actuators but they will be secured by Spring Boot auto-config.

If a different WebSecurityConfigurerAdapter is present (which is probably true in your case since you're using OAuth in the app), Spring Boot auto-config will back off and the user is in full control of actuator access rules. For this reason, you need to explicitly add permitAll.

We can update the doc to make that more explicit.

@balajeetm
Copy link

So, If i want to expose the actuator endpoints (because the deployment is behind a firewall) similar to what I was doing with spring boot 1, is replacing
"management.security.enabled=false"
with
"management.endpoints.web.expose=*" enough or should anything else be done?

@spring-projects spring-projects deleted a comment from balajeetm Dec 25, 2017
@spring-projects spring-projects deleted a comment from balajeetm Dec 25, 2017
@mbhave
Copy link
Contributor

mbhave commented Dec 26, 2017

@balajeetm As I've said in my previous comment, the management.endpoints.web.expose=* flag enables all actuators. Further, if Spring Security is on the classpath and you want the actuators to be accessible without requiring any authentication, you need to provide your own WebSecurityConfigurerAdapter which defines all your security configuration. This sample provides an example of how you can configure your own WebSecurityConfigurerAdapter.

If Spring Security is not present, setting management.endpoints.web.expose=* should be enough to access all the actuator endpoints without requiring any authentication.

@balajeetm
Copy link

@mbhave Thanks. That works

@snicoll snicoll changed the title Remove management.security.enabled from documenation Remove management.security.enabled from documentation Dec 28, 2017
@mbhave mbhave closed this as completed in 7c5cf90 Jan 5, 2018
@mariuszs
Copy link

@balajeetm In attached example method EndpointRequest#excluding - cannot be accessed from outside package.

@philwebb
Copy link
Member

@mariuszs That was unfortunately a bug. It's been fixed by #12354 and will be in 2.0.1.

@jblayneyXpanxion
Copy link

I'm having an extremely difficult time trying to figure out what management.security.enabled and management.security.roles has been replaced with...

All of these endpoints are available to the world right now. Is there no simple way to lock them down without configuring my WebSecurityConfigurerAdapter?

I've combed through the documentation here multiple times without luck: https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints-security

Why is the replacement not documented? Sorry - I feel like this is a good spot for this question but can open a question issue if needed - but it seems like it might also be a documentation bug.

@mbhave
Copy link
Contributor

mbhave commented Nov 20, 2020

@jblayneyXpanxion as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. This is a question that would be better suited to Stack Overflow or our gitter channel. If you feel this is a documentation issue please open a new issue rather than commenting on a closed one.

Regarding your point about these endpoints being available to the world, that is not true. The default configuration for all endpoints (except health and info) requires authentication when Spring Security is on the classpath. Additionally the endpoints are not exposed over the web by default. They need to be exposed explicitly using the management.endpoints.web.exposure property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

8 participants