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

OCPBUGS-34816: Block data plane HC configuration requests #4303

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

jparrill
Copy link
Contributor

@jparrill jparrill commented Jul 1, 2024

Added ValidatingAdmissionPolicies to the KAS's HostedCluster to block all configuration requests managed in the management cluster via the HostedCluster object.

Enabling the ValidatingAdmissionPolicy feature gate in the KAS allows us to block certain requests from the Data Plane side without using a webhook. To achieve this, we created the necessary resources (Certificate, RBAC, etc.) that allow HCCO to be identified with a specific user. This designated user will be the only one authorized to execute the required requests. All other users, including those using the admin-kubeconfig, will be blocked by the VAPs validation

Pull Request Content:

  • Enabled ValidatingAdmissionPolicies (VAP) FeatureGate on the KAS
  • Added a new user (via certificates) to HCCO
  • Implemented a new reconciler on HCCO for VAPs managed by Hypershift
  • Updated Kubernetes dependency to v0.30.2
  • Added E2E test for VAPs configured by HCCO

Which issue(s) this PR fixes:
Fixes #OCPBUGS-34816

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 1, 2024
@openshift-ci-robot
Copy link

@jparrill: This pull request references Jira Issue OCPBUGS-34816, which is invalid:

  • expected the bug to target the "4.17.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Added ValidatingAdmissionPolicies to the KAS's HostedCluster to block all configuration requests managed in the management cluster via the HostedCluster object.

Enabling the ValidatingAdmissionPolicy feature gate in the KAS allows us to block certain requests from the Data Plane side without using a webhook. To achieve this, we created the necessary resources (Certificate, RBAC, etc.) that allow HCCO to be identified with a specific user. This designated user will be the only one authorized to execute the required requests. All other users, including those using the admin-kubeconfig, will be blocked by the VAPs validation

Pull Request Content:

  • Enabled ValidatingAdmissionPolicies (VAP) FeatureGate on the KAS
  • Added a new user (via certificates) to HCCO
  • Implemented a new reconciler on HCCO for VAPs managed by Hypershift
  • Updated Kubernetes dependency to v0.30.2

Which issue(s) this PR fixes:
Fixes #OCPBUGS-34816

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 openshift-eng/jira-lifecycle-plugin repository.

@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 Jul 1, 2024
Copy link
Contributor

openshift-ci bot commented Jul 1, 2024

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 openshift-ci bot added do-not-merge/needs-area area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release labels Jul 1, 2024
Copy link
Contributor

openshift-ci bot commented Jul 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jparrill

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-area labels Jul 1, 2024
Copy link

netlify bot commented Jul 1, 2024

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit 4d0d81f
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/66a8fffd8602570008f63059
😎 Deploy Preview https://deploy-preview-4303--hypershift-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jparrill
Copy link
Contributor Author

jparrill commented Jul 1, 2024

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 1, 2024
@openshift-ci-robot
Copy link

@jparrill: This pull request references Jira Issue OCPBUGS-34816, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.17.0) matches configured target version for branch (4.17.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the area/testing Indicates the PR includes changes for e2e testing label Jul 2, 2024
@jparrill
Copy link
Contributor Author

jparrill commented Jul 2, 2024

/test e2e-aws

@openshift-ci-robot
Copy link

@jparrill: This pull request references Jira Issue OCPBUGS-34816, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.17.0) matches configured target version for branch (4.17.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

In response to this:

Added ValidatingAdmissionPolicies to the KAS's HostedCluster to block all configuration requests managed in the management cluster via the HostedCluster object.

Enabling the ValidatingAdmissionPolicy feature gate in the KAS allows us to block certain requests from the Data Plane side without using a webhook. To achieve this, we created the necessary resources (Certificate, RBAC, etc.) that allow HCCO to be identified with a specific user. This designated user will be the only one authorized to execute the required requests. All other users, including those using the admin-kubeconfig, will be blocked by the VAPs validation

Pull Request Content:

  • Enabled ValidatingAdmissionPolicies (VAP) FeatureGate on the KAS
  • Added a new user (via certificates) to HCCO
  • Implemented a new reconciler on HCCO for VAPs managed by Hypershift
  • Updated Kubernetes dependency to v0.30.2
  • Added E2E test for VAPs configured by HCCO

Which issue(s) this PR fixes:
Fixes #OCPBUGS-34816

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 openshift-eng/jira-lifecycle-plugin repository.

@jparrill jparrill marked this pull request as ready for review July 3, 2024 08:12
@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 Jul 3, 2024
@openshift-ci openshift-ci bot requested review from enxebre and hasueki July 3, 2024 08:12
@sjenning
Copy link
Contributor

sjenning commented Jul 3, 2024

fmt changes to cmd/infra/aws/delegating_client.go are causing verify to fail

@jparrill jparrill force-pushed the OCPBUGS-34816 branch 2 times, most recently from 5f8b640 to ad34202 Compare July 5, 2024 09:20
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2024
@jparrill
Copy link
Contributor Author

/test e2e-conformance

@jparrill
Copy link
Contributor Author

/test e2e-conformance

@jparrill
Copy link
Contributor Author

/retest

@jparrill
Copy link
Contributor Author

/test e2e-conformance

@jparrill
Copy link
Contributor Author

/test e2e-conformance

}

