diff options
author | Sven Vermeulen <sven.vermeulen@siphos.be> | 2013-12-20 15:23:48 +0100 |
---|---|---|
committer | Sven Vermeulen <sven.vermeulen@siphos.be> | 2013-12-20 15:23:48 +0100 |
commit | 3de2a55862c4aac01ae2e7e5e858e89104970fa5 (patch) | |
tree | 030efd05927dae5c3d2cece3b06cc968b2883122 | |
parent | Make make.conf a variable (diff) | |
download | hardened-docs-3de2a55862c4aac01ae2e7e5e858e89104970fa5.tar.gz hardened-docs-3de2a55862c4aac01ae2e7e5e858e89104970fa5.tar.bz2 hardened-docs-3de2a55862c4aac01ae2e7e5e858e89104970fa5.zip |
Add test for PORTAGE_GPG_DIR
-rw-r--r-- | xml/SCAP/gentoo-oval.xml | 36 | ||||
-rw-r--r-- | xml/SCAP/gentoo-xccdf.xml | 12 |
2 files changed, 48 insertions, 0 deletions
diff --git a/xml/SCAP/gentoo-oval.xml b/xml/SCAP/gentoo-oval.xml index 7e1a184..5bd0272 100644 --- a/xml/SCAP/gentoo-oval.xml +++ b/xml/SCAP/gentoo-oval.xml @@ -517,6 +517,21 @@ </criteria> </definition> + <definition id="oval:org.gentoo.dev.swift:def:31" version="1" class="compliance"> + <metadata> + <title>In make.conf PORTAGE_GPG_DIR is set</title> + <affected family="unix"> + <platform>Gentoo Linux</platform> + </affected> + <description> + The PORTAGE_GPG_DIR declaration in make.conf has a non-empty value. + </description> + </metadata> + <criteria> + <criterion test_ref="oval:org.gentoo.dev.swift:tst:32" comment="In make.conf PORTAGE_GPG_DIR is non-empty" /> + </criteria> + </definition> + </definitions> <tests> @@ -776,6 +791,15 @@ <ind-def:state state_ref="oval:org.gentoo.dev.swift:ste:11" /> </ind-def:textfilecontent54_test> + <ind-def:textfilecontent54_test id="oval:org.gentoo.dev.swift:tst:32" + version="1" check="at least one" check_existence="all_exist" + comment="Tests that PORTAGE_GPG_DIR is non-empty"> + <!-- PORTAGE_GPG_DIR declaration in make.conf --> + <ind-def:object object_ref="oval:org.gentoo.dev.swift:obj:19" /> + <!-- Match for non-empty value --> + <ind-def:state state_ref="oval:org.gentoo.dev.swift:ste:12" /> + </ind-def:textfilecontent54_test> + </tests> <objects> @@ -882,6 +906,13 @@ <ind-def:instance operation="greater than or equal" datatype="int">1</ind-def:instance> </ind-def:textfilecontent54_object> + <ind-def:textfilecontent54_object id="oval:org.gentoo.dev.swift:obj:19" + version="1" comment="Portage make.conf PORTAGE_GPG_DIR settings"> + <ind-def:filepath var_ref="oval:org.gentoo.dev.swift:var:1" /> + <ind-def:pattern operation="pattern match">^PORTAGE_GPG_DIR="(.*)"</ind-def:pattern> + <ind-def:instance operation="greater than or equal" datatype="int">1</ind-def:instance> + </ind-def:textfilecontent54_object> + </objects> <states> @@ -941,6 +972,11 @@ <ind-def:text datatype="string" operation="pattern match" entity_check="all">( |")webrsync-gpg( |")</ind-def:text> </ind-def:textfilecontent54_state> + <ind-def:textfilecontent54_state id="oval:org.gentoo.dev.swift:ste:12" + version="1" comment="Has a non-empty value"> + <ind-def:subexpression datatype="string" operation="pattern match" entity_check="all">[\S]+</ind-def:subexpression> + </ind-def:textfilecontent54_state> + </states> <variables> diff --git a/xml/SCAP/gentoo-xccdf.xml b/xml/SCAP/gentoo-xccdf.xml index fa9c357..548993c 100644 --- a/xml/SCAP/gentoo-xccdf.xml +++ b/xml/SCAP/gentoo-xccdf.xml @@ -97,6 +97,8 @@ <select idref="xccdf_org.gentoo.dev.swift_rule_USE-ssl" selected="true" /> <!-- Make sure FEATURES=webrsync-gpg is set --> <select idref="xccdf_org.gentoo.dev.swift_rule_FEATURES-webrsync-gpg" selected="true" /> + <!-- Make sure PORTAGE_GPG_DIR is set --> + <select idref="xccdf_org.gentoo.dev.swift_rule_PORTAGE_GPG_DIR-nonempty" selected="true" /> </Profile> <Profile id="xccdf_org.gentoo.dev.swift_profile_default" extends="xccdf_org.gentoo.dev.swift_profile_default-oval"> <title>Default server setup settings</title> @@ -1345,6 +1347,16 @@ SYNC=""</h:pre> <check-content-ref name="oval:org.gentoo.dev.swift:def:30" href="gentoo-oval.xml" /> </check> </Rule> + <Rule id="xccdf_org.gentoo.dev.swift_rule_PORTAGE_GPG_DIR-nonempty" selected="false" severity="low" weight="0.0"> + <title>PORTAGE_GPG_DIR is set</title> + <fixtext fixref="xccdf_org.gentoo.dev.swift_fix_PORTAGE_GPG_DIR-nonempty"> + Edit /etc/portage/make.conf and make sure that PORTAGE_GPG_DIR is set correctly. + </fixtext> + <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5"> + <check-content-ref name="oval:org.gentoo.dev.swift:def:31" href="gentoo-oval.xml" /> + </check> + </Rule> + </Group> </Group> <Group id="xccdf_org.gentoo.dev.swift_group_system-kernel"> |