File tree Expand file tree Collapse file tree
config/ansible/roles/profile_sensor_low Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464# --- HONEYPOTS LOG ROTATION --
6565- name : " Set the honeypots log rotation"
6666 become : true
67- ansible.builtin.copy :
68- src : honeypots.logrotate
67+ ansible.builtin.template :
68+ src : honeypots.logrotate.j2
6969 dest : /etc/lantana/logrotate.d/00_00/honeypots
7070 owner : root
7171 group : root
Original file line number Diff line number Diff line change 1212 compress
1313 delaycompress
1414 copytruncate
15+ sharedscripts
16+ # Cowrie's Twisted writer holds the file descriptor across rotation and
17+ # keeps appending at its remembered offset, leaving a sparse-null region
18+ # at the start of the new file (op_alpha 2026-06-19: cowrie.json reported
19+ # 149 MB, first non-null byte at offset 141 271 814 — Vector tails it
20+ # fine but cat/jq inspection breaks and analyst debug is blocked).
21+ # Restarting the rootless quadlet hands the writer a fresh FD pointing
22+ # at offset 0. Cost: any cowrie SSH session active at the moment of
23+ # rotation disconnects, losing a few seconds of intel — acceptable since
24+ # the cron fires at 00:00 UTC and attacker sessions rarely span midnight.
25+ # Dionaea's writer reopens cleanly on truncation so it doesn't need the
26+ # same treatment.
27+ postrotate
28+ runuser -u {{ system.users.sensor.name }} -- \
29+ env XDG_RUNTIME_DIR=/run/user/{{ system.users.sensor.uid }} \
30+ systemctl --user restart cowrie.service >/dev/null 2>&1 || true
31+ endscript
1532}
You can’t perform that action at this time.
0 commit comments