aboutsummaryrefslogtreecommitdiff
blob: 1a48ecf32770629f17864f5a8374ca77a7777c33 (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
location = "dev.gentoo.org:public_html/docs/security_benchmarks"

all: report-gentoo-xccdf.html guide-gentoo-xccdf.html remediate-gentoo-xccdf.sh guide-gentoo-xccdf.docbook report-gentoo-oval.xml gentoo-ds.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-oval --output guide-gentoo-xccdf.html gentoo-xccdf.xml; popd

guide-gentoo-xccdf.docbook: gentoo-cpe.xml gentoo-xccdf.xml gentoo-oval.xml prep
	-pushd ~/tmp; oscap xccdf generate guide --profile xccdf_org.gentoo.dev.swift_profile_default-oval --format docbook --output guide-gentoo-xccdf.docbook 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

upload:
	-pushd ~/tmp; scp gentoo-cpe.xml gentoo-xccdf.xml gentoo-oval.xml gentoo-ds.xml guide-gentoo-xccdf.html report-gentoo-oval.html report-gentoo-xccdf.html $(location)/; popd;

.PHONY: all prep upload