Skip to content
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

Add authorization policy v1beta1 #918

Merged
merged 3 commits into from
Aug 9, 2019
Merged

Conversation

yangminzhu
Copy link
Contributor

@yangminzhu yangminzhu commented May 7, 2019

@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 May 7, 2019
@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yangminzhu
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: costinm

If they are not already assigned, you can assign the PR to them by writing /assign @costinm in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yangminzhu yangminzhu added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label May 7, 2019
@yangminzhu yangminzhu force-pushed the authz-v2 branch 2 times, most recently from 443eb7f to 6b4bab2 Compare May 9, 2019 22:43
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label May 9, 2019
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
@pitlv2109
Copy link
Member

Link to istio/istio#12394 for tracking

rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

@duderino
@louiscryan

Not commenting on the content - but timing. We are 2 weeks before the 1.2 freeze, and I'm not sure this
API will be implemented and has all the required testing ( perf, stability, etc ) in the remaining time.

At the same time, the existing alpha1 is still not fully automated (AFAIK) and probably has code mauve gaps.

Would it make sense to delay this for 1.3 - and focus on code mauve ?

Even if it may be possible to finish implementation in the remaining 6 working days until freeze - I'm worried it will be rushed and not ready for prod.

If the plan is to have alpha-quality implementation for this - it would be better to focus the remaining time
on testing the stuff prod users use and not confuse users.

@yangminzhu
Copy link
Contributor Author

@costinm
This is targeted for 1.3 so no rush for 1.2.

rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
@costinm
Copy link
Contributor

costinm commented May 11, 2019 via email

@yangminzhu yangminzhu force-pushed the authz-v2 branch 2 times, most recently from 25a45f3 to 9d3b0a5 Compare May 13, 2019 22:26
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
@yangminzhu yangminzhu force-pushed the authz-v2 branch 2 times, most recently from e62b8fc to e740981 Compare May 14, 2019 01:34
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
rbac/v1alpha2/rbac.proto Outdated Show resolved Hide resolved
@pitlv2109
Copy link
Member

Just to double check, are we waiting for 1.2 release before we check in this PR?

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jul 29, 2019
@pitlv2109
Copy link
Member

I think we can update the API now, given that the design has been approved?

@yangminzhu yangminzhu force-pushed the authz-v2 branch 2 times, most recently from 43fe5bf to 459578c Compare August 3, 2019 02:44
@yangminzhu
Copy link
Contributor Author

@liminw @pitlv2109 PTAL, thanks.

Copy link
Contributor

@liminw liminw left a comment

Choose a reason for hiding this comment

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

Thanks for the changes.

In the PR description, add reference to the design doc https://docs.google.com/document/d/1diwa9oYVwmLtarXb-kfWPq-Ul3O2Ic3b8Y21Z3R8DzQ.

security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
security/v1beta1/authorization.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@liminw liminw left a comment

Choose a reason for hiding this comment

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

/lgtm

@yangminzhu
Copy link
Contributor Author

@costinm @rshriram Could you review the API change? The design is approved and already shared with the community. Thank you.


// $hide_from_docs
// WorkloadSelector specifies the scope where the authorization policy should be applied to.
message WorkloadSelector {
Copy link
Member

Choose a reason for hiding this comment

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

can you use this opportunity to move the workloadSelector from sidecar and use the same one? I do not want to duplicate the workload selector again. Second, you have a different field in workload selector than what sidecar has, which is not a good UX.

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

Please reconcile with the workload selector in sidecar/envoyfilters. We cannot have yet another implementation of workload selector with different semantics (matchLabels, etc.)..

@costinm
Copy link
Contributor

costinm commented Aug 8, 2019 via email

@costinm
Copy link
Contributor

costinm commented Aug 8, 2019 via email

@liminw
Copy link
Contributor

liminw commented Aug 8, 2019

Add @louiscryan @smawson

@costinm @rshriram Agree that we should have a single "selector" syntax. Based on Istio Config Model, the following is the only approved "selector" format. Shall we reconcile the existing APIs to move to the agreed syntax?

  selector:
     matchLabels:
          <label selector>

@yangminzhu
Copy link
Contributor Author

yangminzhu commented Aug 8, 2019

@rshriram @costinm @liminw I changed to use the WorkloadSelector in Sidecar. We could move the WorkloadSelector to a common directory if you prefer, I can do it in this PR.

As for Gateway, I would prefer not to change it in this PR. The syntax will change and all code and yaml need to update, and this should be done in a separate PR.

@liminw
Copy link
Contributor

liminw commented Aug 8, 2019

In existing code, there are two different selector definitions.

In sidecar

workloadSelector:
   labels:
      app: A

In Gateway,

selector:
   app: A

Both are different from the agreed on selector definition in Istio config model doc. Either picking one of the definitions above, or following the recommendation in Istio config model, we need a standard selector definition, and use it for all APIs consistently.

@yangminzhu
Copy link
Contributor Author

/test api-presubmit

@yangminzhu
Copy link
Contributor Author

yangminzhu commented Aug 9, 2019

Within this PR's scope, I think we have 3 options:

  1. Add new WorkloadSelector that is exactly the same as the one approved in the Istio config model doc

  2. Reuse the WorkloadSelector in Sidecar.proto which is a little bit different from the approved one. The difference is in the field name: labels vs matchLabels

  3. Reuse the WorkloadSelector in Sidecar.proto but also move it to a new common directory.

@rshriram @costinm @louiscryan @smawson @liminw I can do any of the above in this PR, could you let me know which one you prefer? Thank you.

@rshriram
Copy link
Member

rshriram commented Aug 9, 2019

I care less about naming. We need consistency. So, if this new "selector" is the answer, then lets go for it. You can change the EnvoyFilter's workloadSelector to this new Selector thing immediately as it has not been released yet. For the gateway, you have a problem. Sidecars would need some deprecation model..

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants