-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
97 lines (69 loc) · 2.87 KB
/
Makefile
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
ifndef GITHUB_REPOSITORY_OWNER
GITHUB_REPOSITORY_OWNER := greenbone
endif
RSYNC := rsync -ltvrP --delete --exclude private/ --perms --chmod=Fugo+r,Fug+w,Dugo-s,Dugo+rx,Dug+w
RSYNC_BASE := rsync://feed.community.greenbone.net:
VERSION := 22.04
NASL_TARGET_DEFAULT := /var/lib/openvas/plugins
nasl_target := ${INSTALL_PREFIX}${NASL_TARGET_DEFAULT}
NOTUS_TARGET_DEFAULT := /var/lib/notus
notus_target := ${INSTALL_PREFIX}${NOTUS_TARGET_DEFAULT}
SC_TARGET_DEFAULT := /var/lib/gvm/data-objects/gvmd/22.04/scan-configs
sc_target := ${INSTALL_PREFIX}${SC_TARGET_DEFAULT}
all: deploy download-tests wait-for-openvas run-tests delete
check-feed-dirs:
@ [ -d ${nasl_target} ] || (printf "\e[31m${nasl_target} missing\e[0m\n" && false)
@ [ -d ${notus_target} ] || (printf "\e[31m${notus_target} missing\e[0m\n" && false)
@ [ -d ${sc_target} ] || (printf "\e[31m${sc_target} missing\e[0m\n" && false)
@ test -w ${nasl_target} || (printf "\e[31m${USER} cannot write into ${nasl_target}\e[0m\n" && false)
@ test -w ${notus_target} || (printf "\e[31m${USER} cannot write into ${notus_target}\e[0m\n" && false)
@ test -w ${sc_target} || (printf "\e[31m${USER} cannot write into ${sc_target}\e[0m\n" && false)
update-local-feed: check-feed-dirs
${RSYNC} ${RSYNC_BASE}/community/vulnerability-feed/${VERSION}/vt-data/nasl/ ${nasl_target}
${RSYNC} ${RSYNC_BASE}/community/vulnerability-feed/${VERSION}/vt-data/notus/ ${notus_target}
${RSYNC} ${RSYNC_BASE}/community/data-feed/${VERSION}/scan-configs/ ${sc_target}
deploy-openvas:
kubectl apply -f openvas-deployment.yaml
deploy-victim:
kubectl apply -f victim-deployment.yaml
deploy-slsw:
kubectl apply -f slsw-deployment.yaml
deploy-slackware:
kubectl apply -f slackware-deployment.yaml
deploy: deploy-openvas deploy-victim deploy-slackware
delete-openvas:
kubectl delete deployment/openvas
delete-victim:
kubectl delete deployment/victim
delete-slsw:
kubectl delete deployment/slsw
delete-slackware:
kubectl delete deployment/slackware
delete: delete-openvas delete-victim delete-slackware
update-openvas:
kubectl rollout restart deployment/openvas
update-victim:
kubectl rollout restart deployment/victim
update-slsw:
kubectl rollout restart deployment/slsw
update-slackware:
kubectl rollout restart deployment/slackware
update: update-openvas update-victim update-slackware update-slsw
wait-for-openvas:
sh wait-for-openvas.sh
prepare-release:
cd feature-tests && make build-cmds
mkdir -p release
cp feature-tests/bin/* release/
build:
$(MAKE) -C slsw build
$(MAKE) -C slackware build
download-tests:
rm -rf bin && mkdir bin
cd bin && curl -qH "Accept: application/vnd.github+json" https://api.github.com/repos/greenbone/scanner-lab/releases | jq -r ".[0] .assets[] .browser_download_url"| xargs -I {} curl -LOJ "{}"
chmod +x bin/run-feature-tests
run-tests:
bin/run-feature-tests
push:
$(MAKE) -C slsw push
$(MAKE) -C slackware push