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

rewrite of SV-204392 #201

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open

rewrite of SV-204392 #201

wants to merge 76 commits into from

Conversation

Amndeep7
Copy link

@Amndeep7 Amndeep7 commented May 21, 2023

resolves #200

takes a very long time but that's cause on my spun up rhel7 docker container it ended up processing 15k-ish files and creating 45k-ish tests. printing out a lot of debugging output that will be changed later. takes a highly variable amount of time depending on what 'rpm --verify' marks as being an issue. changed the inputs around to match the new interpretation of the control and got rid of the exception that we had in there for /etc/issue.

steps to take before merge:

  • Revert the commits where I enabled slow controls (or keep them if we're fine with them being enabled, or use yq to enable them just within the workflows but kept as disabled within the repo)
  • Review to confirm that it better meets the control's stated intentions and suggested check text
  • Rebase on top of the V3R10 branch or have that branch merged into master (and then potentially rebase this one again idk git hard)

Signed-off-by: Amndeep Singh Mann [email protected]

Emily Rodriguez and others added 30 commits April 12, 2023 09:57
…g the delta update, such as adding a ref tag, updating rule id, adding a nist id, or so on, not requiring logic change

Signed-off-by: Emily Rodriguez <[email protected]>
…d describe block updates

Signed-off-by: Emily Rodriguez <[email protected]>
Signed-off-by: Emily Rodriguez <[email protected]>
Signed-off-by: Emily Rodriguez <[email protected]>
Signed-off-by: Shivani Karikar <[email protected]>
Signed-off-by: Shivani Karikar <[email protected]>
ejaronne and others added 10 commits May 12, 2023 15:42
Signed-off-by: Eugene Aronne <[email protected]>
Signed-off-by: Emily Rodriguez <[email protected]>
… spun up rhel7 docker container it ended up processing 15k-ish files and creating 45k-ish tests. printing out a lot of debugging output that will be changed later. changed the inputs around to match the new interpretation of the control and got rid of the exception that we had in there for /etc/issue.

Signed-off-by: Amndeep Singh Mann <[email protected]>
@Amndeep7
Copy link
Author

customresults.json.txt

^ this is a json output from running the new control against a plain old rhel7 docker container

# spin up the image since the container needs to be running to do the magic
docker pull registry.access.redhat.com/rhel7:7.9-1011
docker run -it --rm registry.access.redhat.com/rhel7:7.9-1011

# run inspec (on my wsl box)
time docker run -it --rm -v "$(pwd):/share" -v /var/run/docker.sock:/var/run/docker.sock chef/inspec exec . --target docker://ca407406c83f --reporter=cli json:customresu
lts.json --input-file=kitchen.inputs.yml --chef-license=accept-silent --controls=SV-204392

@Amndeep7 Amndeep7 linked an issue May 21, 2023 that may be closed by this pull request
…l be more false pass/fails cause of the ec2-user stuff but it's whatever

Signed-off-by: Amndeep Singh Mann <[email protected]>
@Amndeep7 Amndeep7 changed the base branch from V3R10 to main May 21, 2023 07:09
@Amndeep7
Copy link
Author

customresults2.json.txt

^ the above but now skipping for any files specified in the packages that don't actually exist on disk for whatever reason.

@Amndeep7 Amndeep7 requested review from em-c-rod and ejaronne May 22, 2023 05:36
@Amndeep7 Amndeep7 marked this pull request as ready for review May 22, 2023 05:36
@Amndeep7 Amndeep7 changed the title rewrite of the control rewrite of the SV-204392 May 22, 2023
@Amndeep7 Amndeep7 changed the title rewrite of the SV-204392 rewrite of SV-204392 May 22, 2023
@Amndeep7
Copy link
Author

Amndeep7 commented May 22, 2023

lol misleading runtime numbers - the subtests did manage to find actual findings tho. I think they were all file permissions/mode issues, and not the owner or group being wrong but I feel like those might come up in a more established box as opposed to the ones we were spinning up for testing that haven't had users exist in them.

image

@em-c-rod em-c-rod changed the base branch from main to V3R10 May 22, 2023 13:16
Copy link

@wdower wdower left a comment

Choose a reason for hiding this comment

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

Talked about this PR as a go-back during standup:
Todo:

  • Reduce the total number of subtests by doing it per package overall and not per assessment type per file.
  • As part of that put the listings of misconfigured files (and presumably the means through which they were misconfigured) in the message body of each subtest.

This a) removes all the positives which we don’t really care about, b) makes it easier to apply the fix text (which fixes it on the package level), and c) hopefully reduces the time-to-test.

@Amndeep7 Amndeep7 self-assigned this May 22, 2023
Base automatically changed from V3R10 to main June 2, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SV-204392 is implemented incorrectly
6 participants