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-28797: Clarify banner instructions for RHCOS nodes #11635

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

rhmdnd
Copy link
Collaborator

@rhmdnd rhmdnd commented Feb 28, 2024

The instructions for remediating Linux banners on login was pretty vague
for RHCOS nodes. This commit attempts to clarify that by suggesting the
users can use the default remediation, and tweak it to fit their
use case.

Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented Feb 28, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11635
This image was built from commit: a23ef02

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11635

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11635 make deploy-local

@xiaojiey
Copy link
Collaborator

/hold for test

@openshift-ci openshift-ci bot added the do-not-merge/hold Used by openshift-ci-robot bot. label Feb 29, 2024
Copy link
Member

@yuumasato yuumasato left a comment

Choose a reason for hiding this comment

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

/lgtm
Just pending pre-merge tesing

@yuumasato yuumasato self-assigned this Feb 29, 2024
@yuumasato yuumasato added this to the 0.1.73 milestone Feb 29, 2024
@xiaojiey
Copy link
Collaborator

xiaojiey commented Mar 1, 2024

@rhmdnd The description is good. However, the instructions is not updated.
Could you please help to update the instructions? Thanks.
The user need to use command cat /etc/issue.d/legal-notice on node instead of cat /etc/issue

ocil: |-
To check if the system login banner is compliant,
run the following command:
<pre>$ cat /etc/issue</pre>

$ oc get rule upstream-rhcos4-banner-etc-issue -o=jsonpath={.instructions}
To check if the system login banner is compliant,
run the following command:
$ cat /etc/issue

@@ -56,7 +64,8 @@ description: |-
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 75-master-etc-issue
machineconfiguration.openshift.io/role: worker
Copy link
Collaborator

Choose a reason for hiding this comment

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

A mc can only be applied for one pool at the same time. It is meaningless to add one more label here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The matchExpressions can apply MC for both custom pool and worker pool.

spec:
  machineConfigSelector:
    matchExpressions:
      - {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,infra]}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh - interesting. Is that only applicable to node pools though? I was able to find one example here

https://docs.openshift.com/container-platform/4.15/post_installation_configuration/node-tasks.html#configuring-huge-pages_post-install-node-tasks

The instructions for remediating Linux banners on login was pretty vague
for RHCOS nodes. This commit attempts to clarify that by suggesting the
users can use the default remediation, and tweak it to fit their
use case.
Copy link

codeclimate bot commented Mar 6, 2024

Code Climate has analyzed commit a23ef02 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 59.8% (0.0% change).

View more on Code Climate.

@xiaojiey
Copy link
Collaborator

xiaojiey commented Mar 7, 2024

Verification pass with 4.16.0-0.nightly-2024-03-06-073110 + content ghcr.io/complianceascode/k8scontent:11635:

$ oc get rule upstream-rhcos4-banner-etc-issue -o=jsonpath={.instructions}
To check if the system login banner is compliant,
run the following command:

$ cat /etc/issue.d/legal-notice

@xiaojiey
Copy link
Collaborator

xiaojiey commented Mar 7, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Used by openshift-ci-robot bot. label Mar 7, 2024
@xiaojiey
Copy link
Collaborator

xiaojiey commented Mar 7, 2024

/lgtm

@yuumasato yuumasato merged commit 71d28b7 into ComplianceAsCode:master Mar 12, 2024
44 checks passed
@Mab879 Mab879 added OpenShift OpenShift product related. Update Rule Issues or pull requests related to Rules updates. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenShift OpenShift product related. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants