-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CPE AL: Introduce templated platforms (CPEs)
Add the 'package' CPE and 'cond_package' template for it. Add platforms support to the templates.Builder.
- Loading branch information
Showing
10 changed files
with
113 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: "cpe:/a:{arg}" | ||
title: "Package {arg} is installed" | ||
check_id: cond_package_{arg} | ||
template: | ||
name: cond_package | ||
args: | ||
ntp: | ||
pkgname: ntp | ||
title: NTP daemon and utilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<def-group> | ||
<definition class="inventory" id="cond_{{{ _RULE_ID }}}" | ||
version="1"> | ||
{{{ oval_metadata("The " + pkg_system|upper + " package " + PKGNAME + " should be installed.", affected_platforms=["multi_platform_all"]) }}} | ||
<criteria> | ||
<criterion comment="Conditional package {{{ PKGNAME }}} is installed" | ||
test_ref="cond_test_{{{ _RULE_ID }}}_installed" /> | ||
</criteria> | ||
</definition> | ||
{{{ oval_test_package_installed(package=PKGNAME, test_id="cond_test_" + _RULE_ID + "_installed") }}} | ||
</def-group> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
supported_languages: | ||
- oval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
name: "cpe:/a:{arg}" | ||
title: "Package {arg} is installed" | ||
check_id: installed_env_has_{arg}_package | ||
template: | ||
name: package_installed | ||
args: | ||
ntp: | ||
pkgname: ntp | ||
title: NTP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: package_ntp | ||
original_expression: package[ntp] | ||
xml_content: <ns0:platform xmlns:ns0="http://cpe.mitre.org/language/2.0" id="package_ntp"><ns0:logical-test | ||
operator="AND" negate="false"><ns0:fact-ref name="cpe:/a:ntp" /></ns0:logical-test></ns0:platform> | ||
bash_conditional: ( ( rpm --quiet -q ntp ) ) | ||
ansible_conditional: ( ( "ntp" in ansible_facts.packages ) ) | ||
definition_location: '' | ||
documentation_complete: true | ||
title: 'NTP Package' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters