Add doc on how to use Istio Authorization with Knative and Istio mesh mode#2583
Add doc on how to use Istio Authorization with Knative and Istio mesh mode#2583knative-prow-robot merged 10 commits intoknative:masterfrom nak3:add-authz
Conversation
docs/serving/istio-authorization.md
Outdated
| @@ -0,0 +1,114 @@ | |||
| --- | |||
| title: "Knative application under the strict authorization policy" | |||
There was a problem hiding this comment.
It's not clear to me from this title
- What "strict authorization policy" is and why someone would need it for a Knative app?
- Whether this section is conceptual information or contains steps to complete a task?
I'd try to make this clearer. Maybe something like:
"Enabling requests to Knative services when additional authorization policies are enabled"
There was a problem hiding this comment.
I'm also wondering whether this belongs in a more Istio specific place, @mattmoor wdyt?
There was a problem hiding this comment.
- What "strict authorization policy" is and why someone would need it for a Knative app?
"strict authorization policy" is an Istio's feature. It can control access to allow/deny, which Knative does not have. So someone would like to use it.
Whether this section is conceptual information or contains steps to complete a task?
It is a "contains steps to complete a task"?
I'm also wondering whether this belongs in a more Istio specific place
Yes, we definitely should belong in an Istio specific place. But I think I should open a new request to create the new hierarchy of the doc like:
https://knative.dev/docs/serving/istio/some-new-feature (istio)
https://knative.dev/docs/serving/kourier/some-new-feature (kourier)
docs/serving/istio-authorization.md
Outdated
| When you deployed app to Knative Serving, serving system pods such as activator and autoscaler access to your app. | ||
| Hence, you have to allow the requests to your app when you configure security features such as istio authorization policy. | ||
|
|
||
| > Tip: This example assumes that your application enabled istio sidecar injection. |
There was a problem hiding this comment.
This should be a prerequisite instead, and I think this whole doc should be somewhere specific to Istio.
@evankanderson @mattmoor I think we should probably have some sort of "Post-installation tasks" section that includes things like this but I'm not sure, wdyt?
docs/serving/istio-authorization.md
Outdated
| > $ kubectl create namespace serving-tests | ||
| > $ kubectl label namespace serving-tests istio-injection=enabled |
There was a problem hiding this comment.
Explain what these commands actually do. It looks like it's creating a namepace and labelling it for istio-injection, but it's not clear what this accomplishes. Is this how a user enables access to Knative services as mentioned earlier?
|
Hey @nak3, I am also working on this right now, testing Istio Authorization Policies with knative-serving. so maybe the flags in the helm template are wrong or this is an additional step, I haven't tested with the way istio is installed here: https://knative.dev/docs/install/installing-istio/? |
|
Hi @Shashankft9 Yes, it was discussed in #2073 whether it should be fixed or not. (Although it was not fixed on Istio 1.4, Istio 1.5+ can inject the sidecar with namespace label.) |
|
ahh I see, mine is v1.4.6, that explains. So I should Instead follow the installation steps from here: https://knative.dev/docs/install/installing-istio/#installing-istio-with-sidecar-injection? Will it conflict with my knative-serving v0.14.0 because I dont see any crd |
|
Yes, the new Istio installation needs istioctl |
|
/hold |
|
@nak3 do we need any other reviews from technical / eng folks here or is this OK to merge? I've put it on hold for now but it looks fine to me. |
|
Thank you @abrennan89 /cc @tcnghia @josueetcom @ZhiminXiang @itsmurugappan |
|
maybe add what |
docs/serving/istio-authorization.md
Outdated
| paths: | ||
| - / # The path for your application. | ||
| EOF | ||
| ``` |
There was a problem hiding this comment.
Its worth mentioning that, If you use principal and namespace in the policies, Mutual TLS need to be enabled. If you are using jwt claims, mtls is not a prereq.
There was a problem hiding this comment.
Yes, we should. I updated the doc with the link to Istio doc.
|
overall looks good. Just a few nits from my side. |
| @@ -0,0 +1,90 @@ | |||
| --- | |||
| title: "Enabling requests to Knative services when additional authorization policies are enabled" | |||
There was a problem hiding this comment.
Is this a doc for specifically the case when additional authorization policies are enabled or is it a general doc for using Istio authorization with Knative and Istio mesh mode (per the PR title)?
There was a problem hiding this comment.
Yes, It is a general doc for using Istio authorization with Knative and Istio mesh mode.
There was a problem hiding this comment.
Hmm, maybe I'm lacking context but when I read the title it does immediately suggest this is specifically for Istio (do other networking layers have authorization policies?).
josueetcom
left a comment
There was a problem hiding this comment.
Just some minor nits, otherwise LGTM
| @@ -0,0 +1,90 @@ | |||
| --- | |||
| title: "Enabling requests to Knative services when additional authorization policies are enabled" | |||
There was a problem hiding this comment.
Hmm, maybe I'm lacking context but when I read the title it does immediately suggest this is specifically for Istio (do other networking layers have authorization policies?).
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abrennan89, josueetcom, nak3 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thank you so much for the reviews! Just one note, In addition to reflecting the review comments, I removed the "allowing list by namespace" example by e725e97. Because it allows all traffic via activator and it is very confusable and easy to create a security hall. |
|
/unhold |
|
@abrennan89 This is ready to merge, I think. Could you please add |
|
/lgtm |
Proposed Changes
This patch adds doc on how to use Istio Authorization with Knative.
As described in #2569, the sample configuration of Authorizationpolicy is helpful for our users.
Part of #2569