69 lines
2.2 KiB
Bash
69 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Run this read-only audit as root." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo '== Host =='
|
|
hostname -f
|
|
grep -E '^(PRETTY_NAME|VERSION_ID)=' /etc/os-release
|
|
nproc
|
|
free -h
|
|
df -h /
|
|
|
|
echo '== Packages and services =='
|
|
dpkg-query -W docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
docker version --format 'Docker Engine {{.Server.Version}}'
|
|
docker compose version
|
|
containerd --version
|
|
runc --version
|
|
systemctl is-active docker
|
|
python3 -c 'import json; d=json.load(open("/etc/docker/daemon.json")); print("Docker logs:", d.get("log-driver"), d.get("log-opts"))'
|
|
|
|
echo '== Account and paths =='
|
|
id codex
|
|
for path in /opt/akyldash /opt/akyldash/current /etc/akyldash /etc/akyldash/production.env /etc/akyldash/review_secret /var/lib/akyldash/data /var/backups/akyldash /usr/local/sbin/akyldash-verify /usr/local/sbin/akyldash-rollback /usr/local/sbin/akyldash-compose /etc/sudoers.d/akyldash-codex; do
|
|
if [[ -e $path ]]; then
|
|
stat -c '%n owner=%U:%G mode=%a type=%F' "$path"
|
|
else
|
|
printf '%s absent\n' "$path"
|
|
fi
|
|
done
|
|
|
|
echo '== ISPmanager =='
|
|
dpkg-query -W -f='${binary:Package} ${Version}\n' 'ispmanager*' 'ispmgr*' 2>/dev/null || true
|
|
systemctl list-unit-files --type=service --no-legend | grep -iE 'ispmanager|ispmgr' || echo 'No ISPmanager service unit found.'
|
|
|
|
echo '== Docker state =='
|
|
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
|
|
docker volume ls
|
|
|
|
echo '== Gitea Actions runner (read-only) =='
|
|
if id akyldash-runner >/dev/null 2>&1; then
|
|
id akyldash-runner
|
|
else
|
|
echo 'akyldash-runner user absent'
|
|
fi
|
|
if command -v act_runner >/dev/null 2>&1; then
|
|
act_runner --version
|
|
else
|
|
echo 'act_runner binary absent from PATH'
|
|
fi
|
|
for path in /etc/akyldash-runner/config.yaml /var/lib/akyldash-runner/.runner /var/lib/akyldash-runner/docker-store.img; do
|
|
if [[ -e $path ]]; then
|
|
stat -c '%n owner=%U:%G mode=%a type=%F' "$path"
|
|
else
|
|
printf '%s absent\n' "$path"
|
|
fi
|
|
done
|
|
systemctl status akyldash-act-runner.service --no-pager --full || true
|
|
systemctl status akyldash-runner-healthcheck.timer --no-pager --full || true
|
|
findmnt /var/lib/akyldash-runner/docker-data || true
|
|
|
|
echo '== Firewall and listeners (read-only) =='
|
|
ufw status verbose
|
|
ufw status numbered
|
|
ss -lntup
|