content icon indicating copy to clipboard operation
content copied to clipboard

Add templates to handle detection of most Firefox Policy STIG items. (WIP)

Open lenox-joseph opened this issue 2 years ago • 30 comments

Description:

Implement detection OVAL and remediation scripts to cover several manual STIGs for Mozilla Firefox's administrative policy.

Rationale:

Firefox uses a more complex JSON structure than Chromium does (at least for currently implemented items), and I'd like to be able to extend automagical remediations to cover the manual DISA STIG (especially as the automatic upstream SCAP benchmark has gone poof).

lenox-joseph avatar Feb 25 '22 01:02 lenox-joseph

Hi @lenox-joseph. 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 Feb 25 '22 01:02 openshift-ci[bot]

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

Open in Gitpod

github-actions[bot] avatar Feb 25 '22 01:02 github-actions[bot]

Hello @lenox-joseph! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-06-08 22:19:02 UTC

pep8speaks avatar Feb 25 '22 02:02 pep8speaks

Failure is because the test system is trying to find the rules in the wrong prodtype, no idea how to address this in the build system.

lenox-joseph avatar Feb 25 '22 16:02 lenox-joseph

/ok-to-test

Mab879 avatar Feb 25 '22 21:02 Mab879

@Mab879 @ggbecker any availability to do a review?

lenox-joseph avatar Mar 02 '22 15:03 lenox-joseph

Title Set Firefox Configuration File Location Rule xccdf_org.ssgproject.content_rule_firefox_preferences-lock_settings_config_file Result error

Title Disable Firefox Configuration File ROT-13 Encoding Rule xccdf_org.ssgproject.content_rule_firefox_preferences-lock_settings_obscure Result error

I didn't touch anything anywhere near these rules (both are self-contained), so I have no idea what could have broken on your test system.

lenox-joseph avatar Mar 03 '22 02:03 lenox-joseph

Thank you for the review @Mab879

lenox-joseph avatar Mar 03 '22 02:03 lenox-joseph

/retest

lenox-joseph avatar Mar 03 '22 18:03 lenox-joseph

@Mab879 should be good to look at again. I didn't realize that someone had extended the diff system to allow testing of the firefox datastream now.

lenox-joseph avatar Mar 04 '22 20:03 lenox-joseph

/retest

lenox-joseph avatar Mar 07 '22 20:03 lenox-joseph

@Mab879 I'd also like to get this into remediation sets for work, although I understand if there's extra trepidation at adding these remediations (at this point I don't think it's feasible to add Ansible remediations without writing up a module to go with it).

lenox-joseph avatar Mar 07 '22 20:03 lenox-joseph

This failure seems like something in master as I don't have any Kubernetes remediations in this PR, especially since there weren't any failures before I rebased.

lenox-joseph avatar Mar 07 '22 22:03 lenox-joseph

/retest

lenox-joseph avatar Mar 08 '22 01:03 lenox-joseph

/retest

lenox-joseph avatar Mar 21 '22 15:03 lenox-joseph

/retest

lenox-joseph avatar Mar 21 '22 19:03 lenox-joseph

/retest

lenox-joseph avatar Mar 24 '22 00:03 lenox-joseph

/retest

lenox-joseph avatar Mar 29 '22 17:03 lenox-joseph

The content looks good.

@matejak can you take a look the remediation script?

Mab879 avatar Mar 29 '22 20:03 Mab879

/retest

matejak avatar May 04 '22 15:05 matejak

@matejak those failed tests look like something in the baseline as I don't have any Kubernetes remediation implemented.

lenox-joseph avatar May 05 '22 18:05 lenox-joseph

/retest

lenox-joseph avatar May 05 '22 18:05 lenox-joseph

@matejak FYI, new commits are because there were some revisions from the upstream DISA changes.

lenox-joseph avatar May 05 '22 20:05 lenox-joseph

/retest

lenox-joseph avatar May 10 '22 19:05 lenox-joseph

(moved to the correct conversation)

lenox-joseph avatar May 13 '22 15:05 lenox-joseph

The PR touches multiple aspects of the template and test capabilities of the project, so please be patient - it will take a few more iterations to get everything through.

matejak avatar May 17 '22 15:05 matejak

Rebase because some of the test hacks I was using that are unique to my dev environment were accidentally leaked into the branch.

lenox-joseph avatar May 17 '22 17:05 lenox-joseph

Code Climate has analyzed commit b66c5b6c 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 26.1% (0.0% change).

View more on Code Climate.

codeclimate[bot] avatar Jun 08 '22 22:06 codeclimate[bot]

@lenox-joseph: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-rhcos4-e8 b66c5b6c4cb8bd2a93c85745da86b8a008b24541 link true /test e2e-aws-rhcos4-e8
ci/prow/e2e-aws-rhcos4-moderate b66c5b6c4cb8bd2a93c85745da86b8a008b24541 link true /test e2e-aws-rhcos4-moderate
ci/prow/e2e-aws-rhcos4-high b66c5b6c4cb8bd2a93c85745da86b8a008b24541 link true /test e2e-aws-rhcos4-high
ci/prow/e2e-aws-ocp4-stig-node b66c5b6c4cb8bd2a93c85745da86b8a008b24541 link true /test e2e-aws-ocp4-stig-node

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

openshift-ci[bot] avatar Jun 21 '22 20:06 openshift-ci[bot]

@lenox-joseph: PR needs rebase.

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 Jul 09 '22 03:07 openshift-ci[bot]