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-17941: Tighten the rules for modifying Tuned Profiles #766

Conversation

jmencak
Copy link
Contributor

@jmencak jmencak commented Aug 21, 2023

NTO operands allow updating Tuned Profiles. This is intentional and by design
as some host information needs to be communicated back to the NTO operator,
but this also allows a successful local attacker potentially affect node-level
configuration of other cluster nodes.

This change addresses the situation in two ways. First, scoped RBAC
permissions on Profile.status subresource is used to disallow Node-level
write access to Profile.spec. Second, the Node resource is used to provide
status loops back to NTO using the kubelet credential to write an annotation
to the Node resource.

This change also simplifies the mechanism for accepting kernel
command-line parameters as calculated by the NTO operands. Now, all NTO
operands must agree on the calculated kernel command-line parameters.

ClusterOperator/node-tuning now also reports operand version. The
operand version changes only when all operand replicas have successfully
upgraded and are ready. This information is used to block PPC
Reconcilation loop until the operator and operand RELEASE_VERSION agree.
This is a short-term measure to prevent from multiple node reboots
during upgrades.

Other fixes:

  • Disallow MC updates during upgrades when kernel command-line
    parameters of nodes within a MCP do not match.
  • ClusterOperator/node-tuning object was sometimes giving false
    information based on an old Metadata.Generation.

Resolves: OCPBUGS-17941

This is a backport of #775

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 21, 2023

@jmencak: GitHub didn't allow me to request PR reviews from the following users: jmencak.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

NTO operands allow updating Tuned Profiles. This is intentional and by design as some host information needs to be communicated back to the NTO operator, but this also allows a successful local attacker potentially affect node-level configuration of other cluster nodes.

This change addresses the situation in two ways. First, scoped RBAC permissions on Profile.status subresource is used to disallow Node-level write access to Profile.spec. Second, the Node resource is used to provide status loops back to NTO using the kubelet credential to write an annotation to the Node resource.

Resolves: OCPBUGS-17941

/cc

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
Copy link
Contributor

openshift-ci bot commented Aug 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak

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 Aug 21, 2023
@jmencak
Copy link
Contributor Author

jmencak commented Aug 22, 2023

/cc @dagrayvid
This is a straightforward port of #775 to 4.13. Would you be able to take a look when available? Thank you!

@openshift-ci openshift-ci bot requested a review from dagrayvid August 22, 2023 05:13
@jmencak
Copy link
Contributor Author

jmencak commented Aug 22, 2023

/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 Aug 22, 2023
NTO operands allow updating Tuned Profiles.  This is intentional and by design
as some host information needs to be communicated back to the NTO operator,
but this also allows a successful local attacker potentially affect node-level
configuration of other cluster nodes.

This change addresses the situation in two ways.  First, scoped RBAC
permissions on Profile.status subresource is used to disallow Node-level
write access to Profile.spec.  Second, the Node resource is used to provide
status loops back to NTO using the kubelet credential to write an annotation
to the Node resource.

This change also simplifies the mechanism for accepting kernel
command-line parameters as calculated by the NTO operands.  Now, all NTO
operands must agree on the calculated kernel command-line parameters.

ClusterOperator/node-tuning now also reports operand version.  The
operand version changes only when all operand replicas have successfully
upgraded and are ready.  This information is used to block PPC
Reconcilation loop until the operator and operand RELEASE_VERSION agree.
This is a short-term measure to prevent from multiple node reboots
during upgrades.

Other fixes:
  - Disallow MC updates during upgrades when kernel command-line
    parameters of nodes within a MCP do not match.
  - ClusterOperator/node-tuning object was sometimes giving false
    information based on an old Metadata.Generation.

Resolves: OCPBUGS-17941
@jmencak jmencak force-pushed the 4.13-OCPBUGS-17941-profiles-subresource branch from c57e22a to 4ea760d Compare September 4, 2023 12:38
@jmencak jmencak changed the title Tighten the rules for modifying Tuned Profiles OCPBUGS-17941: Tighten the rules for modifying Tuned Profiles Sep 4, 2023
@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 Sep 4, 2023
@openshift-ci-robot
Copy link
Contributor

@jmencak: This pull request references Jira Issue OCPBUGS-17941, which is invalid:

  • expected dependent Jira Issue OCPBUGS-17585 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), but it is ON_QA instead

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:

NTO operands allow updating Tuned Profiles. This is intentional and by design as some host information needs to be communicated back to the NTO operator, but this also allows a successful local attacker potentially affect node-level configuration of other cluster nodes.

This change addresses the situation in two ways. First, scoped RBAC permissions on Profile.status subresource is used to disallow Node-level write access to Profile.spec. Second, the Node resource is used to provide status loops back to NTO using the kubelet credential to write an annotation to the Node resource.

Resolves: OCPBUGS-17941

This is a backport of #765

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-robot
Copy link
Contributor

@jmencak: This pull request references Jira Issue OCPBUGS-17941, which is invalid:

  • expected dependent Jira Issue OCPBUGS-17585 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), but it is ON_QA instead

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.

In response to this:

NTO operands allow updating Tuned Profiles. This is intentional and by design
as some host information needs to be communicated back to the NTO operator,
but this also allows a successful local attacker potentially affect node-level
configuration of other cluster nodes.

This change addresses the situation in two ways. First, scoped RBAC
permissions on Profile.status subresource is used to disallow Node-level
write access to Profile.spec. Second, the Node resource is used to provide
status loops back to NTO using the kubelet credential to write an annotation
to the Node resource.

This change also simplifies the mechanism for accepting kernel
command-line parameters as calculated by the NTO operands. Now, all NTO
operands must agree on the calculated kernel command-line parameters.

ClusterOperator/node-tuning now also reports operand version. The
operand version changes only when all operand replicas have successfully
upgraded and are ready. This information is used to block PPC
Reconcilation loop until the operator and operand RELEASE_VERSION agree.
This is a short-term measure to prevent from multiple node reboots
during upgrades.

Other fixes:

  • Disallow MC updates during upgrades when kernel command-line
    parameters of nodes within a MCP do not match.
  • ClusterOperator/node-tuning object was sometimes giving false
    information based on an old Metadata.Generation.

Resolves: OCPBUGS-17941

This is a backport of #775

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.

@jmencak
Copy link
Contributor Author

jmencak commented Sep 4, 2023

/payload-aggregate periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-gcp-ovn-rt-upgrade 10

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 4, 2023

@jmencak: trigger 1 job(s) for the /payload-(job|aggregate) command

  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-gcp-ovn-rt-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5df55560-4b20-11ee-8463-642b1079c525-0

@jmencak
Copy link
Contributor Author

jmencak commented Sep 5, 2023

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 5, 2023

@jmencak: all tests passed!

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.

@jmencak
Copy link
Contributor Author

jmencak commented Sep 9, 2023

/jira refresh
/retest

@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 Sep 9, 2023
@openshift-ci-robot
Copy link
Contributor

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

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.z) matches configured target version for branch (4.13.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-17585 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE))
  • dependent Jira Issue OCPBUGS-17585 targets the "4.14.0" version, which is one of the valid target versions: 4.14.0
  • bug has dependents

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

In response to this:

/jira refresh
/retest

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.

@jmencak
Copy link
Contributor Author

jmencak commented Sep 9, 2023

@dagrayvid , when you have a minute, would you be able to review this backport of: #775 ? Thank you.

@dagrayvid
Copy link
Contributor

Sorry for the delay!

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2023
@jmencak
Copy link
Contributor Author

jmencak commented Sep 12, 2023

Thank you David.
/label backport-risk-assessed
@mrniranjan in Liquan's absence, would you be able to provide cherry-pick-approved label, please?

@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 Sep 12, 2023
@mrniranjan
Copy link
Contributor

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 12, 2023
@jmencak
Copy link
Contributor Author

jmencak commented Sep 12, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2023
@openshift-merge-robot openshift-merge-robot merged commit 45ba090 into openshift:release-4.13 Sep 12, 2023
11 checks passed
@openshift-ci-robot
Copy link
Contributor

@jmencak: Jira Issue OCPBUGS-17941: All pull requests linked via external trackers have merged:

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

In response to this:

NTO operands allow updating Tuned Profiles. This is intentional and by design
as some host information needs to be communicated back to the NTO operator,
but this also allows a successful local attacker potentially affect node-level
configuration of other cluster nodes.

This change addresses the situation in two ways. First, scoped RBAC
permissions on Profile.status subresource is used to disallow Node-level
write access to Profile.spec. Second, the Node resource is used to provide
status loops back to NTO using the kubelet credential to write an annotation
to the Node resource.

This change also simplifies the mechanism for accepting kernel
command-line parameters as calculated by the NTO operands. Now, all NTO
operands must agree on the calculated kernel command-line parameters.

ClusterOperator/node-tuning now also reports operand version. The
operand version changes only when all operand replicas have successfully
upgraded and are ready. This information is used to block PPC
Reconcilation loop until the operator and operand RELEASE_VERSION agree.
This is a short-term measure to prevent from multiple node reboots
during upgrades.

Other fixes:

  • Disallow MC updates during upgrades when kernel command-line
    parameters of nodes within a MCP do not match.
  • ClusterOperator/node-tuning object was sometimes giving false
    information based on an old Metadata.Generation.

Resolves: OCPBUGS-17941

This is a backport of #775

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.

sdodson added a commit to sdodson/cluster-node-tuning-operator that referenced this pull request Sep 18, 2023
jmencak added a commit to jmencak/cluster-node-tuning-operator that referenced this pull request Sep 20, 2023
openshift#766
introduced a fix for OCPBUGS-17941 by tightening the rules for modifying
Tuned Profiles.  Unfortunately, the fix introduced an upgrade issue
(race), where the old operator still relies on removed Profile
status.bootcmdline.

Reintroduce the field for the old operator, so that it does not cause
additional reboots by seeing the bootcmdline as empty.  The
status.bootcmdline field is not used in any way by the new operator, it
is marked as obsolete and will be removed in the future.

Resolves: OCPBUGS-19351
openshift-merge-robot pushed a commit that referenced this pull request Sep 20, 2023
#766
introduced a fix for OCPBUGS-17941 by tightening the rules for modifying
Tuned Profiles.  Unfortunately, the fix introduced an upgrade issue
(race), where the old operator still relies on removed Profile
status.bootcmdline.

Reintroduce the field for the old operator, so that it does not cause
additional reboots by seeing the bootcmdline as empty.  The
status.bootcmdline field is not used in any way by the new operator, it
is marked as obsolete and will be removed in the future.

Resolves: OCPBUGS-19351

Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
@jmencak jmencak deleted the 4.13-OCPBUGS-17941-profiles-subresource branch October 21, 2023 09:54
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

5 participants