Skip to content

Commit

Permalink
Add Kickstart remediation for templated rules
Browse files Browse the repository at this point in the history
This commit will add a Kickstart remediation for these templates:
- package_installed
- package_removed
- service_enabled
- service_disabled
  • Loading branch information
jan-cerny committed Jul 10, 2024
1 parent 4c19d19 commit 32941d8
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/templates/template_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ The only way to remediate is to recompile and reinstall the kernel, so no remedi
state uses operation "greater than or equal" to compare the
collected package version with the version in the OVAL state.

- Languages: Anaconda, Ansible, Bash, OVAL, Puppet, Blueprint
- Languages: Anaconda, Ansible, Bash, OVAL, Puppet, Blueprint, Kickstart

#### package_removed
- Checks if the given package is not installed.
Expand All @@ -577,7 +577,7 @@ The only way to remediate is to recompile and reinstall the kernel, so no remedi

- **pkgname** - name of the RPM or DEB package, eg. `tmux`

- Languages: Anaconda, Ansible, Bash, OVAL, Puppet
- Languages: Anaconda, Ansible, Bash, OVAL, Puppet, Kickstart

#### key_value_pair_in_file
Checks if a given key and value are configured in a file.
Expand Down Expand Up @@ -704,7 +704,7 @@ When the remediation is applied duplicate occurrences of `key` are removed.
If **daemonname** is not specified it means the name of the
daemon is the same as the name of service.

- Languages: Ansible, Bash, OVAL, Puppet, Ignition, Kubernetes, Blueprint
- Languages: Ansible, Bash, OVAL, Puppet, Ignition, Kubernetes, Blueprint, Kickstart

#### service_enabled
- Checks if a system service is enabled. Uses either systemd or SysV
Expand All @@ -723,7 +723,7 @@ When the remediation is applied duplicate occurrences of `key` are removed.
If **daemonname** is not specified it means the name of the
daemon is the same as the name of service.

- Languages: Ansible, Bash, OVAL, Puppet, Blueprint
- Languages: Ansible, Bash, OVAL, Puppet, Blueprint, Kickstart

#### shell_lineinfile
- Checks shell variable assignments in files. Remediations will paste
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ template:
anaconda: "off"
puppet: "off"
blueprint: "off"
kickstart: "off"
7 changes: 7 additions & 0 deletions shared/templates/package_installed/kickstart.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_rhel,multi_platform_fedora
# reboot = false
# strategy = enable
# complexity = low
# disruption = low

package install {{{ PKGNAME }}}
1 change: 1 addition & 0 deletions shared/templates/package_installed/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ supported_languages:
- oval
- puppet
- blueprint
- kickstart
7 changes: 7 additions & 0 deletions shared/templates/package_removed/kickstart.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_rhel,multi_platform_fedora
# reboot = false
# strategy = disable
# complexity = low
# disruption = low

package remove {{{ PKGNAME }}}
1 change: 1 addition & 0 deletions shared/templates/package_removed/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ supported_languages:
- bash
- oval
- puppet
- kickstart
7 changes: 7 additions & 0 deletions shared/templates/service_disabled/kickstart.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_rhel,multi_platform_fedora
# reboot = false
# strategy = disable
# complexity = low
# disruption = low

service disable {{{ DAEMONNAME }}}
1 change: 1 addition & 0 deletions shared/templates/service_disabled/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ supported_languages:
- oval
- puppet
- blueprint
- kickstart
7 changes: 7 additions & 0 deletions shared/templates/service_enabled/kickstart.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_rhel,multi_platform_fedora
# reboot = false
# strategy = disable
# complexity = low
# disruption = low

service enable {{{ DAEMONNAME }}}
1 change: 1 addition & 0 deletions shared/templates/service_enabled/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ supported_languages:
- oval
- puppet
- blueprint
- kickstart

0 comments on commit 32941d8

Please sign in to comment.