istio: Unable to get two CUSTOM AuthorizationPolicies for the same workload
Bug description I’m trying to setup two CUSTOM AuthorizationPolicies both on the ingressgateway
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: external-authorization
namespace: {{ISTIO_NAMESPACE}}
spec:
selector:
matchLabels:
app: istio-ingressgateway
action: CUSTOM
provider:
name: oauth2-proxy
rules:
- to:
- operation:
ports: [ "{{MONITORING_TOOLS_PORT}}" ]
paths: [ "/*" ]
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: my-api-gateway-auth
namespace: {{ISTIO_NAMESPACE}}
spec:
selector:
matchLabels:
app: istio-ingressgateway
action: CUSTOM
provider:
name: my-api-gateway
rules:
- to:
- operation:
methods: ["POST"]
paths: [ "/integration*" ]
I’m getting the following error in istiod
2021-07-14T15:19:38.232512Z error authorization Processed authorization policy for istio-ingressgateway-565687598-rvxgv.istio-system, 2 errors occurred:
* failed to parse CUSTOM action, will generate a deny all config: only 1 provider can be used per workload, found multiple providers: [my-api-gateway oauth2-proxy]
* failed to process CUSTOM action: only 1 provider can be used per workload, found multiple providers: [my-api-gateway oauth2-proxy]
[ ] Docs [ ] Installation [ ] Networking [ ] Performance and Scalability [ ] Extensions and Telemetry [X] Security [ ] Test and Release [ ] User Experience [ ] Developer Infrastructure [ ] Upgrade
Expected behavior I should be able to run multiple AuthorizationPolicies with different rules
Steps to reproduce the bug
Version (include the output of istioctl version --remote and kubectl version --short and helm version --short if you used Helm)
client version: 1.9.1
control plane version: 1.9.1
data plane version: 1.9.1 (38 proxies)
How was Istio installed? using IstioOperator
Environment where the bug was observed (cloud vendor, OS, etc) AKS 1.18.19
Additionally, please consider running istioctl bug-report and attach the generated cluster-state tarball to this issue.
Refer cluster state archive for more details.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 17 (4 by maintainers)
FYI, others have mentioned a workaround, and I was finally able to get it working for those interested. You can simply add a couple EnvoyFilters that are the equivalent of what would be generated by a second custom auth provider and policy. I’ve added an example below:
I’ve run into this issue as well. Will there be any resolution? Seems like a very arbitrary and unnecessary limitation
Our team has just ran into this limitation as well and now we’re having to seek alternative solutions. I would also like know when this will be put the roadmap.
This is still an issue / feature we would like to see. What is the plan to put this on the roadmap? Thank you
Is there any news about such a feature?
We ran into the same situation. Is there any progress on this?
not stale
🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2023-06-04. If you feel this issue or pull request deserves attention, please reopen the issue. Please see this wiki page for more information. Thank you for your contributions.
Created by the issue and PR lifecycle manager.
We are running into this limitation. We want to apply multiple providers for 1 workload. Has anyone found a workaround? Perhaps anyone has tried modifying underlying Envoy Filters?
@rbisecke This is not related to the
EnvoyExtAuthzHTTPstruct, but related to lower-level Envoy filters ordering.@yangminzhu what about no guaranteed ordering to start off? and maybe a config of
runAllOnFailto have try all even if one fails?