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

Update ol7 stig references and severity values #5575

Merged
merged 8 commits into from
Apr 16, 2020

Conversation

iokomin
Copy link
Contributor

@iokomin iokomin commented Apr 8, 2020

Description:

This large commit is mostly ol7 stig references and severity update according to DISA OL7 STIG v1r1.
Changes:

  • where differ added ol7 stigid, disa, srg references
  • adjusted severity for ol7 prodtype in rules according to STIG values
  • added ol support to rules configure_firewalld_rate_limiting, sysctl_net_ipv4_tcp_invalid_ratelimit, install_antivirus

Rationale:

DISA OL7 STIG v1r1 released, rules need to be updated to match STIG references and severity.

Testing:

  • checked ol and rhel builds to pass
  • verified generated content to provide expected references and severity values for ol7 stig rules
  • checked introduced severity ol7 conditions didn't break existing values for e.g. rhel7
  • checked added rules to be applicable for ol prodtypes

Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
@openshift-ci-robot
Copy link
Collaborator

Hi @iokomin. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 openshift-ci-robot added the needs-ok-to-test Used by openshift-ci bot. label Apr 8, 2020
@matejak
Copy link
Member

matejak commented Apr 9, 2020

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Apr 9, 2020
Copy link
Member

@matejak matejak left a comment

Choose a reason for hiding this comment

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

I trust you that you know what you are doing with those IDs, so the only thing I comment on are severity overrides.
I think that there is no reason to protect an "unknown" severity, but I feel that severity of a rule is generally context-dependent, and it's best handled in the profile that selects the rule.

@@ -10,14 +10,19 @@ rationale: |-
Removing the <tt>vsftpd</tt> package decreases the risk of its
accidental activation.

severity: low
severity: {{% if product == "ol7" -%}}
Copy link
Member

Choose a reason for hiding this comment

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

Another way how to do things like this is a rule refinement in a profile - for example here: https://github.com/ComplianceAsCode/content/blob/master/rhel8/profiles/ospp.profile#L125 I find refinements preferable, as changing the default severity of the rule may have consequences down the road.

Copy link
Contributor Author

@iokomin iokomin Apr 9, 2020

Choose a reason for hiding this comment

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

@matejak thanks for the hint, makes sense to me. Really, I've seen this adjustment as an example and profile looks like more reasonable place for it. I'll update this PR to move severity refinement to the profile.

Note: Making this change I just followed another existing approach:


Probably it's worth to update places like these as well to avoid confusion and note severity adjustment howto in the Developers Guide (if not done already:))?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matejak I've noticed refined severity taken into account in eval scan results/report only. Generated guide uses rule default value. Is it by design, as it sounds reasonable to see refinements in generated guides as well?

Copy link
Member

Choose a reason for hiding this comment

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

As guides are profile-specific, I would expect them to show the same severity as the scanner does during the scan. In other words, it looks like to be a bug in the scanner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened new issue for tracking: OpenSCAP/openscap#1512

@matejak matejak self-assigned this Apr 9, 2020
medium
{{%- else -%}}
high
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't make this change at all. This severity has to be high.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@redhatrises thanks for your guidance.
I don't mind to have it "high" and was confused by "medium" for this rule as well. However latter is in use in DISAs OL7 STIG v1r1. Do you think this was a mistake on their side and expected to be fixed in the next STIG update?

medium
{{%- else -%}}
unknown
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Always replace unknown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@redhatrises acked, I'll update PR.

Does it make sense to mention it in the Developer Guide?
As not being the rule contributor, change it's default severity value to one from prodtype specific security guide just looks not obvious.

medium
{{%- else -%}}
unknown
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Always replace unknown

medium
{{%- else -%}}
unknown
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Always replace unknown

low
{{%- else -%}}
unknown
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Always replace unknown

medium
{{%- else -%}}
unknown
{{%- endif %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Always replace unknown

Per review severity refinment moved to the profile, unknown severities replaced
with values according to OL7 STIG v1r1.

Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
@redhatrises
Copy link
Contributor

@iokomin both DISA CCIs and SRGs shouldn't be product specific. The should be merged into the top-level SRG and CCI references.

@iokomin
Copy link
Contributor Author

iokomin commented Apr 13, 2020

@redhatrises product specific srg, disa items product specific in places where OL7 ids differ from values in rules now, taking existing rhel6 approach as an example.
Please confirm that I need just to add list of OL7 STIG specific values to the current srg and disa references if they are different?

@redhatrises
Copy link
Contributor

@redhatrises product specific srg, disa items product specific in places where OL7 ids differ from values in rules now, taking existing rhel6 approach as an example.
Please confirm that I need just to add list of OL7 STIG specific values to the current srg and disa references if they are different?

There is actually no such thing as product specific SRGs and CCIs. The rhel6 example is from very old SRGs vs the new SRGs that are in use in operating systems version 7+. They are high-level generic references which is why they can all be merged together. STIGIDs, on the other hand, are product specific.

@redhatrises
Copy link
Contributor

Please confirm that I need just to add list of OL7 STIG specific values to the current srg and disa references if they are different?

Yes..... just adding them (non-duplicates) is fine.

@iokomin
Copy link
Contributor Author

iokomin commented Apr 13, 2020

Ack, I'll make suggested changes and update this request.

Signed-off-by: Ilya Okomin <ilya.okomin@oracle.com>
@iokomin
Copy link
Contributor Author

iokomin commented Apr 15, 2020

@redhatrises please find requested change implemented.

@redhatrises
Copy link
Contributor

@redhatrises please find requested change implemented.

@iokomin looks good to me.

@iokomin
Copy link
Contributor Author

iokomin commented Apr 16, 2020

@redhatrises I noticed "Changes requested" status still enabled. Is there anything else I should work on or this PR can be merged in master?

@redhatrises redhatrises added this to the 0.1.50 milestone Apr 16, 2020
@redhatrises
Copy link
Contributor

It can be merged as is. Thanks!

@redhatrises redhatrises merged commit 6a689c5 into ComplianceAsCode:master Apr 16, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Used by openshift-ci bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants