aboutsummaryrefslogtreecommitdiff
blob: ad08a66a5aa84263a1faa574acb025b1de3e4cda (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
gentoo: report-gentoo-xccdf.html guide-gentoo-xccdf.html remediate-gentoo-xccdf.sh gentoo-ds.xml

all_gentoo: gentoo report-gentoo-oval.xml

report-gentoo-xccdf.html: gentoo-cpe.xml gentoo-xccdf.xml gentoo-oval.xml prep
	-pushd ~/tmp; oscap xccdf eval --cpe gentoo-cpe.xml --profile xccdf_org.gentoo.dev.swift_profile_default-oval --results results-gentoo-xccdf.xml --oval-results --check-engine-results --report report-gentoo-xccdf.html gentoo-xccdf.xml; popd

guide-gentoo-xccdf.html: gentoo-cpe.xml gentoo-xccdf.xml gentoo-oval.xml prep
	-pushd ~/tmp; oscap xccdf generate guide --profile xccdf_org.gentoo.dev.swift_profile_default --output guide-gentoo-xccdf.html gentoo-xccdf.xml; popd

remediate-gentoo-xccdf.sh: prep
	-pushd ~/tmp; oscap xccdf generate fix --output remediate-gentoo-xccdf.sh results-gentoo-xccdf.xml chmod 0644 remediate-gentoo-xccdf.sh; popd

gentoo-ds.xml: prep
	-pushd ~/tmp; oscap ds sds-compose gentoo-xccdf.xml gentoo-ds.xml; popd
	-pushd ~/tmp; oscap ds sds-add gentoo-cpe.xml gentoo-ds.xml; popd

report-gentoo-oval.xml: prep
	-pushd ~/tmp; oscap oval eval --report report-gentoo-oval.html --results results-gentoo-oval.xml gentoo-oval.xml; popd

prep:
	-cp gentoo-cpe.xml ~/tmp
	-cp gentoo-xccdf.xml ~/tmp
	-cp gentoo-oval.xml ~/tmp
	-cp -R bin/ ~/tmp/
	-cp ~/tmp/gentoo-oval.xml ~/tmp/cpe-oval.xml
	-sed -i 's|gentoo-oval.xml|cpe-oval.xml|g' ~/tmp/gentoo-cpe.xml
	-sed -i "s|@@VERSION@@|`date +%Y%m%d`|g" ~/tmp/gentoo-xccdf.xml
	-sed -i "s|@@DATE@@|`date +%Y-%m-%d`|g" ~/tmp/gentoo-xccdf.xml

.PHONY: gentoo prep all_gentoo