Skip to content

Conversation

@Shikugawa
Copy link
Member

This is highly related to istio/proxy#2800.

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Jul 18, 2020
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 18, 2020
@Shikugawa
Copy link
Member Author

cc. @yangminzhu

// Map from issuer to location of the payload that is emitted by Jwt filter.
// This information is added by pilot when construct and add Jwt and
// authN filters.
map<string, string> jwt_output_payload_locations = 3;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we place this on here?

@lizan
Copy link
Contributor

lizan commented Jul 22, 2020

@istio/wg-security-maintainers PTAL

@@ -0,0 +1,50 @@
// Copyright 2020 Istio Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply, this get lost in my inbox :(

A high level comment, should we move this API to the proxy repo instead of putting it in the istio/api again? This is internal filter API and should not be in the istio/api (user-facing) repo in the first place, we could take this chance to clean it up.

(this caused a lot confusions before, cc @costinm @incfly )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is no benefit in having it in istio/api. You would need to manually generate pb.go files in istio/istio anyways and keep that in sync with proxy version.

// trust domains.
// Note, the istio authn filter only validates the trust domain when mTLS is
// used, In other words, this field has no effect for plaintext traffic.
bool skip_validate_trust_domain = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is another change from @incfly for adding a list of strings for trust domain validation.

// authentication policy on Envoy.
message FilterConfig {
// Filter configuration for RequestAuthentication, which supports Jwt authentication.
istio.security.v1beta1.RequestAuthentication request_authentication = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to not to depend on istio/api? technically the internal filter config doesn't need to depend on the user-facing API, and the filter also probably have a simpler API?

just optional as we can always iterate on this part later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed by istio/istio, hopefully we don't need to import istio/proxy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be very nice if the new authn filter doesn't depend on istio/api but has its own definition in istio/proxy. I think it's not very clear at this moment how would istio/istio depend on the filter API that is defined in istio/proxy, right? the authn filter seems to be the only case here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am wrong actually. Istio currently will try to read config dumps/things configured through EnvoyFilter, so if those are in use we need to import it. If this is some opaque blob for WASM or something then its fine. Basically if @type: foo shows up anywhere, we need to import foo I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't mix istio and envoy APIs. They use incompatible protobufs (gogo in istio, golang in xds), so it just causes confusion down the line.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. don't see why it's needed. (miss this thread before).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use istio/api independent envoy filter api, it will be placed similar api definition there. (like RequestAuthentication/PeerAuthentication) Is it acceptable? I understand that this filter api should be placed on istio/proxy but don't understand not to depend on this.

// authentication policy on Envoy.
message FilterConfig {
// Filter configuration for RequestAuthentication, which supports Jwt authentication.
istio.security.v1beta1.RequestAuthentication request_authentication = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the filter going to consume RequestAuthentication directly, when the API requires control plane processing for jwksUrl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confusing about we should consider about jwks_url here. That will be processed finely on EnvoyFilter. https://github.com/envoyproxy/envoy/blob/cf2df8cbe1f5aff726d6b8ea54d5ad716023b70d/api/envoy/extensions/filters/http/jwt_authn/v3/config.proto#L197

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In current code, we do not do jwksUri fetching in envoy, its done in the control plane

// mTLS authentication for sidecar to sidecar workload.
istio.security.v1beta1.PeerAuthentication peer_authentication = 2;

// Map from issuer to location of the payload that is emitted by Jwt filter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is a location?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this field is not needed anymore. https://github.com/istio/istio/blob/536c38d179a770e736e8b2e9063feda89032af75/pilot/pkg/security/authn/v1beta1/policy_applier.go#L141. I will destroy this on the next version of AuthN filter API.

@mandarjog
Copy link
Contributor

If this is going to passed thru api without the need for the control plane to understand it, we don’t need it here.

@costinm
Copy link
Contributor

costinm commented Jul 31, 2020 via email

@costinm
Copy link
Contributor

costinm commented Jul 31, 2020 via email

@mandarjog
Copy link
Contributor

I agree about it being a filter api, and should be reviewed. But it does need to be defined as “istio” api here.

@howardjohn
Copy link
Member

@mandarjog who is actually configuring this? The user? The control plane? something else?

@mandarjog
Copy link
Contributor

@yangminzhu is this a passthru api or does it need controlplane intervention?

@incfly
Copy link

incfly commented Jul 31, 2020

I am a bit confused. So question to @yangminzhu and @Shikugawa

why we put Istio API(RequestAuthentication and PeerAuthentication) inlined in the new WASM based authn filter API? Certain things like workload selector does not make sense to the filter at all. Are there some design/thread on this? I clicked through the linked PR but didn't find any clue.

@costinm
Copy link
Contributor

costinm commented Jul 31, 2020 via email

@yangminzhu
Copy link
Contributor

@mandarjog who is actually configuring this? The user? The control plane? something else?

@howardjohn this is only configured by control plane (istiod).

@yangminzhu is this a passthru api or does it need controlplane intervention?

@mandarjog not sure what you mean for passthru api. This will be used by control plane (istiod) to configure the authn filter to do the work (e.g. extract attributes).

@howardjohn
Copy link
Member

@yangminzhu if this is configured by istiod then istiod needs to import the proto?

@kyessenov
Copy link
Contributor

kyessenov commented Jul 31, 2020

@howardjohn this is only configured by control plane (istiod).

In that case, we need to produce golang protos since it's going to be embedded in xDS config dumps, etc. istio/api produces gogo.

@mandarjog not sure what you mean for passthru api. This will be used by control plane (istiod) to configure the authn filter to do the work (e.g. extract attributes).

Pass through means it's just pasted as opaque blob and not interpreted by istiod. It doesn't sound like the case anymore. Still, I don't think this should be user visible, and it is not a user API at all.

@kyessenov
Copy link
Contributor

Related question: we should consider not using proto for the Wasm plugin. You are taking a hit of 1MB extra binary size just to parse 4 fields in a JSON.

@yangminzhu
Copy link
Contributor

yangminzhu commented Jul 31, 2020 via email

@yangminzhu
Copy link
Contributor

yangminzhu commented Jul 31, 2020 via email

@kyessenov
Copy link
Contributor

@yangminzhu I agree that we should consider upstreaming if it is possible. But if that doesn't happen, then the only choice is Wasm ABI, so a lot of the questions raised here are moot (why even use proto if you don't have to).

@Shikugawa
Copy link
Member Author

Shikugawa commented Aug 9, 2020

@istio/wg-security-maintainers I guessed about the usecase of new authentication filter and concluded that our requirements about this are,

  • To construct new (and simple) authn filter config definition.
  • Remove the dependencies on the user visible istio/api.
  • Put these filter API (like intermediate representation) on istio/proxy.
  • Only to have .pb.go on istio/istio.

So all we have to do is,

  1. Create intermediate proxy filter config definition.
  2. Implement conversion layer from user visible API (which is defined on security/v1beta1) to intermediate proxy filter config definition when delivering to data plane on istio/istio.

Is my idea correct? cc. @howardjohn @kyessenov @mandarjog

@yangminzhu
Copy link
Contributor

@istio/wg-security-maintainers I guessed about the usecase of new authentication filter and concluded that our requirements about this are,

  • To construct new (and simple) authn filter config definition.
  • Remove the dependencies on the user visible istio/api.

Correct, this is one of the big benefits of the new authn filter.

  • Put these filter API (like intermediate representation) on istio/proxy.
  • Only to have .pb.go on istio/istio.

I'm not sure if we can put the original .pb.go in istio/proxy have a way to auto import it in the istio/istio repo as a copy. Hope we can have a way to make this maintenance easier instead of requiring manually coping the file between the two repos.

So all we have to do is,

  1. Create intermediate proxy filter config definition.
  2. Implement conversion layer from user visible API (which is defined on security/v1beta1) to intermediate proxy filter config definition when delivering to data plane on istio/istio.

Correct, this is basically just to use the new authn filter in istiod, should be easy and straightforward to do since we only need to configure a few fields for the authn filter (the most complicated part today is the Envoy JWT fitler which is not affected by this change)

Is my idea correct? cc. @howardjohn @kyessenov @mandarjog

@howardjohn howardjohn removed the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label May 15, 2024
@istio-policy-bot
Copy link

🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2020-08-09. 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.

@istio-policy-bot istio-policy-bot added the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.