Skip to content

Commit

Permalink
Merge pull request #3009 from tigera/rs-1379-webhooks-rbac
Browse files Browse the repository at this point in the history
[RS-1379] RBAC for securityevernwebhooks for the UI.
  • Loading branch information
bartolini authored Nov 21, 2023
2 parents c074640 + f971db4 commit b5151ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/render/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,12 @@ func (c *apiServerComponent) tigeraUserClusterRole() *rbacv1.ClusterRole {
Resources: []string{"felixconfigurations"},
Verbs: []string{"get", "list"},
},
// Allow the user to only view securityeventwebhooks.
{
APIGroups: []string{"crd.projectcalico.org"},
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list"},
},
}

// Privileges for lma.tigera.io have no effect on managed clusters.
Expand Down Expand Up @@ -1771,6 +1777,12 @@ func (c *apiServerComponent) tigeraNetworkAdminClusterRole() *rbacv1.ClusterRole
Resources: []string{"felixconfigurations"},
Verbs: []string{"get", "list"},
},
// Allow the user to perform CRUD operations on securityeventwebhooks.
{
APIGroups: []string{"crd.projectcalico.org"},
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list", "update", "patch", "create", "delete"},
},
}

// Privileges for lma.tigera.io have no effect on managed clusters.
Expand Down
10 changes: 10 additions & 0 deletions pkg/render/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,11 @@ var (
Resources: []string{"felixconfigurations"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"crd.projectcalico.org"},
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list"},
},
}
networkAdminPolicyRules = []rbacv1.PolicyRule{
{
Expand Down Expand Up @@ -1500,6 +1505,11 @@ var (
Resources: []string{"felixconfigurations"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"crd.projectcalico.org"},
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list", "update", "patch", "create", "delete"},
},
}
)

Expand Down

0 comments on commit b5151ea

Please sign in to comment.