Blue:
- consul_config_audit: consul.hcl and consul.d/*.hcl (root prefix): ACL
default policy allow, bind_addr on every interface, incoming/outgoing
verification off, missing gossip encryption, enabled UI and world-writable
files.
- vault_config_audit: vault.hcl: tls_disable 1/true, UI enabled, disable_mlock
and a Shamir seal without auto-unseal.
- zookeeper_audit: zoo.cfg: an open 4lw whitelist (stat/mntr/envi),
clientPortAddress on every interface and a missing authProvider.
Red:
- tls_client_auth_probe: one openssl s_client -msg handshake; a
CertificateRequest means the server requires a client certificate. Reports
protocol and cipher and presents no certificate.
Tests with vulnerable and hardened Consul/Vault/ZooKeeper trees plus a
client-cert-required TLS server and a plain one. 905 checks, ASan suite green,
analyze clean, release-check green including distcheck 1.38.0.
Note: two unrelated nmap timeout checks failed once under system load and
passed on the immediate rerun (905/905), so they are recorded as environmental.
Blue:
- kubelet_config_audit: /var/lib/kubelet/config.yaml (root prefix): anonymous
authentication enabled, authorization mode AlwaysAllow, readOnlyPort above
zero and a world-writable config.
- etcd_config_audit: etcd.conf.yml/etcd.conf//etc/default/etcd: client URLs on
0.0.0.0 or plain HTTP, client and peer cert auth off, auto-tls and
world-writable files. Reads both YAML and KEY=value forms.
- rabbitmq_audit: rabbitmq.conf and advanced.config: guest loopback
restriction removed, default guest/guest credentials, management without a
TLS port and world-writable files.
Red:
- sni_vhost_check: one s_client -servername handshake per in-scope name,
comparing certificate subject, SAN and SHA-256 fingerprint; different
certificates on one address mean SNI virtual hosts.
Tests with vulnerable and hardened kubelet/etcd/RabbitMQ trees and a TLS
server selecting certificates per SNI. 893 checks, ASan suite green, analyze
clean (an analyzer NULL-dereference report in etcd_value was fixed), release
check green including distcheck 1.37.0.
Blue:
- bind9_config_audit: named.conf plus .options/.local (root prefix):
allow-query any, recursion yes without allow-recursion, allow-transfer any,
a visible version and world-writable files.
- tomcat_audit: server.xml and tomcat-users.xml under /etc/tomcat*: an
enabled shutdown port, a Connector on 0.0.0.0, manager/admin roles, a
plaintext manager password and world-writable files.
- proftpd_audit: proftpd.conf: AllowAll, an Anonymous block without
AnonReadOnly, RootLogin on, TLS not required and world-writable files.
Red:
- dns_caa_check: gated dig CAA; flags, tag and value per record, and whether
issue/issuewild/iodef are present.
Tests with vulnerable and hardened BIND/Tomcat/ProFTPD trees and a DNS agent
serving CAA records. 880 checks, ASan suite green, analyze clean,
release-check green including distcheck 1.36.0.
Blue:
- mongodb_config_audit: mongod.conf: net.bindIp on every interface (absent
counts as default), security.authorization disabled or missing, net.tls
mode disabled and a world-writable config.
- memcached_config_audit: memcached.conf: -l on every interface (absent
counts), UDP left enabled when -U 0 is missing, a memory limit of 8 GiB or
more and a world-writable config.
- ntpd_config_audit: ntp.conf: missing or weak restrict default (no
kod/limited), missing disable monitor (monlist), drift file in /tmp or
/dev/shm and a world-writable config.
Red:
- dns_wildcard_check: one gated dig for a random label under an in-scope
domain; an answer means wildcard DNS.
Tests with vulnerable and hardened mongod/memcached/ntp trees and a DNS agent
with and without a wildcard. 867 checks, ASan suite green, analyze clean,
release-check green including distcheck 1.35.0.
Blue:
- rsync_audit: rsyncd.conf (root prefix): missing or wildcard hosts allow,
uid/gid 0, use chroot = no, a world-readable secrets file and a
world-writable config.
- dhcpd_audit: dhcpd.conf: authoritative, ddns-update-style none/ad-hoc,
missing domain-name-servers, a range outside its subnet and a
world-writable config.
- krb5_conf_audit: krb5.conf: missing default_realm, dns_lookup_kdc false,
rdns true, des/arcfour/rc4 enctypes and a world-writable config.
Red:
- webdav_probe: OPTIONS plus a Depth: 0 PROPFIND; 207 Multistatus means
WebDAV is enabled, the Allow list shows DAV methods, evidence on a hit.
Tests with vulnerable and hardened rsync/dhcpd/krb5 trees and a WebDAV HTTP
fixture. 855 checks, ASan suite green, analyze clean, release-check green
including distcheck 1.34.0.
Blue:
- squid_audit: squid.conf (root prefix): http_access allow all, an http_port
on every interface, a cache_dir in /tmp or /dev/shm and a world-writable
config.
- unbound_audit: unbound.conf and unbound.conf.d: interface on every address,
access-control 0.0.0.0/0 or ::/0 allow, a missing DNSSEC trust anchor and
world-writable files.
- cups_audit: cupsd.conf: Listen on every interface, Browsing On, a Location
block with Allow All and a world-writable config.
Red:
- alpn_probe: one openssl s_client -alpn handshake per protocol (h2,
http/1.1, spdy/3.1 by default) and which one the server selects.
Tests with vulnerable and hardened Squid/Unbound/CUPS trees and an ALPN server
offering h2 and http/1.1. 842 checks, ASan suite green, analyze clean,
release-check green including distcheck 1.33.0.
Blue:
- postgresql_config_audit: /etc/postgresql/<ver>/<cluster> (root prefix)
postgresql.conf and pg_hba.conf: listen_addresses on every interface,
ssl = off, trust and md5/password entries, world-writable files.
- exim_audit: exim4.conf/exim.conf and conf.d: relay_from_hosts covering every
host, an accept rule for any host, an empty or missing tls_advertise_hosts
and world-writable files.
- elasticsearch_config_audit: elasticsearch.yml: network.host on every
interface, xpack.security.enabled false, single-node discovery and a
world-writable config.
Red:
- tls_ocsp_probe: one openssl s_client -status handshake; reports stapled or
not, the OCSP response status and the certificate status (good/revoked/
unknown), plus protocol and cipher.
conf_value now also strips single quotes (PostgreSQL writes listen_addresses
as '*'), and the 36-tool table is unchanged at 192 slots.
Tests with vulnerable and hardened PostgreSQL, Exim and Elasticsearch trees
plus a TLS server without stapling. 830 checks, ASan suite green, analyze
clean, release-check green including distcheck 1.32.0.
Blue:
- php_config_audit: /etc/php.ini or /etc/php/*/*/php.ini (root prefix):
expose_php, display_errors, allow_url_include/fopen, empty
disable_functions, session.cookie_secure Off and world-writable files.
- dovecot_audit: dovecot.conf and conf.d: ssl = no,
disable_plaintext_auth = no, PLAIN in auth_mechanisms and world-writable
drop-ins.
- openvpn_audit: server.conf and server/*.conf: missing tls-auth/tls-crypt,
BF-CBC/DES/none cipher, SHA1/MD5 HMAC, duplicate-cn and world-writable
files.
Red:
- smtp_starttls_probe: EHLO, STARTTLS, 220 and a real upgrade verified with
openssl s_client -starttls smtp; reports the negotiated TLS version and
cipher. No authentication and no mail.
Tests with vulnerable and hardened PHP/Dovecot/OpenVPN trees and a Python SMTP
server that upgrades to TLS plus one that does not. 817 checks, ASan suite
green, analyze clean, release-check green including distcheck 1.31.0.
Blue:
- mysql_config_audit: my.cnf and my.cnf.d/conf.d (root prefix): bind-address
on every interface, skip-grant-tables, local-infile, an empty
secure-file-priv and world-writable files. conf_value now also matches
valueless directives.
- apache_audit: apache2.conf/httpd.conf, sites-enabled and conf-enabled:
ServerTokens Full/OS/Minor, Options Indexes, AllowOverride All,
SSLv3/TLSv1 (including +TLSv1), ServerSignature On and world-writable files.
- haproxy_audit: stats socket without mode 600, stats page without stats auth,
bind on 443 without ssl and a world-writable config.
Red:
- dnssec_check: dig +dnssec DNSKEY/DS, signed and DS presence, algorithm and
decoded key size; flags unsigned domains, RSASHA1 and RSA keys under 2048
bits. dig wraps long DNSKEY base64 with spaces, so the parser joins them.
Tests with vulnerable and hardened daemon trees plus a DNS agent serving a
2048-bit RSA key, a 1024-bit RSASHA1 key and an unsigned zone. 802 checks,
ASan suite green, analyze clean, release-check green including distcheck
1.30.0.
Blue:
- postfix_audit: main.cf (root prefix) mynetworks covering 0.0.0.0/0 or ::/0,
relay restrictions without reject_unauth_destination (relay list, recipient
list or neither), an optional TLS level (unset/none/may) and world-writable
configuration.
- nginx_audit: nginx.conf, conf.d/*.conf and sites-enabled/*.conf:
server_tokens not off, autoindex on, TLSv1/TLSv1.1 in ssl_protocols, legacy
ciphers (RC4/3DES/NULL/EXPORT/MD5) and world-writable files.
- redis_config_audit: redis.conf: missing requirepass, protected-mode no, bind
on 0.0.0.0/*/::, enabled debug command, data dir in /tmp or /dev/shm and
world-writable config. The password value is never echoed.
One shared conf_value reader accepts 'key value' and 'key = value', skips
comments and strips semicolons and quotes; conf_has_word gives token-exact
matching so ::1 is not mistaken for all interfaces.
Tests with vulnerable and hardened trees for all three daemons. 786 checks,
ASan suite green, analyze clean, release-check green including distcheck
1.29.0.
Red:
- winrm_probe: one unauthenticated GET to /wsman (5985; TLS on 5986);
401/405 with a Negotiate/NTLM/Kerberos challenge identifies WinRM, the
response is saved as evidence.
Blue:
- snmpd_audit: snmpd.conf (root prefix) rocommunity/rwcommunity/community/
com2sec; lists communities with mode and flags rw, public/private/default and
com2sec rules accepting any source.
- rsyslog_audit: rsyslog.conf and rsyslog.d (root prefix): remote targets
(@@ TCP, @ UDP), world-writable configs and a dedicated auth rule; flags
missing auth logging and missing remote forwarding.
Tests: WinRM 401 fixture, plain HTTP server, snmpd.conf and full/sparse rsyslog
trees. 776 checks, ASan suite green, analyze clean, release-check green
including distcheck 1.28.0.
Fixture note: the community mode buffer was 8 bytes and truncated com2sec to
com2se; it is 16 now.
Red:
- kerberos_discovery: gated dig SRV queries for _kerberos._tcp,
_kerberos._udp and _kpasswd._tcp; reports priority, weight, port and target
for each KDC (trailing dot trimmed).
Blue:
- nfs_exports_audit: /etc/exports and /etc/exports.d (root prefix): export
count, world exports (*), writable exports without ro and no_root_squash,
with file and line.
- samba_audit: smb.conf (root prefix): shares exposing /, guest access,
writable shares and guest shares without valid users.
Tests: DNS SRV agent, exports tree and smb.conf. 765 checks, ASan suite green,
analyze clean, release-check green including distcheck 1.27.0.
Red:
- http2_probe: over TLS, openssl s_client -alpn h2 and the negotiated ALPN
protocol; over cleartext, the HTTP/2 client preface plus SETTINGS frame,
reporting the first frame type.
- ssh_hostkey_fingerprint: ssh-keyscan (rsa, ecdsa, ed25519) or a saved scan
output; decodes each base64 blob and reports key type, bits and the SHA256
fingerprint (base64, unpadded).
Blue:
- logrotate_audit: /etc/logrotate.conf and logrotate.d (root prefix):
world-writable configs, rotate <= 2, missing compress and postrotate commands
from /tmp or downloading code.
Tests: ALPN h2 TLS server, h2c SETTINGS server, constructed SSH blobs with
independently computed fingerprints and a logrotate tree. 756 checks, ASan
suite green, analyze clean, release-check green including distcheck 1.26.0.
Red:
- oidc_discovery: fetches /.well-known/openid-configuration and the OAuth
authorization-server metadata; reports issuer, authorization, token, JWKS
and userinfo endpoints with the document as evidence.
- security_txt: fetches /.well-known/security.txt and /security.txt; reports
Contact entries, Expires and Policy and flags an Expires date in the past.
Blue:
- ssh_known_hosts_audit: /etc/ssh/ssh_known_hosts(2), root and user
known_hosts (root prefix): entry count, hashed vs plain hosts, ssh-rsa/
ssh-dss key types and duplicate host keys.
Tests: OIDC metadata, fresh vs expired security.txt, known_hosts tree with
hashed/plain/weak/duplicate entries. 747 checks, ASan suite green, analyze
clean, release-check green including distcheck 1.25.0.
Red:
- ntp_monlist_probe: 8-byte mode-7 MON_GETLIST; a mode-7 reply larger than
the request means monlist is enabled, with entry estimate ((len-8)/72) and
the amplification factor. One request.
- dns_version_bind: gated dig for CHAOS TXT version.bind and hostname.bind;
any answer is a version/hostname disclosure.
Blue:
- usb_audit: /sys/bus/usb/devices (root prefix): vendor/product IDs,
manufacturer, product, serial and bInterfaceClass 08 (mass storage);
storage devices are flagged, nothing is opened or mounted.
Tests: mode-7 agent (active and silent), CHAOS TXT agent and USB sysfs tree.
737 checks, ASan suite green, analyze clean, release-check green including
distcheck 1.24.0.
Hardware:
- esp_image_verify: walks the segment table (load/length), XORs the segment
data against the stored checksum, aligns to 16 bytes and, when
hash_appended is set, compares the appended SHA-256 with the computed digest
up to the padding. Reports segments, entry, checksums and a valid flag; the
offset supports OTA partitions.
Red:
- crlf_probe: injects an encoded CRLF + X-Apex-Injected: yes through one
parameter (GET/POST) and checks whether the response carries the header;
the response is evidence on a hit.
Blue:
- audit_rules: parses /etc/audit/audit.rules and rules.d/*.rules (root
prefix): rule count, -e 2, an execve rule and watches on /etc/passwd,
/etc/shadow, /etc/sudoers and /etc/group; reports missing watches, missing
execve and unlocked rules.
Tests: generated valid/corrupted ESP images, CRLF-reflecting and filtering
endpoints, full and sparse audit rule sets. 728 checks, ASan suite green,
analyze clean, release-check green including distcheck 1.23.0.
Fixture lesson: the ESP image header is exactly 24 bytes; three extra filler
bytes shift every segment.
Red:
- smtp_open_relay: EHLO, MAIL FROM an .invalid sender, RCPT TO an external
recipient; 250/251/252 means open relay. DATA is never sent, so no mail
leaves the server; 530 is reported as an auth requirement.
- dns_open_resolver: one gated recursive dig against an in-scope server; an
answer means the resolver is open (amplification risk).
Blue:
- apparmor_audit: profile list (root prefix), enforce/complain counts and
complain profile names; flags an AppArmor with no active profile.
- selinux_audit: enforce file, SELINUX=/SELINUXTYPE= and boolean count; flags
disabled, permissive and a host without SELinux.
Tests: SMTP relay/refusing fixtures, DNS recursive/refusing agents, AppArmor
profile and SELinux trees. 717 checks, ASan suite green, analyze clean,
release-check green including distcheck 1.22.0.
Fixture note: the smtp_open_relay table entry was first appended after the
wrong table entry and the function was unused; it now sits at the end of
TOOLS_PROTO.
Red:
- smb_shares: after the anonymous SMB 2.1 session, TREE_CONNECT for 14 common
share names (IPC$, C$, ADMIN$, users, data, backup, public, www, home, share,
files, tmp, downloads, media); reports reachable shares and NT status. No
listing and no file access.
- email_security_audit: gated dig for SPF, DMARC (_dmarc), DKIM
(selector._domainkey) and MX; reports records, SPF policy, DMARC p= and gaps
(missing records, +all, p=none).
Blue:
- www_audit: /var/www, /srv/www, /usr/share/nginx/html (root prefix):
world-writable files and dirs, .env/wp-config/config.php/.htpasswd/id_rsa,
backups, .git directories and directories without an index.
The tool table hit its 128-slot cap at 130 tools; g_tools is now 192.
Tests: SMB share fixture (allow/deny), UDP DNS TXT/MX agent, web-root tree.
706 checks, ASan suite green, analyze clean, release-check green including
distcheck 1.21.0.
Red:
- tls_cipher_matrix: one openssl s_client per weak cipher (3DES, RC4, NULL,
EXPORT, CBC by default) for TLS 1.2 or 1.3; reports which suites negotiate.
The gate is checked once, then the handshakes run.
- smb_null_session: negotiate SMB 2.1, anonymous SESSION_SETUP with an empty
security buffer, TREE_CONNECT to IPC$ on success; reports status/id and IPC$
access. No share enumeration and no file access.
Blue:
- docker_audit: docker.sock mode (world-writable critical), docker group
members from /etc/group, daemon.json TCP hosts, TLS and insecure registries;
no daemon call.
Tests: a TLS server accepting AES128-SHA, SMB2 servers that allow and refuse
the anonymous session, and a Docker fixture tree. 695 checks, ASan suite green,
analyze clean, release-check green including distcheck 1.20.0.
Fixture lessons: the SMB negotiate helper already adds a NetBIOS header (double
wrapping shifts the SMB2 header by four bytes), and the Docker JSON closed the
daemon object twice.
Hardware:
- esp_app_info: app image header (magic 0xE9, segment count, entry) and the
esp_app_desc_t at 0x20 (magic 0xABCD5432): version, project name, build
time/date, IDF version and ELF SHA-256; offset can point at an OTA partition.
Red:
- api_auth_audit: unauthenticated GETs over an endpoint list, reporting status,
size, 2xx vs 401/403, JSON content type, evidence for open responses.
- cache_audit: clean vs parameterized URL, comparing Cache-Control/Pragma/Age/
Vary/X-Cache; flags parameterized-cacheable and missing Vary.
Blue:
- log_timeline: normalises auth and access log timestamps (auth gets the
current year), merges and sorts them and returns the first N entries with
source tags; paths limited to /var/log and the state dir.
Tests with an app image, API/cache HTTP fixtures and two log files. 686 checks,
ASan suite green, analyze clean, release-check green including distcheck
1.19.0.
Red:
- rpc_probe: one ONC RPC CALL to the portmapper (program 100000, version 2,
procedure DUMP) with a hand-built XDR message; decodes program/version/
protocol/port mappings and names common services. No export is mounted.
- ntp_probe: one NTPv4 client packet (mode 3); parses version, mode, leap,
stratum, reference id (trailing NUL trimmed), root delay/dispersion in ms and
the transmit time. No monlist.
Blue:
- ssh_config_audit: scores sshd_config for root login, password auth, empty
passwords, X11, GatewayPorts, PermitTunnel, MaxAuthTries and legacy
Ciphers/MACs/KexAlgorithms; optional root prefix.
- pam_audit: scans /etc/pam.d for pam_permit, pam_unix nullok, pam_exec and
reports when neither pam_faillock nor pam_tally2 provides lockout.
Tests: UDP portmapper agent, UDP NTP agent, sshd_config tree and pam.d tree.
674 checks, ASan suite green, analyze clean, release-check green including
distcheck 1.18.0.
Red:
- csrf_audit: fetch one page, list its forms (action, method, input count) and
flag forms without an input whose name contains csrf, token or nonce; the
page is evidence.
Blue:
- kernel_hardening: 12 sysctls (ASLR, kptr_restrict, dmesg_restrict,
perf_event_paranoid, unprivileged_bpf_disabled, ptrace_scope,
protected_hardlinks/symlinks, suid_dumpable, modules_disabled,
bpf_jit_harden) plus core_pattern, scored with per-check findings; optional
root prefix.
- sudoers_audit: /etc/sudoers and /etc/sudoers.d, flagging NOPASSWD,
!authenticate, broad ALL=(ALL), direct user rules and world-writable files.
- auditd_audit: event type counts, AVC denials, failed auth, top exe paths and
keys from an auditd log under /var/log or the state directory.
Fixed evidence ordering: sort by mtime and nanoseconds before the filename, so
two blobs written in the same second no longer flip (a flake the coverage build
exposed).
Tests with a sysctl tree, a sudoers tree, a two-form page and an auditd log.
663 checks, ASan suite green, analyze clean, release-check green including
distcheck 1.17.0.
Red:
- snmp_walk: GETNEXT over 1.3.6.1.2.1.1 for up to 30 steps, decoding the
returned OID and value (string, integer, timeticks, counter, IP, OID).
- ldap_search: anonymous bind, namingContexts resolved from the rootDSE when no
base is given, then one subtree search (scope 2, size limit 20) for
present(objectClass); collects DNs with cn/uid/mail.
- openapi_discovery: six usual spec paths; version, info title and path count,
document saved as evidence.
Blue:
- systemd_audit: unit files under /etc/systemd/system and
/usr/lib/systemd/system (root prefix supported): ExecStart in /tmp,
/dev/shm or /var/tmp, services without User=, world-writable unit files and
the number of .wants/.requires links.
Tests: a UDP SNMP agent returning a GETNEXT chain, an LDAP server with rootDSE
plus two subtree entries, an OpenAPI endpoint and a systemd tree. 649 checks,
ASan suite green, analyze clean, release-check green including distcheck
1.16.0.
Two parser bugs the fixtures caught: the system OID prefix is 14 characters
(not 15), and the rootDSE response's searchResultDone must be drained before
reading the subtree answer.
Red:
- http_methods: OPTIONS Allow list and Server header, TRACE echo detection.
PUT/DELETE are named if Allow advertises them but never sent.
- websocket_probe: GET with Upgrade/Connection and a random Sec-WebSocket-Key;
reports 101, Upgrade, Connection and Sec-WebSocket-Accept. No frame.
- ike_probe: one IKEv2 IKE_SA_INIT with an SA proposal (AES-CBC-128,
HMAC-SHA2-256, DH group 14) over UDP; version, exchange, first notify and
responder SPI. No PSK, no authentication.
Blue:
- firewall_audit: nft list ruleset or iptables-save (or a saved dump), chain
and rule counts and every chain whose default policy is ACCEPT. Local process
only (LOCAL_EXEC exception in the gate audit).
Tests: HTTP server for OPTIONS/TRACE/101 upgrade, a UDP IKEv2 agent answering
NO_PROPOSAL_CHOSEN with a responder SPI, and nft/iptables-save ruleset dumps.
639 checks, ASan suite green, analyze clean, release-check green including
distcheck 1.15.0.
ESP32 offline (tools_esp.c):
- esp_partition_table: parse the 32-byte entries at 0x8000 (magic 0xAA50),
type/subtype names, offset, size, flags and the MD5 entry.
- esp_nvs_parse: NVS pages (version byte 0xFE), namespace records (type 0x01,
nsIndex 0) and key records with namespace, type and span.
- firmware_scan: signatures (ESP app header 0xE9, partition table, NVS page,
littlefs/spiffs/FAT32, PEM), 4 KiB block entropy with integer-only log2 and
printable strings with samples. All read local dumps with size caps.
Blue:
- mount_audit: parses a mount table and flags /tmp, /var/tmp and /dev/shm
without nosuid/nodev/noexec and /home, /run/user, /media, /mnt without
nosuid/nodev, with the missing option list and severity.
Tests with locally built binary fixtures: a partition dump with two entries and
an MD5 record, an NVS page with one namespace and two keys, a firmware image
with all four signatures plus a random high-entropy block, and a mount table
with hardened and unhardened entries. 627 checks, ASan suite green, analyze
clean, release-check green including distcheck 1.14.0.
Red:
- pop3_probe: banner, CAPA capability list with the STLS flag, then QUIT.
No USER/PASS and no login.
- sip_probe: one UDP OPTIONS with generated Via/From/To/Call-ID, then status
line, Server header and Allow method list from the answer.
- telnet_probe: reads the banner and decodes IAC WILL/WONT/DO/DONT option
negotiations (subnegotiations skipped); sends nothing.
Blue:
- package_integrity: runs dpkg -V (optionally for one package) or rpm -Va/-V,
parses changed files with their status flags, and can parse a saved verify
output from a mounted image instead. Local process only, covered by the
gate audit's LOCAL_EXEC exception.
Tests: POP3 with TOP/STLS/SASL, a UDP SIP agent answering 200 with
Server/Allow, a Telnet server sending IAC DO/WILL plus banner text, a saved
dpkg verify output, and a live dpkg -V bash run. 615 checks, ASan suite green,
analyze clean, release-check green including distcheck 1.13.0.
Red:
- docker_api_probe: /version and /containers/json?all=1 without credentials;
engine/API version, OS, container and running counts, names and images. An
open API is audited, 401/403 is reported as protected, version reply saved.
- elasticsearch_probe: GET /, /_cluster/health and /_cat/indices without
credentials; cluster name, version, tagline, health, nodes and index count;
401/403 is reported as protected.
- imap_probe: banner, CAPABILITY list, STARTTLS and LOGINDISABLED flags, then
LOGOUT. No LOGIN, plain IMAP only.
Blue:
- module_audit: reads /proc/modules, /sys/module/<name>/taint and
/proc/sys/kernel/tainted, decodes the taint bits and lists tainted modules;
the three paths can point at a mounted image.
The tool table grows to 128 slots so the next tools fit.
Tests: Docker open and 401, Elasticsearch root/health/indices, IMAP with
STARTTLS+LOGINDISABLED, and a fake module tree with two tainted modules and
taint value 12289. 605 checks, ASan suite green, analyze clean, release-check
green including distcheck 1.12.0.
Red:
- vnc_probe: reads the RFB version, echoes it, then reads the security types
(3.7/3.8 list or 3.3 single type), names them and flags None authentication
(audited). A zero-length list reports the server's reason. No authentication.
- mqtt_probe: one MQTT 3.1.1 CONNECT with a clean session and no username or
password; reads the CONNACK code, disconnects, reports an anonymous broker
(code 0) or the refusal reason.
- graphql_probe: POSTs a compact introspection query and reports whether the
schema is exposed, the type count, query/mutation type names and a reason
when introspection is disabled or the endpoint is missing; evidence on hit.
Blue:
- cap_baseline: create/verify a baseline of Linux file capabilities
(security.capability xattr) under the same paths as suid_baseline, reporting
new, gone and changed capability sets; optional root prefix.
Tests: RFB 3.8 with None+VNC auth, RFB 3.3, a zero-security-type server, MQTT
brokers answering 0 and 5, GraphQL endpoints with a schema, disabled
introspection and a 404, and a capability tree (real caps need CAP_SETFCAP, so
the diff is exercised with a fabricated baseline entry). 593 checks, ASan suite
green, analyze clean, release-check green including distcheck 1.11.0.
Red:
- rdp_probe: X.224 Connection Request with an RDP negotiation request for
TLS|CredSSP (0x0f). Parses the Connection Confirm for the selected protocol
(RDP, TLS, CredSSP, RDSTLS, HYBRID_EX) or the failure code, and reports
whether NLA is in use. One connection, no logon.
- smb_probe: SMB2 NEGOTIATE offering 2.0.2, 2.1, 3.0, 3.0.2 and 3.1.1, then
reports dialect, signing required/enabled, capabilities, max transact/read/
write and the server GUID; an SMB1 answer is reported as such. No session
and no authentication.
Blue:
- suid_baseline: create/verify a SHA-256 manifest of SUID/SGID files under
/usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, /bin and /sbin
(symlinked directories skipped). Verify reports planted, removed and
mode/hash-changed setuid binaries; optional root prefix for a mounted image.
Tests: RDP frames selecting CredSSP and a negotiation failure, an SMB2 server
answering 3.1.1 with signing and a fixed GUID, and a SUID tree where one file is
planted, one removed and two change. 579 checks, ASan suite green, analyze
clean, release-check green including distcheck 1.10.0.
The SUID fixture documents a kernel behaviour: writing to a setuid file clears
the setuid bit, so a rewritten binary appears as gone unless the mode is set
again.
Red:
- ssti_probe: five template payloads ({{1337*7}}, ${1337*7}, #{1337*7},
<%= 1337*7 %>, {{1337*'7'}}) with expected outputs, after a baseline request
clears pages that already contain the numbers. Reports evaluation with the
likely engine, reflection or template errors; GET query or POST form;
evaluations saved as evidence.
- xxe_probe: XML with a DOCTYPE external entity pointing at a loopback listener
this process opens, in element and attribute form (optionally wrapped in a
form field). A callback proves the parser resolved it; parser error
signatures are reported too.
- ldap_probe: LDAPv3 anonymous simple bind, then a rootDSE search (baseObject
'', scope base, present(objectClass)); reports namingContexts, vendorName,
supportedLDAPVersion and the other attributes; an accepted anonymous bind is
audited.
Blue:
- ssh_key_audit: authorized_keys under /etc/ssh, /root/.ssh, /home/*/.ssh and
the state dir, plus private keys (id_* and /etc/ssh/ssh_host_*_key). Flags
unrestricted entries, ssh-rsa/ssh-dss, duplicate keys and private keys
readable beyond their owner; optional root prefix for a mounted image.
Tests: a template engine that evaluates Jinja and EL payloads, an XML endpoint
that fetches the external entity, LDAP servers that accept and reject the
anonymous bind with a rootDSE, and an SSH key tree with restricted,
unrestricted, duplicate and weak keys plus three private-key modes. 569 checks,
ASan suite green, analyze clean, release-check green including distcheck 1.9.0.
The LDAP bind parser had to be structural: the result code is an enum TLV
(0a 01 code), not three raw bytes after the protocol-op tag.
Red (tools_red.c):
- param_fuzz: three benign probes per parameter (unique marker, single quote,
{{1337*7}}) through GET query or POST form; reports marker reflection, SQL
error strings, stack traces, template errors and template evaluation (9359).
10 parameters per call, 100 ms apart, hits saved as evidence. It proves
handling signals, it does not extract data.
- open_redirect: sends an external marker URL and a protocol-relative variant
through one parameter and checks the Location header or a meta refresh for
the marker host, with evidence.
- host_header_injection: sends a .invalid canary as Host (plain HTTP) and as
X-Forwarded-Host and reports reflection in body or Location against the
baseline status/size.
Blue (tools_blue.c):
- net_baseline: create/verify a JSONL baseline of listening TCP ports with the
owning process name (/proc/net/tcp{,6} and /proc/<pid>/fd), reporting new,
gone and process-changed ports.
Tests with a local web fixture (reflecting endpoint, SQL error on quote,
template evaluation, redirect, Host echo, static pages) and a real
socket-open/socket-close pair around the port baseline. 553 checks, ASan suite
green, analyze clean, release-check green including distcheck 1.8.0.
New tools_db.c module:
- mysql_probe reads the initial handshake (protocol/server version, thread id,
auth plugin, capability flags for TLS, secure connection and plugin auth).
No credentials are sent.
- postgres_probe asks with a separate SSLRequest whether SSL is offered, then
sends one StartupMessage as user postgres and reports trust, cleartext, md5,
SCRAM (with mechanism) or rejected (with the server message). A trust answer
is audited; no password is sent.
- mongo_probe sends a legacy OP_QUERY isMaster to admin.$cmd with a hand-built
BSON document and parses the OP_REPLY for ok, maxWireVersion, writable
primary and a version string.
- memcached_probe sends one stats command and reports open access, version,
connections, items, memory limit and uptime.
Socket helpers apex_net_write/line/exact are exported from tools_proto.c.
Tests with local fixtures: MySQL handshake with caching_sha2_password,
PostgreSQL trust, md5, SCRAM and pg_hba rejection including an SSL-refused
server, a MongoDB OP_REPLY, and memcached stats plus an ERROR answer. 537
checks, ASan suite green, analyze clean, release-check green including
distcheck 1.7.0.
Red, deep service checks (tools_proto.c):
- tls_audit: four openssl s_client probes (TLS 1.0/1.1/1.2/1.3) plus a
-showcerts run, then openssl x509 for subject, issuer, validity and DNS SANs.
Flags TLS 1.0/1.1 and RC4/3DES/NULL/EXPORT/MD5 ciphers. A failed handshake
also prints a session block, so success is keyed on 'New, ..., Cipher is ...'
and (NONE) counts as failure.
- redis_probe: PING on one connection; when it answers without AUTH, INFO and
DBSIZE follow. Reports open access (audited), version, role, connected
clients, OS and database size. No password guessing.
- snmp_probe: hand-built SNMPv1/v2c GET sysDescr.0 over UDP, two attempts per
community (default public/private, max 4), raw answer saved as evidence. No
net-snmp dependency.
- dns_zone_transfer: dig AXFR against one in-scope server for one in-scope
zone; record counts per type, up to 200 raw records, full output as evidence,
and explicit refused/unreachable reasons.
Shared gated_run(): gate, audit and run with the output returned to the caller,
so multi-command tools keep the gate invariant.
Tests: TLS server with a generated certificate, open and AUTH-required Redis
servers, a UDP SNMP agent answering only 'public', an AXFR server with
SOA/NS/A records plus a refusing variant, and the out-of-scope paths. 522
checks, ASan suite green, analyze clean (an analyzer uninitialised-field report
was removed by initialising the token array), release-check green including
distcheck 1.6.0.
Red, protocols (tools_proto.c):
- ftp_probe: one connection, 220 banner, FEAT feature list, then the literal
anonymous pair (USER anonymous / PASS anonymous@apex.invalid). Reports both
reply codes and audits whether anonymous login was accepted.
- smtp_probe: banner, EHLO extension list, then VRFY for a small user list
(default root, admin, postmaster; max 8) classified exists / unknown /
cannot-verify / disabled. No mail is sent.
- ssh_audit: banner plus the KEXINIT name-lists (kex, host key, ciphers and
MACs in both directions); flags group1/group14-sha1, ssh-rsa, ssh-dss,
3des-cbc, arcfour, blowfish-cbc, cast128-cbc, hmac-md5 and sha1-96 once each.
No authentication is attempted.
Blue (tools_blue.c):
- persistence_audit: reads /etc/crontab, /etc/cron.d, /var/spool/cron/crontabs,
/var/spool/cron/atjobs and /etc/systemd/system (services and timers) and
flags /tmp,/dev/shm,/var/tmp execution, curl/wget piped to a shell,
base64-to-shell, nc -e/socat, bash -i and setuid chmod. The optional root
prefix audits a mounted image.
Tests with local fixtures: FTP servers that allow and refuse anonymous login,
an SMTP server with exists/unknown/cannot-verify VRFY answers, a modern and a
deprecated SSH KEXINIT, and a persistence tree with four malicious and three
clean files. 506 checks, ASan suite green, analyze clean, release-check green
including distcheck 1.5.0.
Two parser bugs the fixtures caught: SSH name-lists begin at offset 18 (pad
byte + message type + 16-byte cookie), and FTP FEAT continuation lines carry no
reply code, so they need a dedicated reader.
Red, offline (tools_red.c):
- jwt_audit decodes header and payload, reports alg/typ/kid and the claims
iss/aud/sub/exp/iat/nbf, and flags alg=none (critical), a missing exp, an
expired token, a path-like kid, a missing audience/issuer and a validity over
a year. With secret= it verifies HS256 over header.payload with HMAC-SHA256
and reports valid or invalid; alg=none is never reported as verified.
- hash_id identifies MD5/NTLM, SHA-1/256/512, bcrypt, Argon2, crypt(3)
formats and JWTs by shape. It cracks nothing.
Blue, offline (tools_blue.c):
- mitre_map maps recorded findings to ATT&CK techniques through keywords in
title, tool, tags and CWE, and lists the finding ids per technique.
- process_snapshot reads /proc: name, exe, fd count, and flags executables
under /tmp, /dev/shm or /var/tmp, deleted executables, reverse-shell command
lines and more than 256 open files.
sha256.c gains a raw digest and HMAC-SHA256 for the JWT signature check.
Fixed the tool table capacity: g_tools[64] silently dropped tool number 65
(hash_id); it is 96 now.
Tests: HS256 valid and invalid tokens, alg=none and expired findings, a
path-like kid, malformed token, MD5/bcrypt/JWT identification, ATT&CK mapping
against real finding ids, and a spawned process with nc -e in its command line
caught by the snapshot. 490 checks, ASan suite green, analyze clean (a
false-positive uninitialised-buffer report was removed by decoding into a
calloc buffer), release-check green including distcheck 1.4.0.
Red:
- ssrf_probe opens a loopback listener, injects one parameter with URLs
(127.0.0.1, localhost, 127.1, unique tokens) and reports a callback only when
a request actually arrives; the request line is saved as evidence. GET query
or POST form, or a callback_base collector for remote targets. It never
targets metadata endpoints.
Blue:
- detect_rules writes one Sigma, one Suricata and one YARA skeleton per finding
under $APEX_HOME/detections/, with id, title, target and severity, and states
that they must be tuned before deployment.
- integrity_baseline creates/verifies a SHA-256 manifest (new sha256.c) and
reports changed, missing and added files; no external tools.
Hardware:
- esp_flash runs esptool write_flash only with confirm=true, an absolute image
path (1..16 MiB) and offset checks, and audits every attempt.
Tests: fetch-performing SSRF target plus one that ignores the URL, six rule
files from two findings with content assertions, a baseline round trip
(modified/missing/added) including the SHA-256 abc vector, and the three
esp_flash refusal paths. 476 checks, ASan green, analyze clean, release-check
green including distcheck 1.3.0.
Red (tools_red.c):
- vhost_discovery: Host-header fuzzing against one in-scope IP. Baseline
status/bytes/title, then each built-in or caller-supplied name; a status
change, a >24-byte difference or a different <title> is a hit and its
response is saved as evidence. Plain HTTP only; TLS SNI would need a
resolver override. 100 ms between names, 100 names max.
- http_brute: hidden-path probing from the built-in list, a comma list, or a
wordlist file (one path per line, # comments). Hits 200/201/204/301/302/307/
308/401/403; 100 ms apart, 40 paths default, 200 max; the first five 200/201
bodies become evidence.
Blue (tools_blue.c):
- web_log_audit: nginx/apache access log. 2xx/3xx/4xx/5xx split, top source
IPs, scanner user agents (sqlmap, nikto, nmap, gobuster, nuclei, hydra, ...),
SQLi/traversal/XSS patterns after percent-decoding the URI (one entry per
pattern) and IPs with a 4xx/5xx burst. Path limited to /var/log and the
state dir.
Tests: Host-routing fixture (admin/api/www), path-routing fixture with words
and a wordlist file, and a synthetic access log with encoded SQLi, traversal,
scanner UAs and a 4xx burst. 456 checks, ASan suite green, analyze clean,
release-check green including distcheck 1.2.0.
The suite grows from reconnaissance into a red/blue/hardware toolset; existing
tools and file formats are unchanged.
Red (tools_red.c):
- vuln_check: non-destructive verification of exposed .git/HEAD, .env, open
directory listing and phpinfo; each hit saves the raw response as evidence;
.env returns key names only, never values.
- subdomain_enum: built-in wordlist or caller-supplied names under one in-scope
domain; every name goes through the gate before it is resolved.
- cred_test: HTTP Basic default credentials, max 20 attempts, 200 ms apart,
stops on 429, refuses a path that answers without authentication.
Blue (tools_blue.c):
- hardening_audit: sshd_config, sysctl, /etc/shadow mode, world-writable /etc
directories, listening sockets, firewall files, SUID count; scored findings.
- log_audit: auth-log failures per IP (flagged at five), invalid users,
accepted logins; path restricted to /var/log and the state dir.
- ioc_scan: directory walk for /dev/tcp shells, bash -i, base64|sh, curl|sh,
nc -e, socat EXEC:, setuid chmod, systemd units under /tmp.
ESP32 (tools_esp.c):
- esp_info (esptool chip_id plus USB VID/PID), esp_monitor (read the console,
send nothing), esp_read_flash (up to 4 MiB into evidence/). No flashing.
Shared helpers exported: apex_http_once, apex_status_code, apex_looks_tls,
apex_serial_open, apex_base64_alloc. Gate audit pins 54 tools with a local-exec
exception for the two esptool tools that have no network target.
439 checks with local fixtures for every new path, ASan suite green, analyze
clean, release-check green including distcheck 1.1.0.
- README rewritten for a first-time reader: the gate and its rule order, quick
start, all 45 tools by group, transports, proxy and rewrite rules, findings/
assets/traffic/reports, state layout, security model, limits, build and
release targets, install layout, environment, source layout, 1.x promise.
- License changed to CNCL 1.1 (Could Not Care Less License). LICENSE carries the
unchanged text; README, SECURITY.md and the man page point at it. make dist and
make install ship LICENSE.
- Scope gap tests: deny_ip beats allow_ip, port range endpoints and neighbours,
/25 boundary, IPv6 CIDR accept/refuse, apex vs subdomain vs wildcard matching
(*.name not matching the apex), embedded host:port, trailing FQDN dot, and a
failed scope_reload closing the gate. scope.c 75.9% -> 82.8%, total 79.4%.
397 checks, analyze clean, release-check green including distcheck 1.0.4.
tls_cert called openssl s_client -connect <port> - a bare port with no host -
so openssl tried to resolve '443' and every call failed. The new gap test that
asserts a certificate chain and 'Verify return code: 0' found it. It now passes
host:port, bracketing IPv6 literals.
Gap tests for the weakest files, all against local fixtures:
- guard rule table: shutdown/halt/init 6, systemctl mask, service stop, nft
flush, ufw disable, pfctl -F, iptables -X, wipefs, mkswap, shred, tee and
sed -i into /etc, socat EXEC, nc --exec; plus the world-writable, upload and
secret-file notes and an empty command.
- proc.c: a fake nmap that sleeps past its timeout is killed and reported
signalled in under 4 s; 1.2 MB of output is marked TRUNCATED and clamped;
a failed exec is exit 127 with the child's explanation; apex_have refuses a
program outside PATH.
- http_paths: base path prefix appears in the reported hit, limit=3 probes
exactly three, limit=0 means the default 40.
- proxy rewrite: the rule replaces a client header instead of duplicating it,
the wildcard host matches, and an invalid rewrite file on SIGHUP keeps the
last good rule set (and does not resurrect an older one).
Coverage 77.1% -> 78.7%; proc.c 66.9 -> 73.9, guard.c 72.5 -> 83.0,
tools_recon.c 69.3 -> 72.8, tools_guard.c 85.4 -> 95.1. 373 checks.
The suite occasionally saw the stdio server exit rc=0 with normal startup on
stderr and no replies, and a one-shot retry hid it. It was not the server.
MarauderSim.close() set stop, slept 0.1 s and closed the PTY fds. The reader
thread holds the fd number, not a file object: if it was still inside
select([master]) - a 0.2 s timeout, so roughly half the time after a 0.1 s
sleep - the number was free. The next mkstemp() in run() reused it, select
reported the temp file readable, and the thread read and discarded the
subprocess payload. The child then saw EOF, exited 0 and answered nothing.
That is why every observed failure was the dry-run call, the only run() that
follows a simulator close without a new openpty() in between.
Reproduced outside the suite: copying the shipped class and the close-then-spawn
sequence gave 17 empty spawns in 60 rounds (28%), with the simulator buffer
holding exactly the 47-byte payload.
close() now joins the reader and prompter threads before closing the fds, and
the reader refuses to read once stop is set. tests/run.py repeats
close-then-spawn twelve times and asserts no thread survives and no spawn loses
its stdin; without the fix that is 12/12 threads alive and 6/12 spawns lost.
The retry is removed so empty stdout fails again.
No product-code change. 336 checks, analyze clean, release-check green
including distcheck 1.0.2.
APEX_VERSION in src/apex.h is the only source of truth, and nothing compared it
with what users read. SECURITY.md claimed 0.23.x while the tree was at 0.30.0 for
seven releases.
tests/version_check.py now checks five places and names each disagreement:
man page .TH, README status line, top CHANGELOG heading, SECURITY supported line
(<major>.<minor>.x) and the Makefile tarball name (which must derive from
APEX_VERSION, not hardcode it). It runs first in tests/run.sh, has its own
make version-check target, and is the first step of make release-check.
Bump 1.0.0 -> 1.0.1 with all five updated. Red proof: leaving the man page at
1.0.0 fails with 'docs/apex-twin.1 .TH says 1.0.0, header says 1.0.1' and run.sh
stops before the suite.
Verified: make test (version check + gate audit + 334 checks), make analyze 0,
make release-check green through distcheck 1.0.1.
Set APEX_VERSION 1.0.0 and sync every version claim: the man page .TH, the
README status, SECURITY.md supported line (now 1.0.x, with --version as the
authority) and a 1.0.0 CHANGELOG entry. The 0.30.0 section gets its commit hash.
1.0 states the compatibility promise rather than adding features:
- every target-taking tool goes through the gate, enforced statically before
the suite;
- audit before action, one write per line;
- findings/assets/traffic JSON only gain fields; old state is readable and
reports stay derived;
- the documented limits are the contract;
- no shell/exploit, no TLS interception, no agent loop.
Verified: make test 334/334, analyze 0, mandoc lint 0, release-check green with
distcheck 1.0.0, make dist produces apex-twin-1.0.0.tar.gz with CHANGELOG,
SECURITY and the man page.
make install now ships five documents into $PREFIX/share/doc/apex-twin/
(README, CHANGELOG, SECURITY, operations, artex-port) and a new apex-twin(1)
man page into $PREFIX/share/man/man1/. MANDIR is overridable like the other
directories; DESTDIR works as before.
docs/apex-twin.1 covers the five modes, the scope rule order, every environment
variable (state, scope, rewrite, serial, dry-run, timeouts, webhook, proxy and
HTTP caps, audit and evidence limits), the state files, examples for --check and
curl -x, the hard limits, and pointers to the longer docs. mandoc -T lint is
clean and groff renders it.
Verified: make install DESTDIR=/tmp/apex-install-test lists the four units/docs
plus man page with modes 644/755; make test 334/334; release-check green
including distcheck 0.30.0.
APEX_EVIDENCE_MAX_BYTES (default 16 MiB, 0 unlimited) bounds one evidence blob.
Over the cap, t_evidence returns an error that names the variable and the actual
size, writes no file, and writes an audit deny line. --check and capabilities
report evidence_max_bytes.
Tests in a fresh state dir: 500 bytes under a 1000-byte cap is written; 2000
bytes is refused with APEX_EVIDENCE_MAX_BYTES in the message, evidence_list
still shows one file, and the audit has the deny; a limit of 0 accepts the same
2000 bytes. Red proof: disabling the check gives four red checks.
334 checks, coverage 76.9%, release-check green including distcheck.
The HTTP face forked a child per connection without a limit and read the head
with a blocking read, so a local client could hold children forever.
- APEX_HTTP_MAX_CHILDREN (default 64, max 1024) with a SIGCHLD handler,
waitpid(WNOHANG) reaping and a counter. At the cap the parent answers 503
'http busy' and audits it; a failed fork serves in the parent.
- APEX_HTTP_HEAD_TIMEOUT_MS (default 20000, 0 disables) is a deadline for the
whole head and body using poll with the remaining time; expiry answers 408
Request Timeout.
- Rejections (503, 408) half-close and drain what the client already sent before
closing: closing with unread bytes sends RST and can swallow the response.
http_send now has reason phrases for 408 and 503.
- --check and capabilities report both values.
Tests: cap of 1 with a held partial request -> second gets 503 'http busy';
after closing, the slot is reused and a valid initialize gets 200. A 500 ms head
timeout closes a half-sent head with 408 in under 2.5 s. Red proof: disabling
both turns those two checks red.
327 checks, coverage 76.9%, release-check green including distcheck.
audit.log grew without a bound. APEX_AUDIT_MAX_BYTES (default 10 MiB, 0
disables) rotates it to audit.log.1 when the next line would cross the limit:
the size is checked, then re-checked under flock(LOCK_EX) on audit.log.lock, so
only one proxy child renames. Lines are still one write() each, so a line never
mixes with another writer. A child with an already-open fd keeps writing to the
renamed file, which is still a valid log; new writers open the new file.
audit_log reads the current file only. --check and capabilities report
audit_max_bytes.
Tests with a 300-byte cap and 12 audited calls: audit.log.1 exists, every
non-empty line in both files parses as JSON, audit_log still answers, and
APEX_AUDIT_MAX_BYTES=0 produces no .1. Red proof: disabling the rotation call
fails the rotation and rotated-file checks.
323 checks, coverage 77.1%, release-check green including distcheck.
A full release-check occasionally sees the stdio server exit 0 with the normal
startup on stderr and no replies (one case in ~10 full runs, twice inside a
fresh-clone distcheck). Reproduced neither with 300 isolated invocations nor
with three parallel suites, and the same deterministic input always works. The
harness now retries exactly that shape (rc=0, empty stdout) once and logs it;
non-zero exits are never retried, and two empty runs still fail.
Version stays 0.26.0; product code is unchanged.
A fresh-clone distcheck run failed the dry-run check once with empty stdout:
rc=0, normal startup on stderr, no replies. The same input works everywhere
else, so the variable is the stdin pipe. Write the payload to a temp file and
pass the fd as stdin; the child then cannot miss bytes that were supposedly
written, and a silent exit with rc=0 becomes a real signal instead of a race.
Diagnostics on empty stdout stay in place.
Two local suites green. Version stays 0.26.0.
finding_add is idempotent for the same target and title. apex_finding_find()
scans the store with case-insensitive comparison where whitespace runs are
collapsed and ends trimmed, so 'Dup Test', ' dUp tEsT ' and 'dup test' are
one finding. The second call returns the existing id with duplicate:true,
writes no second file, leaves the stored fields alone (use finding_update) and
audits 'duplicate of <id>'. A different target or title creates a new finding.
Tests in a fresh state dir: first f0001, case/space variant same id + duplicate,
different title f0002, same title on 192.0.2.5 f0003, three files, stored
severity still low, JSON report total 3, duplicate in audit. Red proof:
returning NULL from the lookup turns six checks red.
317 checks, coverage 77.0%, release-check green including distcheck.