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

CIS Profiles for SLE12 #7434

Merged
merged 10 commits into from
Sep 10, 2021
Merged

CIS Profiles for SLE12 #7434

merged 10 commits into from
Sep 10, 2021

Conversation

truzzon
Copy link
Contributor

@truzzon truzzon commented Aug 20, 2021

Description:

  • Initial CIS Profiles for SLE12. Based on Benchmark Version 3.0.0 (released at 2021-04-27)
  • Minor updates to SLE15 Chapter reference, If I found them during work.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Aug 20, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 20, 2021

Hi @truzzon. 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.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution. I left few notes on this PR, mostly around prodtype ordering. Also please make sure that you have cce on the rules as well.

@Mab879
Copy link
Member

Mab879 commented Aug 20, 2021

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Aug 20, 2021
@Mab879 Mab879 added SLES SUSE Linux Enterprise Server product related. New Profile Issues or pull requests related to new Profiles. labels Aug 20, 2021
@truzzon
Copy link
Contributor Author

truzzon commented Aug 21, 2021

Hello @Mab879, thanks for your feedback. I'll fix what I can in the next days.

About the CCE reference for SLE: there are none in the Nist resources.
@brett060102 and @guangyee since your profiles say SUSE, can you provide a CCE resource, where I can look up the missing references, if publicly available? I also have an SCC account, if required.

@truzzon
Copy link
Contributor Author

truzzon commented Aug 31, 2021

Hello @Mab879,

I have contacted @teacup-on-rockingchair via e-mail and asked him, if he could help me out with the CCEs, since he is the only one in the recent commit history, who added CCEs for SLE.
He responded, that he can't disclose the source. I'm currently waiting for any information, he can provide, or maybe a PR, that adds the CCEs to my changes.

In case, the references are incomplete or nothing can be provided, is it still possible to merge the PR? After all, the build is working. And on my past PR CCEs were not required at all for SLE.

@openshift-ci openshift-ci bot added the needs-rebase Used by openshift-ci bot. label Sep 5, 2021
@Mab879
Copy link
Member

Mab879 commented Sep 7, 2021

@truzzon Thanks for the update. Please rebase this PR and I will take a look again and get it merged.

@Mab879 Mab879 self-assigned this Sep 7, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Used by openshift-ci bot. label Sep 8, 2021
@Mab879 Mab879 added Highlight This PR/Issue should make it to the featured changelog. New Profile Issues or pull requests related to new Profiles. and removed New Profile Issues or pull requests related to new Profiles. labels Sep 9, 2021
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Please run ./utils/fix_rules.py sort_prodtypes to fix the prodtype ordering issues.
See https://complianceascode.readthedocs.io/en/latest/manual/developer/05_tools_and_utilities.html for more information on running the utilities.

@truzzon
Copy link
Contributor Author

truzzon commented Sep 10, 2021

Hello @Mab879,

I fixed your findings manually. The scripts did not work for me yet:

(content_3.9.6) nico@tower-nico: content [cis_sle12_v300]$ ./utils/rule_dir_json.py 
Product sle12 has multiple remediations of the same type in rule no_empty_passwords: shared.sh,shared.yml,sle12.yml,sle15.yml
Product sle15 has multiple remediations of the same type in rule no_empty_passwords: shared.sh,shared.yml,sle12.yml,sle15.yml
Product sle12 has multiple remediations of the same type in rule accounts_tmout: shared.sh,sle12.sh,sle12.yml,sle15.yml
Product sle15 has multiple remediations of the same type in rule accounts_tmout: shared.sh,sle12.sh,sle12.yml,sle15.yml
Product sle12 has multiple remediations of the same type in rule audit_rules_privileged_commands_kmod: sle12.yml,sle15.yml
Product sle15 has multiple remediations of the same type in rule audit_rules_privileged_commands_kmod: sle12.yml,sle15.yml
Traceback (most recent call last):
  File "/home/nico/git/content/./utils/rule_dir_json.py", line 232, in <module>
    main()
  File "/home/nico/git/content/./utils/rule_dir_json.py", line 192, in main
    rule_obj['ovals'], oval_products = handle_ovals(given_products, product_yamls, rule_obj)
  File "/home/nico/git/content/./utils/rule_dir_json.py", line 120, in handle_ovals
    platforms = ssg.oval.applicable_platforms(oval_path)
  File "/home/nico/git/content/ssg/oval.py", line 123, in applicable_platforms
    body = process_file_with_macros(oval_file, subst_dict)
  File "/home/nico/git/content/ssg/jinja.py", line 184, in process_file_with_macros
    return process_file(filepath, substitutions_dict)
  File "/home/nico/git/content/ssg/jinja.py", line 136, in process_file
    return template.render(substitutions_dict)
  File "/home/nico/.pyenv/versions/3.9.6/envs/content_3.9.6/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/home/nico/.pyenv/versions/3.9.6/envs/content_3.9.6/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/nico/git/content/linux_os/guide/system/software/integrity/software-integrity/aide/aide_check_audit_tools/oval/shared.xml", line 11, in top-level template code
    {{% if 'rhel' not in product %}}
jinja2.exceptions.UndefinedError: 'product' is undefined

The prerequisites fail. What do I do in these cases?
For every project I am working on I use a separate pyenv environment.

@Mab879
Copy link
Member

Mab879 commented Sep 10, 2021

/test e2e-aws-rhcos4-moderate

@Mab879
Copy link
Member

Mab879 commented Sep 10, 2021

@truzzon I have fixed a couple more as well.

What OS are using for this? I'm not reproduce on Fedora 34 with Python 3.9.6.

@truzzon
Copy link
Contributor Author

truzzon commented Sep 10, 2021

I am working on Mint 20.2.

I'll keep that tool in mind, when I start to work on sle15 again. I haven't had the time to debug it today.

@Mab879 Mab879 merged commit 45848e1 into ComplianceAsCode:master Sep 10, 2021
@Mab879
Copy link
Member

Mab879 commented Sep 10, 2021

Thank you @truzzon!

@truzzon truzzon deleted the cis_sle12_v300 branch September 10, 2021 19:15
@Mab879 Mab879 added this to the 0.1.58 milestone Sep 10, 2021
@yuumasato yuumasato added New Profile Issues or pull requests related to new Profiles. and removed New Profile Issues or pull requests related to new Profiles. labels Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highlight This PR/Issue should make it to the featured changelog. New Profile Issues or pull requests related to new Profiles. ok-to-test Used by openshift-ci bot. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants