Modified Netdata script

This commit is contained in:
Brian Zalewski 2023-06-01 03:48:22 +00:00
parent c199bdccab
commit ee9d588960
4 changed files with 20 additions and 7 deletions

View file

@ -718,6 +718,7 @@ softwareGroups:
Security: &Security Security: &Security
- bitwarden-cli - bitwarden-cli
- boringtun - boringtun
- debsecan
- envchain - envchain
- envconsul - envconsul
- pony - pony

View file

@ -131,6 +131,16 @@
pull.args = ["--ff-only"] pull.args = ["--ff-only"]
{{- end }} {{- end }}
{{- if (and (lookPath "apt") (lookPath "debsecan")) }}
### Netdata Debsecan
[".local/share/netdata-debsecan"]
type = "git-repo"
url = "https://gitlab.com/nodiscc/netdata-debsecan.git"
refreshPeriod = "{{ $refreshPeriod }}"
clone.args = ["--depth", "1"]
pull.args = ["--ff-only"]
{{- end }}
### Git Template ### Git Template
# [".config/git/template/_/husky.sh"] # [".config/git/template/_/husky.sh"]
# type = "file" # type = "file"

View file

@ -68,26 +68,28 @@ if command -v netdata-claim.sh > /dev/null; then
if command -v apt > /dev/null; then if command -v apt > /dev/null; then
### Configure Netdata to gather information about CVEs in the installed packages ### Configure Netdata to gather information about CVEs in the installed packages
if command -v debsecan > /dev/null; then if command -v debsecan > /dev/null; then
DEBSECAN_GIT="${XDG_DATA_HOME:-$HOME/.local/share}/netdata-debsecan"
# Installing the script to generate report on CVEs in installed packages # Installing the script to generate report on CVEs in installed packages
logg info 'Installing script to generate on CVEs in installed packages' logg info 'Installing script to generate on CVEs in installed packages'
sudo curl -sSL https://raw.githubusercontent.com/nodiscc/netdata-debsecan/master/usr_local_bin_debsecan-by-type -o /usr/local/bin/debsecan-by-type sudo cp -f "$DEBSECAN_GIT/usr_local_bin_debsecan-by-type" /usr/local/bin/debsecan-by-type
# Generate initial debsecan reports in /var/log/debsecan/ # Generate initial debsecan reports in /var/log/debsecan/
logg info 'Generating initial debsecan reports in /var/log/debsecan/' logg info 'Generating initial debsecan reports in /var/log/debsecan/'
/usr/local/bin/debsecan-by-type debsecan-by-type
# Configure dpkg to refresh the file after each run # Configure dpkg to refresh the file after each run
logg info 'Configuring dpkg to refresh the file after each run' logg info 'Configuring dpkg to refresh the file after each run'
sudo curl -sSL https://github.com/nodiscc/netdata-debsecan/raw/master/etc_apt_apt.conf.d_99debsecan -o /etc/apt/apt.conf.d/99debsecan sudo cp -f "$DEBSECAN_GIT/etc_apt_apt.conf.d_99debsecan" /etc/apt/apt.conf.d/99-debsecan
# Add a cron job to refresh the file every hour # Add a cron job to refresh the file every hour
logg info 'Adding a cron job to refresh the file every hour' logg info 'Adding a cron job to refresh the file every hour'
sudo curl -sSL https://github.com/nodiscc/netdata-debsecan/raw/master/etc_cron.d_debsecan -o /etc/cron.d/debsecan sudo cp -f "$DEBSECAN_GIT/etc_cron.d_debsecan" /etc/cron.d/debsecan
# Install the module/configuration file # Install the module/configuration file
logg info 'Installing the module and configuration file logg info 'Installing the module and configuration file
sudo curl -sSL https://github.com/nodiscc/netdata-debsecan/raw/master/debsecan.chart.py -o /usr/libexec/netdata/python.d/ sudo "$DEBSECAN_GIT/debsecan.chart.py" /usr/libexec/netdata/python.d/debsecan.chart.py
sudo curl -sSL https://github.com/nodiscc/netdata-debsecan/raw/master/debsecan.conf -o /etc/netdata/python.d/ sudo "$DEBSECAN_GIT/debsecan.conf" /etc/netdata/python.d/debsecan.conf
# Restart Netdata service # Restart Netdata service
logg info 'Restarting netdata service' logg info 'Restarting netdata service'

View file

@ -1750,7 +1750,7 @@ softwarePackages:
ansible: professormanhattan.debloat ansible: professormanhattan.debloat
_type: cli _type: cli
debsecan: debsecan:
_bin: null _bin: debsecan-by-type
_desc: `debsecan` analyzes the list of installed packages on the current host and reports vulnerabilities found on the system. _desc: `debsecan` analyzes the list of installed packages on the current host and reports vulnerabilities found on the system.
_docs: null _docs: null
_github: null _github: null