Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 74cdc86

Browse files
authored
Merge pull request #119 from matusmarhefka/install-image-name
Container image install now also sets image name into /etc/atomic.d/openscap
2 parents aac5ec1 + 51c74b9 commit 74cdc86

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

container/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
ETC='/etc/oscapd'
44
ETC_FILE='config.ini'
55
HOST='/host'
6+
SELF=$1
67

78
echo ""
89
echo "Installing the configuration file 'openscap' into /etc/atomic.d/. You can now use this scanner with atomic scan with the --scanner openscap command-line option. You can also set 'openscap' as the default scanner in /etc/atomic.conf. To list the scanners you have configured for your system, use 'atomic scan --list'."
910

1011
echo ""
1112
cp /root/openscap /host/etc/atomic.d/
13+
sed -i "s|\$IMAGE_NAME|${SELF}|" /host/etc/atomic.d/openscap
1214

1315
SCRIPTS="/etc/atomic.d/scripts/"
1416
echo ""

container/openscap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type: scanner
22
scanner_name: openscap
3-
image_name: openscap
3+
image_name: $IMAGE_NAME
44
default_scan: cve
55
custom_args: ['-v', '/etc/oscapd:/etc/oscapd:ro']
66
remediation_script: '/etc/atomic.d/scripts/remediate.py'

generate-dockerfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
("io.k8s.display-name", "OpenSCAP"),
1313
("io.k8s.description", "OpenSCAP is an auditing tool that utilizes the Extensible Configuration Checklist Description Format (XCCDF). XCCDF is a standard way of expressing checklist content and defines security checklists."),
1414
("io.openshift.tags", "security openscap scan"),
15-
("install", "docker run --rm --privileged -v /:/host/ IMAGE sh /root/install.sh"),
15+
("install", "docker run --rm --privileged -v /:/host/ IMAGE sh /root/install.sh IMAGE"),
1616
("run", "docker run -it --rm -v /:/host/ IMAGE sh /root/run.sh")
1717
]
1818
packages = [

0 commit comments

Comments
 (0)