-
Notifications
You must be signed in to change notification settings - Fork 1
/
nessus.sh
32 lines (27 loc) · 1.67 KB
/
nessus.sh
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
#!/bin/bash
function config_scanner {
# By default, the NNM Name should be set to the container id.
/opt/nnm/bin/nnm --config "NNM Name" "$(hostname)"
[ -n "${SCANNER_NAME}" ] && /opt/nnm/bin/nnm --config "NNM Name" "${SCANNER_NAME}"
[ -n "${PROXY_HOST}" ] && /opt/nnm/bin/nnm --config "Web Proxy Host" "${PROXY_HOST}"
[ -n "${PROXY_PORT}" ] && /opt/nnm/bin/nnm --config "Web Proxy Port" "${PROXY_PORT}"
[ -n "${PROXY_USER}" ] && /opt/nnm/bin/nnm --config "Web Proxy Username" "${PROXY_USER}"
[ -n "${PROXY_PASS}" ] && /opt/nnm/bin/nnm --config "Web Proxy Password" "${PROXY_PASS}"
[ -n "${PROXY_AGENT}" ] && /opt/nnm/bin/nnm --config "Web Proxy User-Agent" "${PROXY_AGENT}"
[ -n "${MANAGER_HOST}" ] && /opt/nnm/bin/nnm --config "Cloud Host" "${MANAGER_HOST}"
[ -n "${MANAGER_PORT}" ] && /opt/nnm/bin/nnm --config "Cloud Port" "${MANAGER_PORT}"
[ -n "${LINKING_KEY}" ] && /opt/nnm/bin/nnm --config "Cloud Key" "${LINKING_KEY}"
[ -n "${MONITOR_NETWORKS}" ] && /opt/nnm/bin/nnm --config "Monitored Network IP Addresses and Ranges" "${MONITOR_NETWORKS}"
[ -n "${EXCLUDE_NETWORKS}" ] && /opt/nnm/bin/nnm --config "Excluded Network IP Addresses and Ranges" "${EXCLUDE_NETWORKS}"
[ -n "${MONITOR_INTERFACE}" ] && /opt/nnm/bin/nnm --config "Monitored Network Interfaces" "${MONITOR_INTERFACE}"
[ -n "${ADMIN_PASS}" ] && /opt/nnm/bin/nnm --users --chpasswd "admin" "${ADMIN_PASS}"
if [ -n "${LICENSE}" ];then
/opt/nnm/bin/nnm -a "${LICENSE}"
elif [ -n "${LINKING_KEY}" ];then
/opt/nnm/bin/nnm -a "Cloud"
fi
}
if [ "$(/opt/nnm/bin/nnm -k | grep "Not Activated" | wc -l)" == "1" ];then
config_scanner
fi
/opt/nnm/bin/nnm