Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Harden sshd crypto policy #4663

Merged

Conversation

vojtapolasek
Copy link
Collaborator

@vojtapolasek vojtapolasek commented Jul 29, 2019

Description:

Added a new rule to harden SSHD by applying stricter crypto policy.

Rationale:

Athering to the CC requirements, based on Kickstart file.

@openscap-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@yuumasato
Copy link
Member

@openscap-ci add to whitelist

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.

Please, look into adding test scenarios;

Add the OCIL clause and question;
This can serve as inspiration.
The ocil_clause should be the continuation of the question:
Is it the case that....?

And make sure the files have a newline at the end.

@vojtapolasek vojtapolasek force-pushed the harden_sshd_crypto_policy branch from c004e95 to 7408d49 Compare July 30, 2019 12:44
@matejak
Copy link
Member

matejak commented Aug 1, 2019

test this please

@vojtapolasek vojtapolasek requested a review from yuumasato August 1, 2019 15:01
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.

@vojtapolasek Thank you for the updates.
Just a few more fixes to the rule text, and it should be good to go.

@yuumasato yuumasato self-assigned this Aug 2, 2019
@yuumasato yuumasato added this to the 0.1.46 milestone Aug 2, 2019
@yuumasato
Copy link
Member

@vojtapolasek Thank you!

@ggbecker
Copy link
Member

ggbecker commented Aug 9, 2019

Customizing the crypto policy file for opensshserver will require changes in our enable_fips_mode OVAL check as it tests the file if it is a symlink to the default file as you can see here:

https://github.com/ComplianceAsCode/content/blob/master/linux_os/guide/system/software/integrity/fips/enable_fips_mode/oval/shared.xml#L16
https://github.com/ComplianceAsCode/content/blob/master/linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/oval/shared.xml#L59

Otherwise the enable_fips_mode rule will always fail when this new rule is selected.

@yuumasato what do you think about this?

@adelton
Copy link
Contributor

adelton commented Aug 9, 2019

@ggbecker, yes, you are right.

@yuumasato
Copy link
Member

Customizing the crypto policy file for opensshserver will require changes in our enable_fips_mode OVAL check as it tests the file if it is a symlink to the default file as you can see here:

Yes, customization of crypto policies fails the check for those symlinks in configure_crypto_policy.

We can consider dropping all the symlink checks, not being symlinked to a back-end policy does not imply malicious tampering of the policy.

@adelton
Copy link
Contributor

adelton commented Aug 12, 2019

Alternatively, the check could be for the symlink, or the drop-in snippet file we know we support.

@vojtapolasek
Copy link
Collaborator Author

@adelton I agree with this, I find is as the safest option. However, in this case we need to track somewhere what policies we modify. Just saying.

@yuumasato
Copy link
Member

the drop-in snippet file we know we support

How will the rule know that what is in the drop-in snippet is OK?
This seems out of scope of what configure_crypto_policy should be doing.

If a rule adds a drop-in replacement for a back-end, shouldn't that rule check it?

@adelton
Copy link
Contributor

adelton commented Aug 14, 2019

How will the rule know that what is in the drop-in snippet is OK?

It won't. But it will know that the snippet is allowed, and thus the check for the symlink does not make sense.

This seems out of scope of what configure_crypto_policy should be doing.

If a rule adds a drop-in replacement for a back-end, shouldn't that rule check it?

Well, it does, functionally. The harden_sshd_crypto_policy rule checks if the result in /etc/crypto-policies/back-ends/opensshserver.config (be it symlink or file) has the content it expects. So it checks the ultimate result that the sshd will use.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants