-
Notifications
You must be signed in to change notification settings - Fork 28
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
Applying v2alpha1 APIRule blocks in-cluster communication to the target #1632
Comments
We discussed it during the refinement:
|
Out of my curiosity. If you are about to extend current implementation by adding a new AP with "notPrincipal" set, wouldn't it be simpler and cleaner just to remove the prior AuthorizationPolicy (with ALLOW for that Principal)? Wouldn't that be the same as no having AP at all? Are there any pros of such an approach that I'm missing? |
@I551317 This unfortunately would not have the same outcome for all supported APIRule cases. For example imagine the following configuration if there would be no AP created for rules:
- path: /headers
methods: ["GET"]
jwt:
authentications:
- issuer: https://example.com
jwksUri: https://example.com
- path: /anything/{**}
methods: ["GET"]
noAuth: true In this case, APIRule would create an AP for JWT exposed
The case where only a |
Thanks Bartosz for the explanation. Indeed, that's what I missed - there are other scenarios than 'noAuth: true' that may still need AP and interfere with that solution. Clear to me. |
Okay, I tested the PR with the following script:
The internal communication works fine:
There is an additional authorization policy created:
|
I am not overly familiar with the AuthorizationPolicies, but the suggested allow-internal policy would mean that deployments that secure their application with an own-namespace-only + istio principal AP would suddenly allow all cluster traffic again? This would then require a change to a deny other namespaces, unless it is the istio-principal policy? |
@ingentismg this implementation match functionality from APIRule v1beta1 that was based on ORY Oathkeeper. Oathkeeper did not configure / restrict internal traffic at all. Based on feedback we received we decided to implement it the same way. APIRule never supported configuration to secure internal traffic. In the future we might want to include that feature on our roadmap. |
Hi @strekm , sorry if I am misunderstanding, but assume the following context: An application/pod has /public and /internal HTTP routes. With v1beta1 only the istio-principal can access /public and only the namespace of the pod can access /internal. The APIRule is actively making my app less secure. If this is the easiest way to solve the issue for most people, that is fine. But my problem is that this change in behavior does not seem to be documented. That is if I am actually correct and not completely missing or misunderstanding something. |
As authorization policies are evaluated in the way that any ALLOW policy matching the request will open the access to the workload I would strongly recommend not adding it by default. In Kyma we follow secure by default principle and adding such a policy as |
based on comments from @ingentismg and @pbochynski we decided to revert this behavior. It will be rolled back with 2.10.5 release and rolled out to managed kyma as soon as possible. Additionally this behavior change will be documented as breaking change compared to APIRule v1beta1. |
…itional Authorization Policy with action ALLOW that is hard to override
…itional Authorization Policy with action ALLOW that is hard to override
Description
Applying v2alpha1 APIRule blocks in-cluster communication to the target, as an AP (AuthorizationPolicy) (action type: ALLOW) is applied in all cases. As logic behind AP blocks all traffic except for a match to the ALLOW AuthorizationPolicy, the internal traffic is blocked unless it is allowed explicitly by a different AP of type ALLOW.
Expected result
Application of v2alpha1 APIRule to a workload should not block in-cluster traffic targeting the workload.
Actual result
Any traffic other than incoming from istio-ingressgateway and matching the APIRule restrictions is blocked.
Steps to reproduce
PR
DoD [Developer & Reviewer]
The text was updated successfully, but these errors were encountered: