-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow security passthrough #2290
Comments
Solution found : {
"realm":"App",
"auth-server-url":"http://localhost:8080/auth",
"resource":"Quarkus",
"bearer-only": true,
"credentials": {
"secret": "secret"
},
"policy-enforcer" : {
"enforcement-mode":"PERMISSIVE",
"paths": [
{
"name": "unsecured",
"path": "/health",
"enforcement-mode" : "DISABLED"
}
]
}
} |
@starksm64 is there something we can improve from a user experience point of view? I don't know if it can be done automatically? Not sure it's entirely secure either as your health checks might contain sensitive information and you might want to secure them somehow. Interested in your feedback. |
Hi, It may be that documenting the multiples security related extensions is enough. As it works now, Keycloak extension security handler has high priority in the server filter chain, and the health servlet is placed way down in the stack. From my understanding, if security pass through is to be handled by the smallrye-health extension, it should add a very high priority handler that skip other handler in the chain for dedicated path. |
I'm including this issue in the security arch discussion doc I'm putting together to address our inconsistencies |
@jtama-op did you change anything in the keycloak configuration of the quarkus keycloak starter project? For me the enforcement-mode: DISABLED doesn't work at all. Usualy PERMISSIVE should already be enought as there is no rule defined to match /health so it should be allowed.,not sure though what to change also see: #2231 (comment) |
I did not used the keycloak starter. Please find my configuration bellow (i switched to application.properties). quarkus.keycloak.auth-server-url = http://${KEYCLOAK_HOST:localhost}:8080/auth
quarkus.keycloak.resource = Quarkus
quarkus.keycloak.bearer-only: false
quarkus.keycloak.credentials.secret: ${KEYCLOAK_SECRET:secret}
quarkus.keycloak.policy-enforcer.enforcement-mode = PERMISSIVE
quarkus.keycloak.policy-enforcer.paths.health.name = Heath
quarkus.keycloak.policy-enforcer.paths.health.path = /health
quarkus.keycloak.policy-enforcer.paths.health.enforcement-mode = DISABLED
quarkus.keycloak.policy-enforcer.paths.OpenAPEnuI.name = OpenAPI
quarkus.keycloak.policy-enforcer.paths.OpenAPI.path = /openapi
quarkus.keycloak.policy-enforcer.paths.OpenAPI.enforcement-mode = DISABLED It may be that the Hope it helps. |
@jtama-op Thanks but as you didn't set |
Ok, |
Ok so i got my desired behaviour back. Please find steps to reproduce :
quarkus.keycloak.realm=quarkus
quarkus.keycloak.auth-server-url=http://<keycloak-url>/auth
quarkus.keycloak.resource=backend-service
quarkus.keycloak.bearer-only=false
quarkus.keycloak.credentials.secret: <secret>
quarkus.keycloak.policy-enforcer.enable=true
quarkus.keycloak.policy-enforcer.enforcement-mode=PERMISSIVE
quarkus.keycloak.policy-enforcer.paths.health.name=Heath
quarkus.keycloak.policy-enforcer.paths.health.path=/health
quarkus.keycloak.policy-enforcer.paths.health.enforcement-mode=DISABLED
quarkus.keycloak.policy-enforcer.paths.OpenAPI.name=OpenAPI
quarkus.keycloak.policy-enforcer.paths.OpenAPI.path=/openapi
quarkus.keycloak.policy-enforcer.paths.OpenAPI.enforcement-mode=DISABLED Health check and swagger-ui will be enabled, other resources will be secured. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you! |
I think we at least need to improve the documentation and probably think a bit more about how to deal with health and security. We already had some discussion about that. |
/cc @sberyozkin |
I think we should definitely close this issue, as I also think we should not use keycloak extension... |
What's the status of this issue? Should we close it as is? /cc @gsmet |
Actually I don't know of it's a documentation issue, an extension issue or a feature request.
When using smallrye-health in combination with keycloak extension, health check resource become secured, which is certainly not the desired behaviour.
Keycloak extension does not provide a mechanisme I know of to permit all trafic for a given path, and PermitAll annotation can obviously not be applied on the Health servlet.
Please let me know if I am missing something.
I am using following dependencies management :
The text was updated successfully, but these errors were encountered: