File: oval.template

package info (click to toggle)
scap-security-guide 0.1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 110,644 kB
  • sloc: xml: 241,883; sh: 73,777; python: 32,527; makefile: 27
file content (37 lines) | stat: -rw-r--r-- 2,008 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{% if ARG_NEGATE %}}
{{% set negate_string = "not " %}}
{{%- else %}}
{{% set negate_string = "" %}}
{{%- endif %}}
{{% if ARG_VALUE %}}
{{% set name_value = ARG_NAME + "=" + ARG_VALUE %}}
{{%- else %}}
{{% set name_value = ARG_NAME %}}
{{%- endif %}}
<def-group>
  <definition class="compliance" id="{{{ _RULE_ID }}}" version="2">
    {{{ oval_metadata("Ensure " + name_value +" argument is " + negate_string + "present in the 'options' line of /boot/loader/entries/ostree-2-*.conf (or ostree-1-*.conf if there is no ostree-2-*.conf as ostree has only two enries at the most, with *-2-*.conf entry always being the most recent). Also, ensure that kernel is currently running with this argument by checking /proc/cmdline.") }}}
    <criteria operator="AND">
      <criteria operator="OR">
        <criteria operator="AND">
            {{{- oval_file_absent_criterion('/boot/loader/entries/ostree-2.*.conf')}}}
            {{{- oval_argument_value_in_line_criterion('/boot/loader/entries/ostree-1.*.conf', ARG_NAME, ARG_VALUE, 'Linux kernel', negate=ARG_NEGATE) }}}
        </criteria>
        <criteria operator="AND">
            {{{- oval_argument_value_in_line_criterion('/boot/loader/entries/ostree-2.*.conf', ARG_NAME, ARG_VALUE, 'Linux kernel', negate=ARG_NEGATE) }}}
        </criteria>
      </criteria>
      <criteria operator="AND">
        {{{- oval_argument_value_in_line_criterion('/proc/cmdline', ARG_NAME, ARG_VALUE, 'Linux kernel', negate=ARG_NEGATE) }}}
      </criteria>
    </criteria>
  </definition>

  {{{- oval_file_absent('/boot/loader/entries/ostree-2.*.conf') }}}
  {{{-
  oval_argument_value_in_line_test('/boot/loader/entries/ostree-1.*.conf', ARG_NAME, ARG_VALUE, 'options ', is_regex=ARG_IS_REGEX) }}}

  {{{- oval_argument_value_in_line_test('/boot/loader/entries/ostree-2.*.conf', ARG_NAME, ARG_VALUE, 'options ', is_regex=ARG_IS_REGEX) }}}

  {{{- oval_argument_value_in_line_test('/proc/cmdline', ARG_NAME, ARG_VALUE, 'BOOT_IMAGE', is_regex=ARG_IS_REGEX) }}}
</def-group>