content icon indicating copy to clipboard operation
content copied to clipboard

Update sysctl template's OVAL and tests to align with STIG

Open Xeicker opened this issue 3 years ago • 4 comments

Description:

  • Update OVAL to allow multiple static values, but ensure all of them are valid
  • Update tests to validate new behavior
  • The code to generate SYSCTL_WRONG_VALUE was updated since the tests were having an issue when setting the runtime value. Apparently the previous way of obtaining that value was generating invalid confs

Rationale:

  • The condition to only accept one configuration was introduced here: https://github.com/ComplianceAsCode/content/pull/8656 as a STIG alignment. But now the STIG requirement has been updated from

If results are returned from more than one file location, this is a finding.

to

If conflicting results are returned, this is a finding.

Xeicker avatar Sep 01 '22 18:09 Xeicker

Hello @Xeicker! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 40:72: E228 missing whitespace around modulo operator

pep8speaks avatar Sep 01 '22 18:09 pep8speaks

Hi @Xeicker. 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[bot] avatar Sep 01 '22 18:09 openshift-ci[bot]

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment Open in Gitpod

Oracle Linux 8 Environment Open in Gitpod

github-actions[bot] avatar Sep 01 '22 18:09 github-actions[bot]

@Xeicker Thank you for the update, could you address the issue pointed out by CodeClimate? Missing whitespace around modulo operator

yuumasato avatar Oct 04 '22 14:10 yuumasato

I don't know what is going on with the CI, it is complaining that two rules have the same CCE, but they have completely unrelated CCEs.

 44/164 Test  #44: unique-cces .........................................................***Failed    0.37 sec

cce CCE-91667-6 is included in files: 
 - linux_os/guide/services/cron_and_at/file_permissions_crontab/rule.yml
 - linux_os/guide/services/cron_and_at/service_cron_enabled/rule.yml

Does anybody from @ComplianceAsCode/red-hatters have any idea what is going on?

yuumasato avatar Oct 05 '22 13:10 yuumasato

I don't know what is going on with the CI, it is complaining that two rules have the same CCE, but they have completely unrelated CCEs.

 44/164 Test  #44: unique-cces .........................................................***Failed    0.37 sec

cce CCE-91667-6 is included in files: 
 - linux_os/guide/services/cron_and_at/file_permissions_crontab/rule.yml
 - linux_os/guide/services/cron_and_at/service_cron_enabled/rule.yml

Does anybody from @ComplianceAsCode/red-hatters have any idea what is going on?

That should be fixed by #9622.

Mab879 avatar Oct 05 '22 14:10 Mab879

@Mab879 So does @Xeicker need to rebase latest master?

yuumasato avatar Oct 05 '22 14:10 yuumasato

@Mab879 So does @Xeicker need to rebase latest master?

Yes

Mab879 avatar Oct 05 '22 14:10 Mab879

There was a github outage yesterday and that's probably why the github checks have not started. https://www.githubstatus.com/history

@Xeicker can you please amend the last commit message and force push so it can trigger the required jobs?

Thank you.

ggbecker avatar Oct 06 '22 09:10 ggbecker

Code Climate has analyzed commit e33aaaab and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 40.8% (0.0% change).

View more on Code Climate.

codeclimate[bot] avatar Oct 06 '22 15:10 codeclimate[bot]