Skip to content

try to constrain rbac based on e2e usage #598

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

Closed
wants to merge 1 commit into from

Conversation

awgreene
Copy link
Contributor

No description provided.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 25, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awgreene

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 25, 2023
@awgreene awgreene force-pushed the constrain-olm-rbac branch 2 times, most recently from 4e82c3e to c4db2c1 Compare October 25, 2023 16:20
@awgreene awgreene marked this pull request as ready for review October 25, 2023 16:24
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 25, 2023
@awgreene
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 25, 2023
Comment on lines 100 to 117
- apiGroups:
- example.com
resources:
- tests
verbs:
- "*"
- apiGroups:
- kiali.io
resources:
- kialis
verbs:
- "*"
- apiGroups:
- monitoring.kiali.io
resources:
- monitoringdashboards
verbs:
- "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The RBAC proposed in this PR stemmed from a run of audit2RBAC against an e2e test's audit logs, I'm not sure how we use these RBACs.

- apiGroups:
    - example.com
    resources:
    - tests
    verbs:
    - "*"
  - apiGroups:
    - kiali.io
    resources:
    - kialis
    verbs:
    - "*"
  - apiGroups:
    - monitoring.kiali.io
    resources:
    - monitoringdashboards
    verbs:
    - "*"

Copy link
Contributor

Choose a reason for hiding this comment

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

How confident can we be here that this audit will have captured all of the permissions we would need? I'm seeing kiali operator stuff in there and wondering if that means we would need to add every resource type from every operator that OLM manages in order to maintain functionality, which would be impractical.

Copy link
Member

Choose a reason for hiding this comment

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

I’m not sure what other operators APIs has to do with this PR. This PR is to restrict the RBAC that is currently used by olm-operator to avoid using wildcards which means it can access a lot of other APIs that it doesn’t need. This only restricts it to a set of APIs that it needs.

Copy link
Member

@dinhxuanvu dinhxuanvu Oct 25, 2023

Choose a reason for hiding this comment

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

I don’t know why those Kiali APIs were added in the original version of this PR but they are not needed as far as I know unless all the sudden OLM is using Kiali operator now.

Copy link
Member

Choose a reason for hiding this comment

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

Also this PR should be on upstream as well. We can certainly refine/restrict RBAC on manifests that are used on upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey! So I saw a similar issue upstream and it's because of the CR/CRD validation logic that OLM has. As @dinhxuanvu pointed out, we had an upstream PR that was a bit less strict on the RBAC we requested, I primarily was using this PR to test something on an OpenShift cluster.

The upstream PR linked earlier is being downstreamed in #600, so I'm going to close this PR.

Comment on lines 30 to 31
verbs:
- "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were options to constrain this further, but I was happy enough with wildcard permissions on what we actively use for now.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 25, 2023

@awgreene: The following tests 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-gcp-olm da37912 link true /test e2e-gcp-olm
ci/prow/e2e-gcp-console-olm da37912 link true /test e2e-gcp-console-olm
ci/prow/e2e-gcp-ovn da37912 link true /test e2e-gcp-ovn
ci/prow/verify da37912 link true /test verify
ci/prow/e2e-gcp-olm-flaky da37912 link false /test e2e-gcp-olm-flaky
ci/prow/e2e-upgrade da37912 link true /test e2e-upgrade

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.

@awgreene awgreene closed this Oct 31, 2023
@awgreene
Copy link
Contributor Author

I was using this PR to test some changes to OLM's RBAC, which lead to this upstream PR which is being downstreamed in #600, so I'm going to close 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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants