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

Restrict tigera-operator secret access to namespace only #3630

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

vara2504
Copy link
Contributor

@vara2504 vara2504 commented Dec 3, 2024

Restrict tigera-operator secret access to namespace only, retain get/list/watch cluster-wide
https://tigera.atlassian.net/browse/EV-5410

Tested external prometheus ,
bz addons run external-prometheus:setup
bz addons run wireguard:setup
image

External-prometheus E2E passed

Description

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@marvin-tigera marvin-tigera added this to the v1.37.0 milestone Dec 3, 2024
@vara2504 vara2504 force-pushed the operator_rbac branch 2 times, most recently from 3feb8e6 to 046006e Compare December 4, 2024 21:55
@vara2504 vara2504 changed the title Operator rbac Restrict tigera-operator secret access to namespace only Dec 5, 2024
@vara2504 vara2504 force-pushed the operator_rbac branch 3 times, most recently from c5e209c to 34f0c59 Compare December 6, 2024 00:57
@vara2504 vara2504 marked this pull request as ready for review December 6, 2024 00:58
@vara2504 vara2504 requested a review from a team as a code owner December 6, 2024 00:58
@radTuti radTuti modified the milestones: v1.37.0, v1.38.0 Dec 13, 2024
Copy link
Member

@rene-dekker rene-dekker left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -186,6 +186,8 @@ func (mc *monitorComponent) Objects() ([]client.Object, []client.Object) {
render.CreateNamespace(common.TigeraPrometheusNamespace, mc.cfg.Installation.KubernetesProvider, render.PSSBaseline, mc.cfg.Installation.Azure),
}

toCreate = append(toCreate, render.CreateOperatorSecretsRoleBinding(common.TigeraPrometheusNamespace))
Copy link
Member

Choose a reason for hiding this comment

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

On line 239 we may be creating a secret for which the operator requires permissions. Should we render a binding in that namespace prior to rendering the secret?

Copy link
Member

@rene-dekker rene-dekker left a comment

Choose a reason for hiding this comment

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

See the comment in monitor.go

@rene-dekker
Copy link
Member

/merge-when-ready

@marvin-tigera
Copy link
Contributor

OK, I will merge the pull request when it's ready, leave the commits as is when I merge it, and leave the branch after I've merged it.

@marvin-tigera marvin-tigera merged commit 262f0e8 into tigera:master Dec 17, 2024
5 checks passed
rene-dekker pushed a commit that referenced this pull request Dec 18, 2024
… only (#3653)

* Restrict tigera-operator secret access to namespace only, retain get/watch/list cluster-wide

* Add secrets rolebinding for external prometheus

* Trigger Build
nelljerram added a commit to nelljerram/operator that referenced this pull request Dec 19, 2024
nelljerram added a commit to nelljerram/operator that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants