-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9906 from evgenyz/add_platform_templates_v2
Introduce templated platforms (CPEs)
- Loading branch information
Showing
13 changed files
with
196 additions
and
81 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
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 @@ | ||
name: "cpe:/a:{arg}" | ||
title: "Package {pkgname} is installed" | ||
bash_conditional: {{{ bash_pkg_conditional("{pkgname}") }}} | ||
ansible_conditional: {{{ ansible_pkg_conditional("{pkgname}") }}} | ||
check_id: platform_package_{arg} | ||
template: | ||
name: platform_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="platform_{{{ _RULE_ID }}}" | ||
version="1"> | ||
{{{ oval_metadata("The " + pkg_system|upper + " package " + PKGNAME + " should be installed.", affected_platforms=["multi_platform_all"]) }}} | ||
<criteria> | ||
<criterion comment="Package {{{ PKGNAME }}} is installed" | ||
test_ref="platform_test_{{{ _RULE_ID }}}_installed" /> | ||
</criteria> | ||
</definition> | ||
{{{ oval_test_package_installed(package=PKGNAME, test_id="platform_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
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,10 @@ | ||
name: "cpe:/a:{arg}" | ||
title: "Package {arg} is installed" | ||
title: "Package {pkgname} is installed" | ||
bash_conditional: {{{ bash_pkg_conditional("{pkgname}") }}} | ||
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' |
12 changes: 0 additions & 12 deletions
12
tests/unit/ssg-module/data/templates/package_installed/template.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.