mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-12-01 17:24:48 +00:00
ops: JSON access log for every Caddy site (feeds threatcrushd) (#181)
The homepage-symlink breach left no record of which files were fetched, because no site logged requests. Every site now imports one shared, rolled JSON log at /var/log/caddy/access.log, which threatcrushd's log-watcher tails for scanners, brute force and path probing. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
537d96d5a8
commit
9a7b2d0df6
1 changed files with 24 additions and 0 deletions
24
setup.sh
24
setup.sh
|
|
@ -847,6 +847,7 @@ if [ "$FORGEJO" = "1" ]; then
|
|||
GIT_SITE="
|
||||
${GIT_DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
reverse_proxy http://${FORGEJO_HTTP_ADDR}
|
||||
}
|
||||
"
|
||||
|
|
@ -865,6 +866,7 @@ news.${DOMAIN} {
|
|||
on_demand
|
||||
}
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
header Content-Type \"text/plain; charset=utf-8\"
|
||||
respond \"AgentBBS Usenet (members-only). Point a newsreader at news.${DOMAIN}:563 over NNTPS and AUTHINFO USER <your-bbs-name> (any password). Or from the BBS: ssh -t news@${DOMAIN}\"
|
||||
}
|
||||
|
|
@ -880,6 +882,7 @@ if [ "$IRC" = "1" ]; then
|
|||
IRC_SITE="
|
||||
${IRC_DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
handle /irc {
|
||||
reverse_proxy 127.0.0.1:8097
|
||||
}
|
||||
|
|
@ -900,6 +903,7 @@ if [ "$MAIL_STACK" = "1" ]; then
|
|||
MAIL_SITE="
|
||||
${MAIL_DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
}
|
||||
"
|
||||
|
|
@ -912,6 +916,7 @@ fi
|
|||
FILES_SITE="
|
||||
${FILES_DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
|
||||
# A pure file server (NOT a website host — member homepages live on the BBS
|
||||
# at https://${DOMAIN}/~<name>). The agentbbs file-manager on loopback serves:
|
||||
|
|
@ -939,6 +944,7 @@ if [ "$CHAT" = "1" ]; then
|
|||
CHAT_SITE="
|
||||
${CHAT_DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
reverse_proxy ${CHAT_ADDR}
|
||||
}
|
||||
"
|
||||
|
|
@ -956,8 +962,24 @@ cat > /etc/caddy/Caddyfile <<CADDY
|
|||
}
|
||||
}
|
||||
|
||||
# One JSON access log for every site (sites sharing a file share one writer).
|
||||
# threatcrushd's log-watcher tails it for scanners, brute force and path
|
||||
# probing. Without it a leak cannot be traced: the 2026-11 homepage-symlink
|
||||
# breach left no record of which files were fetched. Rolled so it can't fill /.
|
||||
(accesslog) {
|
||||
log {
|
||||
output file /var/log/caddy/access.log {
|
||||
roll_size 50MiB
|
||||
roll_keep 10
|
||||
roll_keep_for 720h
|
||||
}
|
||||
format json
|
||||
}
|
||||
}
|
||||
|
||||
${DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
|
||||
# join@ email confirmation links (agentbbs loopback /verify endpoint)
|
||||
handle /verify {
|
||||
|
|
@ -1007,6 +1029,7 @@ ${GIT_SITE}${NEWS_SITE}${IRC_SITE}${MAIL_SITE}${FILES_SITE}${CHAT_SITE}
|
|||
# can't trigger certificate issuance.
|
||||
*.${DOMAIN} {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
tls {
|
||||
on_demand
|
||||
}
|
||||
|
|
@ -1022,6 +1045,7 @@ ${GIT_SITE}${NEWS_SITE}${IRC_SITE}${MAIL_SITE}${FILES_SITE}${CHAT_SITE}
|
|||
# {host} resolves to the right tree; unmapped hosts 404 (and never got a cert).
|
||||
https:// {
|
||||
encode zstd gzip
|
||||
import accesslog
|
||||
tls {
|
||||
on_demand
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue