Skip to content

Add no_jwt_patterns to auth.proto #345

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

Closed
wants to merge 1 commit into from
Closed

Conversation

qiwzhang
Copy link
Contributor

@qiwzhang qiwzhang commented Feb 2, 2018

If a request doesn't have JWT, it will be rejected.
But some requests are OK without JWT, such as OPTIONS for CORS,
or some paths for health checking.

This auth config change allow users to specify these pattern.

@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 Feb 2, 2018
@qiwzhang qiwzhang requested review from ayj, diemtvu and lizan February 2, 2018 02:45
@istio-testing
Copy link
Collaborator

@qiwzhang: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/api-presubmit.sh bc22646 link /test api-presubmit

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

// But some requests are OK without JWT, such as OPTIONS for CORS,
// or some paths for health checking.
// If a request matches any of no_jwt_patterns, it is OK without JWT.
repeated Pattern no_jwt_patterns = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

This becomes another specialized URL map, and you also put the business logic with the map. There are too much business logic connected together here.

Why EndUser is mentioned in the proto spec? Why the auth is not a service account, or a mobile device, or a IoT, or a delegated service, or impersonation? I think we should have an abstraction here. The URL map produce an operation id, and the operation id maps to authentication requirements. The concept of JWT or end user should not be the top level concept.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will address some of your concerns with this issue
#344

Copy link
Contributor

Choose a reason for hiding this comment

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

EndUserAuthenticationPolicy can be renamed to auth filter config with #344. There was some previous discussion about treating this matching as authZ problem and handling in the mixer. But that can be inefficient as we end up unconditionally trying to validate all JWT for a host regardless of the path/method. Could an attribute match condition similar to the quotaspec make sense here, or should it be specialized for specific attributes (e.g. api.operation)?

The top-level AuthenticationPolicy (see #335) possibly ought to support this mapping of auth requirements to particular sets of operations (or entire service or maybe even namespace). @diemtvu

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this is aligned with the SelectCriteria discussed here, though I haven't fully fleshed out all details. However, our intention is to have that in the AuthN policy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should be careful about which level of config we are talking here. This is NOT user level config. This is low-level component level config. Specifically this is the config for Envoy auth filter defined here: https://github.com/istio/proxy/blob/master/src/envoy/auth/config.proto

Auth filter will be upstreamed to Envoy. It should not depended on any Istio proto files. That config proto is just copied from this proto file. So this proto file is the low level Envoy filter config for Mixer Filter and Auth filter.

User level auth config will be defined in @diemtvu PR #335

Copy link
Contributor

Choose a reason for hiding this comment

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

We can depend on core protos in data-plane-api. If there is no good match, then we can start a discussion to add another core proto. There's value in consolidating proto definitions, instead of copying them from place to place.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit confused by the structure of this proto. Pattern matching is a common way for software, and it should looks like this way for most people:

match xxx:
  action

This proto puts the pattern matching inside the action, which is counter intuitive.

Pattern matching on request should be a common function across Envoy and Istio. I strongly prefer we define it in a central place. JWT rule essentially an action that produces the request auth attributes.

@qiwzhang qiwzhang closed this Mar 2, 2018
@qiwzhang qiwzhang deleted the mmm branch March 2, 2018 23:06
nacx pushed a commit to nacx/api that referenced this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants