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

Enable generic rules for RHEL9 #7147

Merged
merged 7 commits into from Jul 27, 2021

Conversation

matejak
Copy link
Member

@matejak matejak commented Jun 24, 2021

Those rules interact with components on a low-level basis, so they are likely to work on RHEL9.

See individual commits for more details.

Fixes: #7147

@matejak matejak added this to the 0.1.57 milestone Jun 24, 2021
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 24, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jun 24, 2021

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

@matejak matejak changed the title Enabled generic rules for RHEL9. Enabled generic rules for RHEL9 Jun 24, 2021
@matejak matejak changed the title Enabled generic rules for RHEL9 Enable generic rules for RHEL9 Jul 13, 2021
@matejak matejak added the RHEL9 Red Hat Enterprise Linux 9 product related. label Jul 13, 2021
@matejak
Copy link
Member Author

matejak commented Jul 14, 2021

@Jakuje Could you please check out whether the smart card rules modification makes sense?


title: 'Force opensc To Use Defined Smart Card Driver'

description: |-
The OpenSC smart card tool can auto-detect smart card drivers; however by
The OpenSC smart card middleware can auto-detect smart card drivers; however by
forcing the smart card driver in use by your organization, opensc will no longer
autodetect or use other drivers unless specified. This helps to prevent
users from using unauthorized smart cards. The default smart card driver for this
Copy link
Contributor

Choose a reason for hiding this comment

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

on the following line, you have also the /etc/opensc-<i>ARCH</i>.conf, which is already fixed in the previous rule. Please, change it also here. I just checked and on normal x86_64 it should work on since RHEL7.

@matejak matejak marked this pull request as ready for review July 15, 2021 10:03
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jul 15, 2021
<i>ARCH</i> is the architecture of your operating system) file. Look for a
line similar to:
To configure the OpenSC driver, edit the <tt>/etc/opensc.conf</tt>.
Look for a line similar to:
<pre># card_drivers = old, internal;</pre>
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, since RHEL 7.7 we ship minimal opensc.conf which does not have these example lines. Even though your remediation scripts still work, the instructions here no longer work. It should probably say "add the following line into the file in the "app default" block so it will look like

app default {
   [...]
   card_drivers = {{{ xccdf_value("var_smartcard_drivers") }}};
}

This is the case also for the other occurrences modifying this file.

The other option might be to use the same steps as in the scripts using opensc-tool --set-conf-entry.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

the architecture of your operating system:
<pre>$ grep card_drivers /etc/opensc-<i>ARCH</i></pre>
as the smart card driver, run the following command:
<pre>$ grep card_drivers /etc/opensc.conf</pre>
The output should return something similar to:
<pre>card_drivers = {{{ xccdf_value("var_smartcard_drivers") }}};</pre>
Copy link
Contributor

Choose a reason for hiding this comment

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

The verification steps might also use the opensc-tool --get-conf-entry to make it less complicated. But that is not mandatory

Copy link
Collaborator

@vojtapolasek vojtapolasek 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 one question, see comment.

@openshift-ci openshift-ci bot added the needs-rebase Used by openshift-ci bot. label Jul 18, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Used by openshift-ci bot. label Jul 27, 2021
@vojtapolasek vojtapolasek self-assigned this Jul 27, 2021
@vojtapolasek
Copy link
Collaborator

/retest

Those rules interact with components on a low-level basis,
so they are likely to work on RHEL9.
SMEs have confirmed that there are no major changes compared to RHEL8,
and have suggested minor description adjustments
not specific to RHEL9.
Those rules are not needed on RHEL9
The locking commands are still supported:
https://www.mankier.com/1/tmux#Options
All configurations are valid even in the latest upstream:
https://chrony.tuxfamily.org/doc/4.1/chrony.conf.html
snmp, grub2, gdm and high-level FIPS mode interface
are mature and can be considered stable by default.
Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

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

I ran ssg test suite on rules which have Fedora in their prodtype. I used Fedora 34. There are 2 rules which are problematic, see comments.
I suggest rather leaving them out now.

Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

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

Merging, found errors have to be solved outside this PR.

@vojtapolasek vojtapolasek merged commit 47a6d0a into ComplianceAsCode:master Jul 27, 2021
@vojtapolasek vojtapolasek added backported-into-stabilization PRs which were cherry-picked during stabilization process. Update Profile Issues or pull requests related to Profiles updates. Update Rule Issues or pull requests related to Rules updates. labels Jul 27, 2021
vojtapolasek added a commit that referenced this pull request Jul 27, 2021
Enable generic rules for RHEL9

(cherry picked from commit 47a6d0a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-into-stabilization PRs which were cherry-picked during stabilization process. RHEL9 Red Hat Enterprise Linux 9 product related. Update Profile Issues or pull requests related to Profiles updates. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants