Skip to content

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Sep 30, 2020

A recent commit [1] introduced an enhanced check for kernel arguments
that works in CoreOS. This commit takes them into use in rhcos4's
moderate profile. The needed checks were created with appropriate text.

[1] #6088

@JAORMX JAORMX changed the title Change rhcos4/moderate kernel argument checks to use coreos check WIP: Change rhcos4/moderate kernel argument checks to use coreos check Sep 30, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Sep 30, 2020
@JAORMX
Copy link
Contributor Author

JAORMX commented Sep 30, 2020

Pull-request updated, HEAD is now aad47f0

@ggbecker
Copy link
Member

@openscap-ci test this please

@JAORMX
Copy link
Contributor Author

JAORMX commented Sep 30, 2020

Pull-request updated, HEAD is now 51be1ae

@JAORMX
Copy link
Contributor Author

JAORMX commented Sep 30, 2020

Pull-request updated, HEAD is now 8bf09e5

@JAORMX
Copy link
Contributor Author

JAORMX commented Sep 30, 2020

Pull-request updated, HEAD is now 2d0e3b3

@JAORMX JAORMX changed the title WIP: Change rhcos4/moderate kernel argument checks to use coreos check Change rhcos4/moderate kernel argument checks to use coreos check Sep 30, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Sep 30, 2020
@JAORMX JAORMX requested review from evgenyz and yuumasato September 30, 2020 11:58
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.

In general LGTM.

identifiers:
cce@rhel7: CCE-82158-7
cce@rhel8: CCE-80944-2
cce@rhcos4: CCE-82673-5
Copy link
Member

Choose a reason for hiding this comment

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

CCE-82673-5 went from rule grub2_page_poison_argument to coreos_page_poison_kernel_argument.
The configuration checked/remediated is almost the same, the difference is that coreos_page_poison_kernel_argument checks only the last boot entry.

I'm not sure if this CEE migration is okay, maybe @redhatrises has thoughts on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am okay with this until we actually deliver something. Ultimately, I think that creating duplicate rules for something that is subtly unique is not a great. This is something to figure out in a separate PR.

<unix:file_object id="object_coreos_{{{ SANITIZED_ARG_NAME }}}_entry_2_does_not_exists"
version="1">
<unix:filepath operation="pattern match">^/boot/loader/entries/ostree-2-*\.conf</unix:filepath>
<unix:filepath operation="pattern match">^/boot/loader/entries/ostree-2-.*\.conf</unix:filepath>
Copy link
Member

Choose a reason for hiding this comment

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

Noice.

@JAORMX
Copy link
Contributor Author

JAORMX commented Sep 30, 2020

Pull-request updated, HEAD is now 86978b9

@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 1, 2020

Pull-request updated, HEAD is now 00ad321

@JAORMX JAORMX force-pushed the rhcos-kernel-args branch from 86978b9 to 00ad321 Compare October 1, 2020 12:45
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 1, 2020

/retest

1 similar comment
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 2, 2020

/retest

@JAORMX JAORMX requested a review from yuumasato October 5, 2020 06:12
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 6, 2020

This is blocked on #6100

JAORMX added 2 commits October 6, 2020 14:00
A recent commit [1] introduced an enhanced check for kernel arguments
that works in CoreOS. This commit takes them into use in rhcos4's
moderate & ncp profiles. The needed checks were created with appropriate text.

[1] ComplianceAsCode#6088
This replaces the explicit MachineConfigs for templates.
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 6, 2020

Pull-request updated, HEAD is now 8427166

@JAORMX JAORMX force-pushed the rhcos-kernel-args branch from 00ad321 to 8427166 Compare October 6, 2020 11:08
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 6, 2020

/test e2e-aws-rhcos4-e8

Copy link
Collaborator

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

Looks quite good, I was a bit confused about the tests, otherwise lgtm

ocil: |-
Inspect the form of all the BLS (Boot Loader Specification) entries
('options' line) in <tt>/boot/loader/entries/*.conf</tt>. If they include
<tt>audit=1</tt>, then auditing is enabled at boot time.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the rule talk about enabling audit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Pointing out that the admin should inspect the kernel command line for audit=1 seems a bit redundant, because it's not the point of this rule. But the ocil rule is not super important for coreos rules and the backlog parameter is mentioned next, so it's OK.

@jhrozek
Copy link
Collaborator

jhrozek commented Oct 6, 2020

OK, so really the only thing I found is the description at linux_os/guide/system/auditing/coreos_audit_backlog_limit_kernel_argument/rule.yml

@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 6, 2020

/test e2e-aws-rhcos4-e8

1 similar comment
@JAORMX
Copy link
Contributor Author

JAORMX commented Oct 7, 2020

/test e2e-aws-rhcos4-e8

Copy link
Collaborator

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

/lgtm

@JAORMX JAORMX merged commit e8e24fc into ComplianceAsCode:master Oct 7, 2020
@yuumasato yuumasato added this to the 0.1.53 milestone Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants