summaryrefslogtreecommitdiffstats
path: root/recipes-compliance/scap-security-guide/files/0002-scap-security-guide-Add-Poky-support.patch
blob: 1639264136ace95f91d21ae6c3da7249fb7e8751 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From 2be977a60c944a54594d5786b2d8869ed72a9a06 Mon Sep 17 00:00:00 2001
From: Armin Kuster <akuster808@gmail.com>
Date: Wed, 5 Jul 2023 12:57:52 -0400
Subject: [PATCH 2/2] scap-security-guide: Add Poky support

Signed-off-by: Armin Kuster <akuster808@gmail.com>

Upstream-Status: Pending
Waiting to see if OE changes get merged.
Signed-off-by: Armin Kuster <akuster808@gmail.com>


---
 products/openembedded/product.yml           |  6 ++++
 shared/checks/oval/installed_OS_is_poky.xml | 33 +++++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 shared/checks/oval/installed_OS_is_poky.xml

diff --git a/products/openembedded/product.yml b/products/openembedded/product.yml
index debf6870ef..d63479d5d3 100644
--- a/products/openembedded/product.yml
+++ b/products/openembedded/product.yml
@@ -17,3 +17,9 @@ cpes:
       name: "cpe:/o:openembedded:nodistro:"
       title: "OpenEmbedded nodistro"
       check_id: installed_OS_is_openembedded
+
+  - poky:
+      name: "cpe:/o:openembedded:poky:"
+      title: "OpenEmbedded Poky reference distribution"
+      check_id: installed_OS_is_poky
+
diff --git a/shared/checks/oval/installed_OS_is_poky.xml b/shared/checks/oval/installed_OS_is_poky.xml
new file mode 100644
index 0000000000..b8805cf31b
--- /dev/null
+++ b/shared/checks/oval/installed_OS_is_poky.xml
@@ -0,0 +1,33 @@
+<def-group>
+  <definition class="inventory" id="installed_OS_is_poky" version="1">
+    <metadata>
+      <title>Poky</title>
+      <affected family="unix">
+        <platform>multi_platform_all</platform>
+      </affected>
+      <description>The operating system installed is a Poky based System</description>
+    </metadata>
+    <criteria comment="System is Poky based distribution" operator="AND">
+      <extend_definition comment="Installed OS is part of the Unix family" definition_ref="installed_OS_is_part_of_Unix_family" />
+      <criterion comment="Poky based distro" test_ref="test_os_poky" />
+      <criterion comment="Poky based distribution is installed" test_ref="test_poky" />
+    </criteria>
+  </definition>
+
+  <unix:file_test check="all" check_existence="all_exist" comment="/etc/os-release exists" id="test_os_poky" version="1">
+    <unix:object object_ref="obj_os_poky" />
+  </unix:file_test>
+  <unix:file_object comment="check /etc/os-release file" id="obj_os_poky" version="1">
+    <unix:filepath>/etc/os-release</unix:filepath>
+  </unix:file_object>
+
+  <ind:textfilecontent54_test check="all" check_existence="at_least_one_exists" comment="Check OpenEmbedded" id="test_poky" version="1">
+    <ind:object object_ref="obj_poky" />
+  </ind:textfilecontent54_test>
+  <ind:textfilecontent54_object id="obj_poky" version="1" comment="Check Poky">
+    <ind:filepath>/etc/os-release</ind:filepath>
+    <ind:pattern operation="pattern match">^ID=poky$</ind:pattern>
+    <ind:instance datatype="int">1</ind:instance>
+  </ind:textfilecontent54_object>
+
+</def-group>
-- 
2.34.1