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

waypoint bypass detection and authz skip #971

Closed
wants to merge 2 commits into from

Conversation

stevenctl
Copy link
Contributor

An alternative to istio/istio#50475.

if has_waypoint && !from_waypoint {
  deny();
else if !has_waypoint {
  check_rbac();
}

We had a similar check in the past. One key difference in this version is that has_waypoint and from_waypoint checks both the destination workload and all it's services for waypoint attachment.

@stevenctl stevenctl requested a review from a team as a code owner April 24, 2024 17:39
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 24, 2024
@@ -147,6 +148,9 @@ pub struct Endpoint {

/// The port mapping.
pub port: HashMap<u16, u16>,

#[serde(skip_serializing)]
pub identity: Identity,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copying this to Endpoint saves us a lot of Workload lookups.

@louiscryan
Copy link

I think we want the following

if is_mesh_traffic {
  if has_waypoint { 
     if from_waypoint {
       allow();
     } else if src_can_skip_waypoint {  #skip waypoint API TBD
       check_rbac();
     } else {
       deny("must go through waypoint")
     }
  } else {
    check_rbac();
  }
} else {
  check_permissive();
} 

I've included a hypothetical future 'skip-waypoint' API which I think will be useful, particularly to enable something like ingress which may systematically skip waypoints but for which we have not done design work.

I think the above (or the original) make it clear that authz is delegated to the waypoint when one is used by a workload. This lines up conceptually with how the APIs and compositional patterns are defined so I think this is overall good and better than the 'defaultAllow' alternatives. Its also pretty similar to the code that was there before so its not that disruptive.

@stevenctl stevenctl force-pushed the waypoint-check branch 5 times, most recently from b1b00de to f512910 Compare April 25, 2024 21:26
@istio-testing
Copy link
Contributor

PR needs rebase.

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.

@howardjohn
Copy link
Member

@stevenctl this is obsolete now, right?

@stevenctl stevenctl closed this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR needs to be rebased before being merged size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants