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

Ensure Root Path Integrity #3

Closed
georgenalen opened this issue Sep 17, 2020 · 3 comments
Closed

Ensure Root Path Integrity #3

georgenalen opened this issue Sep 17, 2020 · 3 comments
Assignees

Comments

@georgenalen
Copy link
Contributor

Control 6.2.3 - Ensure root PATH Integrity

We need to figure out the jinja2 filter to use. I pull the paths from $PATH. The control wants all of those paths to exist so I do a stat on them. Which creates a multi dictionary. I can have it do what I need but I want to message out the list of paths that don’t exist. I can get it to list the “exists” value or the “item” value with the map(attribute) however I can’t list the “item” value if “exists” is false. This is the gist of what I’m trying to do {{ ubtu18cis_6_2_7_path_stat.results | selectattr('stat.exists','equalto','false') | map(attribute='item') | list }}". Item is the path even if the file doesn’t exist and is in ubtu18cis_6_2_7_path_stat.results.item in the tree and the exists is in ubtu18cis_6_2_7_path_stat.results.stat.exists of the tree. With that I’m trying to just get the dictionary items where exists is false and list the item value. Hopefully that makes sense, I’ve done that before with single dictionary things but I can’t figure out with the multiple dict stuff.

@uk-bolly uk-bolly self-assigned this Feb 21, 2023
@uk-bolly
Copy link
Member

Added to Feb23_updated

uk-bolly added a commit that referenced this issue Feb 22, 2023
updated control

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
@uk-bolly uk-bolly mentioned this issue Feb 23, 2023
@uk-bolly
Copy link
Member

uk-bolly commented Mar 3, 2023

hi @georgenalen

Thank you again for raising this issue. This has now been merged into the devel branch. Aiming to put this into main if all is well in the next couple of weeks.

many thanks again

uk-bolly

@MrSteve81
Copy link
Contributor

This was added to PR #74 that addressed a lot of fixes. This has been merged to main. Thanks @georgenalen for the find.

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

No branches or pull requests

3 participants