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

[release-4.13]SDN-4184: Limit OVN-Kubernetes RBAC permissions #2093

Conversation

JacobTanenbaum
Copy link
Contributor

@JacobTanenbaum JacobTanenbaum commented Nov 2, 2023

this is the CNO portion of openshift/ovn-kubernetes#1950 and limit the RBAC permissions of ovn-kubernetes

the changes are from
#1896
#1928
#1934

the first two commits applied cleanly leaving the third to have a small conflict because master branch had additional security constraints added

was able to cleanly bring in 8b5cd5f and 2e3fc8e to address #1960

kyrtapz and others added 3 commits November 2, 2023 13:42
Changes to metadata via status subresources are not restricted for the basic kubernetes types.
This means ovn-kubernetes can set the status/annotations/labels with only the status subresource permissions.

openshift-ovn-kubernetes-node cluster role:
 - Add patch,update permission for pods/status and nodes/status

openshift-ovn-kubernetes-controller cluster role:
 - Add patch,update permission for pods/status, nodes/status, namespaces/status and services/status
 - Remove delete opermission for pods - I don't think we need that

Once OVN-Kubernetes uses only status subresource we can remove the write perms to the pod/node/service resources.

Signed-off-by: Patryk Diak <pdiak@redhat.com>
…ous one

CSR is a cluster scoped resource and it is not great to have
the permission to delete it.
CSRs are garbage collected so instead of removing the previous one,
always create the CSR with a randomized name.

Signed-off-by: Patryk Diak <pdiak@redhat.com>
ovnkube-node creates and reads certificatesigningrequests,
there is no need for it to have the update permission.

Signed-off-by: Patryk Diak <pdiak@redhat.com>

almost a clean cherry-pick of 2dc1fd9
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 2, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 2, 2023

@JacobTanenbaum: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.13.z" version, but no target version was set.

In response to this:

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 2, 2023

@JacobTanenbaum: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.13.z" version, but no target version was set.

In response to this:

this is the CNO portion of openshift/ovn-kubernetes#1950 and limit the RBAC permissions of ovn-kubernetes

the changes are from
#1896
#1928
#1934

the first two commits applied cleanly leaving the third to have a small conflict because master branch had additional security constraints added

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.

@kyrtapz
Copy link
Contributor

kyrtapz commented Nov 3, 2023

/lgtm

@kyrtapz
Copy link
Contributor

kyrtapz commented Nov 3, 2023

@JacobTanenbaum we also need to address #1960 by bringing in 8b5cd5f and probably 2e3fc8e

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 3, 2023
it seems that after commit 10dd8c5, we dont need to delete the csr anymore. in fact, we no longer have the needed permissions.
the only reason we didnt hit this in CI is an issue  after my fix of the if statememnt,
this is actually failing ovn-keys, so I had to fix it

see that PR#1928 logs - https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_cluster-network-operator/1928/pull-ci-openshift-cluster-network-operator-master-e2e-ovn-ipsec-step-registry/1687090636676665344/artifacts/e2e-ovn-ipsec-step-registry/gather-extra/artifacts/pods/openshift-ovn-kubernetes_ovn-ipsec-9kpnd_ovn-keys.log

this fixes openshift#1960
the if there was only valid if the cert didnt exist

this fixes openshift#1961
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 7, 2023

@JacobTanenbaum: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.13.z" version, but no target version was set.

In response to this:

this is the CNO portion of openshift/ovn-kubernetes#1950 and limit the RBAC permissions of ovn-kubernetes

the changes are from
#1896
#1928
#1934

the first two commits applied cleanly leaving the third to have a small conflict because master branch had additional security constraints added

was able to cleanly bring in 8b5cd5f and 2e3fc8e to address #1960

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.

@JacobTanenbaum
Copy link
Contributor Author

@trozet PTAL when you get the chance

@kyrtapz
Copy link
Contributor

kyrtapz commented Nov 8, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2023
@jcaamano
Copy link
Contributor

/approve
/label backport-risk-assessed
/retest

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Nov 14, 2023
Copy link
Contributor

openshift-ci bot commented Nov 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JacobTanenbaum, jcaamano, kyrtapz

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:
  • OWNERS [JacobTanenbaum,jcaamano]

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

Copy link
Contributor

openshift-ci bot commented Nov 14, 2023

@JacobTanenbaum: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-vsphere-ovn-dualstack e019108 link false /test e2e-vsphere-ovn-dualstack

Full PR test history. Your PR dashboard.

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.

@JacobTanenbaum
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 15, 2023

@JacobTanenbaum: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.13.z" version, but no target version was set.

In response to this:

/jira refresh

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.

@JacobTanenbaum
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 15, 2023

@JacobTanenbaum: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.13.z" version, but no target version was set.

In response to this:

/jira refresh

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.

@tssurya
Copy link
Contributor

tssurya commented Nov 15, 2023

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 15, 2023

@tssurya: This pull request references SDN-4184 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target either version "4.13." or "openshift-4.13.", but it targets "Alongside OpenShift 4.13" instead.

In response to this:

/jira refresh

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.

@tssurya
Copy link
Contributor

tssurya commented Nov 15, 2023

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 15, 2023

@tssurya: This pull request references SDN-4184 which is a valid jira issue.

In response to this:

/jira refresh

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.

@knobunc knobunc added cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Nov 15, 2023
@knobunc
Copy link
Contributor

knobunc commented Nov 15, 2023

Overrode Jira linkage because the issue did not exist after the IC refactor.

@openshift-merge-bot openshift-merge-bot bot merged commit edd0db7 into openshift:release-4.13 Nov 15, 2023
30 of 31 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build cluster-network-operator-container-v4.13.0-202311152049.p0.gedd0db7.assembly.stream for distgit cluster-network-operator.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet