80 lines
3.4 KiB
Diff
80 lines
3.4 KiB
Diff
From 4e5281b1a0e3cef446ad551e4b36a1f58024140e Mon Sep 17 00:00:00 2001
|
|
From: Josue David Hernandez Gutierrez <josue.d.hernandez@oracle.com>
|
|
Date: Fri, 6 Dec 2024 16:37:44 +0000
|
|
Subject: [PATCH 10/10] Oscap customization for Oracle Linux
|
|
|
|
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez@oracle.com>
|
|
---
|
|
.../images/pkg/customizations/oscap/oscap.go | 14 ++++++++++----
|
|
.../osbuild/images/pkg/distro/rhel/rhel8/distro.go | 2 +-
|
|
.../osbuild/images/pkg/distro/rhel/rhel9/distro.go | 2 +-
|
|
3 files changed, 12 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/customizations/oscap/oscap.go b/vendor/github.com/osbuild/images/pkg/customizations/oscap/oscap.go
|
|
index f9d39c1..73faafe 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/customizations/oscap/oscap.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/customizations/oscap/oscap.go
|
|
@@ -40,6 +40,8 @@ const (
|
|
defaultFedoraDatastream string = "/usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml"
|
|
defaultCentos8Datastream string = "/usr/share/xml/scap/ssg/content/ssg-centos8-ds.xml"
|
|
defaultCentos9Datastream string = "/usr/share/xml/scap/ssg/content/ssg-cs9-ds.xml"
|
|
+ defaultOL8Datastream string = "/usr/share/xml/scap/ssg/content/ssg-ol8-ds.xml"
|
|
+ defaultOL9Datastream string = "/usr/share/xml/scap/ssg/content/ssg-ol9-ds.xml"
|
|
defaultRHEL8Datastream string = "/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml"
|
|
defaultRHEL9Datastream string = "/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml"
|
|
|
|
@@ -125,16 +127,20 @@ func DefaultFedoraDatastream() string {
|
|
return defaultFedoraDatastream
|
|
}
|
|
|
|
-func DefaultRHEL8Datastream(isRHEL bool) string {
|
|
- if isRHEL {
|
|
+func DefaultRHEL8Datastream(name string) string {
|
|
+ if strings.HasPrefix(name, "rhel") {
|
|
return defaultRHEL8Datastream
|
|
+ } else if strings.HasPrefix(name, "ol") {
|
|
+ return defaultOL8Datastream
|
|
}
|
|
return defaultCentos8Datastream
|
|
}
|
|
|
|
-func DefaultRHEL9Datastream(isRHEL bool) string {
|
|
- if isRHEL {
|
|
+func DefaultRHEL9Datastream(name string) string {
|
|
+ if strings.HasPrefix(name, "rhel") {
|
|
return defaultRHEL9Datastream
|
|
+ } else if strings.HasPrefix(name, "ol") {
|
|
+ return defaultOL9Datastream
|
|
}
|
|
return defaultCentos9Datastream
|
|
}
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
index 223eff2..1ea4343 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
@@ -53,7 +53,7 @@ func defaultDistroImageConfig(d *rhel.Distribution) *distro.ImageConfig {
|
|
},
|
|
},
|
|
KernelOptionsBootloader: common.ToPtr(true),
|
|
- DefaultOSCAPDatastream: common.ToPtr(oscap.DefaultRHEL8Datastream(d.IsRHEL())),
|
|
+ DefaultOSCAPDatastream: common.ToPtr(oscap.DefaultRHEL8Datastream(d.Name())),
|
|
}
|
|
}
|
|
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
index c2a2123..1558872 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
@@ -72,7 +72,7 @@ func defaultDistroImageConfig(d *rhel.Distribution) *distro.ImageConfig {
|
|
},
|
|
},
|
|
},
|
|
- DefaultOSCAPDatastream: common.ToPtr(oscap.DefaultRHEL9Datastream(d.IsRHEL())),
|
|
+ DefaultOSCAPDatastream: common.ToPtr(oscap.DefaultRHEL9Datastream(d.Name())),
|
|
}
|
|
}
|
|
|
|
--
|
|
2.43.5
|
|
|