// The exception for IBMCloudPlatform is due to the fact that the IBM will include new certificates for HCCO from 4.17 version
if !(hcp.Spec.Platform.Type == hyperv1.IBMCloudPlatform && (releaseImageVersion.Major == 4 && releaseImageVersion.Minor < 17)) {
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 @rtheis I think this is what you were mentioning, is that alright?
Regarding the DisablePKI annotation, yes, it's compatible.

@jparrill
Copy link
Contributor Author

/retest

2 similar comments
@jparrill
Copy link
Contributor Author

/retest

@jparrill
Copy link
Contributor Author

/retest

@jparrill
Copy link
Contributor Author

/test e2e-aws

Copy link
Contributor

openshift-ci bot commented Aug 19, 2024

@jparrill: 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-azure f8168fd link false /test e2e-azure

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-sigs/prow repository. I understand the commands that are listed here.

@jparrill jparrill force-pushed the OCPBUGS-34816 branch 2 times, most recently from 0ac28c0 to b4f3dd6 Compare August 19, 2024 13:37
@jparrill
Copy link
Contributor Author

/retest

Added ValidatingAdmissionPolicies to the KAS's HostedCluster to block all configuration requests managed in the management cluster via the HostedCluster object.

Enabling the ValidatingAdmissionPolicy feature gate in the KAS allows us to block certain requests from the Data Plane side without using a webhook. To achieve this, we blocked all the requests comming from all the users excepting the HCCO one. This designated user will be the only one authorized to execute the required requests. All other users, including those using the admin-kubeconfig, will be blocked by the VAPs validation

Pull Request Content:

- Enabled ValidatingAdmissionPolicies (VAP) FeatureGate on the KAS
- Implemented a new reconciler on HCCO for VAPs managed by Hypershift
- Updated Kubernetes dependency to v0.30.2

Signed-off-by: Juan Manuel Parrilla Madrid <jparrill@redhat.com>
@jparrill
Copy link
Contributor Author

/retest

@csrwng
Copy link
Contributor

csrwng commented Aug 20, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 4531612 and 2 for PR HEAD ea1be5d in total

@openshift-merge-bot openshift-merge-bot bot merged commit b8b5251 into openshift:main Aug 20, 2024
13 checks passed
@openshift-ci-robot
Copy link

@jparrill: Jira Issue OCPBUGS-34816: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-34816 has not been moved to the MODIFIED state.

In response to this:

Added ValidatingAdmissionPolicies to the KAS's HostedCluster to block all configuration requests managed in the management cluster via the HostedCluster object.

Enabling the ValidatingAdmissionPolicy feature gate in the KAS allows us to block certain requests from the Data Plane side without using a webhook. To achieve this, we created the necessary resources (Certificate, RBAC, etc.) that allow HCCO to be identified with a specific user. This designated user will be the only one authorized to execute the required requests. All other users, including those using the admin-kubeconfig, will be blocked by the VAPs validation

Pull Request Content:

  • Enabled ValidatingAdmissionPolicies (VAP) FeatureGate on the KAS
  • Added a new user (via certificates) to HCCO
  • Implemented a new reconciler on HCCO for VAPs managed by Hypershift
  • Updated Kubernetes dependency to v0.30.2
  • Added E2E test for VAPs configured by HCCO

Which issue(s) this PR fixes:
Fixes #OCPBUGS-34816

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: hypershift
This PR has been included in build ose-hypershift-container-v4.18.0-202408200911.p0.gb8b5251.assembly.stream.el9.
All builds following this will include this PR.

@EmilienM
Copy link
Member

If someone backport this, please also include the commit in #4609.
Thanks

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. area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/testing Indicates the PR includes changes for e2e testing 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.