-
Notifications
You must be signed in to change notification settings - Fork 696
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
Introduce and apply the "partition exists" platform #9204
Introduce and apply the "partition exists" platform #9204
Conversation
Skipping CI for Draft Pull Request. |
Checks using content test filtering fail because of ComplianceAsCode/content-test-filtering#27 |
3c9e4cb
to
e8fb348
Compare
|
||
{{%- macro partition_exists_criterion(path) %}} | ||
{{%- set escaped_path = path | replace("/", "_") %}} | ||
<criterion comment="The path {{{ path }}} is a partition's mount point" test_ref="test_partition_{{{ escaped_path }}}_exists" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<criterion comment="The path {{{ path }}} is a partition's mount point" test_ref="test_partition_{{{ escaped_path }}}_exists" /> | |
<criterion comment="The path {{{ path }}} is a partition's mount point" test_ref="test_partition_{{{ path|escape_id }}}_exists" /> |
There is a special Jinja filter that can create XCCDF-compatible IDs from anything.
It just cries for being templated. But that will come shortly. |
shared/macros/10-oval.jinja
Outdated
id="test_partition_{{{ escaped_path }}}_exists" | ||
version="1"> | ||
<linux:object object_ref="object_partition_{{{ escaped_path }}}_exists" /> | ||
{{#- <linux:partition_state state_ref="" /> #}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
- Improve description of OVAL macro - Use the escape_id filter to produce IDs
e8fb348
to
7b3c9eb
Compare
Code Climate has analyzed commit 7b3c9eb 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 42.7% (0.0% change). View more on Code Climate. |
I think we need @mildas help here. Shared OVALs don't necessary have a connected rule. |
@matejak: The following tests failed, say
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. |
I have used this snippet to verify whether the
and running |
…ar_tmp Patch-name: scap-security-guide-0.1.64-add_platform_partition_exists-PR_9204.patch Patch-status: Introduce and apply the "partition exists" platform
…ar_tmp Patch-name: scap-security-guide-0.1.64-add_platform_partition_exists-PR_9204.patch Patch-status: Introduce and apply the "partition exists" platform
Description:
This PR introduces platforms related to existence of partitions that can be used to extend applicability behaviors.
The new functionality is heavily macro-based, and instantiated for
/tmp
and/var/tmp
partitions.TODO:
Rationale:
If a profile doesn't require separate partitions, but it prescribes mount options if they exist, the applicability approach is the right one.