apex-twin 0.30.0: install the doc set and a 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.
This commit is contained in:
lotherk committed 2026-11-21 09:43:07 +00:00
1 parent eebec07b80
commit b4af387333
6 files changed
+232 -11

No files matched your search

+10 -1
View File
@@ -8,7 +8,16 @@ fields, and state from an older version is read by a newer one.
There are no git tags. The hash next to a version is the commit that introduced
it; the current entry is the commit that adds this section.
## 0.29.0 — 2026-11-21 — this change
## 0.30.0 — 2026-11-21 — this change
- `make install` ships the documentation set: README, CHANGELOG, SECURITY,
operations and the ARTEX port map in `$PREFIX/share/doc/apex-twin/`, plus a
new `apex-twin(1)` man page in `$PREFIX/share/man/man1/`.
- `docs/apex-twin.1` covers modes, scope rule order, every environment variable
and limit, the state files, examples and a pointer to the longer docs.
`mandoc -T lint` is clean.
## 0.29.0 — 2026-11-21 — eebec07
- `APEX_EVIDENCE_MAX_BYTES` (default 16 MiB, `0` unlimited) caps `evidence_save`.
An oversized call returns a clear error naming the variable, writes no file,
+6 -2
View File
@@ -6,6 +6,7 @@ PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DOCDIR ?= $(PREFIX)/share/doc/apex-twin
UNITDIR ?= $(PREFIX)/lib/systemd/system
MANDIR ?= $(PREFIX)/share/man/man1
SRC := $(wildcard src/*.c)
OBJ := $(SRC:.c=.o)
ASAN_BIN := apex-twin-asan
@@ -182,9 +183,12 @@ release-check:
$(MAKE) distcheck
install: apex-twin
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(DOCDIR) $(DESTDIR)$(UNITDIR)
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(DOCDIR) $(DESTDIR)$(UNITDIR) \
$(DESTDIR)$(MANDIR)
install -m 0755 apex-twin $(DESTDIR)$(BINDIR)/apex-twin
install -m 0644 README.md $(DESTDIR)$(DOCDIR)/README.md
install -m 0644 README.md CHANGELOG.md SECURITY.md $(DESTDIR)$(DOCDIR)/
install -m 0644 docs/operations.md docs/artex-port.md $(DESTDIR)$(DOCDIR)/
install -m 0644 docs/apex-twin.1 $(DESTDIR)$(MANDIR)/apex-twin.1
install -m 0644 systemd/apex-twin.service $(DESTDIR)$(UNITDIR)/apex-twin.service
install -m 0644 systemd/apex-twin-proxy.service $(DESTDIR)$(UNITDIR)/apex-twin-proxy.service
+9 -6
View File
@@ -25,6 +25,8 @@ separate, explicitly armed switch.
checklist and how to report a problem.
- [CHANGELOG.md](CHANGELOG.md) — what changed in each version, with the commit
that introduced it.
- `man apex-twin` (source: `docs/apex-twin.1`) — modes, environment, scope rules,
files and limits in one page.
## Build
@@ -46,11 +48,12 @@ make distcheck # build the tarball, unpack it, build and test it there
make release-check # gate audit, suites, sanitizer, analyzer, fuzzers, distcheck
```
`make install` puts the binary in `$PREFIX/bin`, the README in
`$PREFIX/share/doc/apex-twin/` and both units in `$PREFIX/lib/systemd/system/`,
so a package can use `DESTDIR=/tmp/pkg make install` without surprises. The
proxy unit is separate: an engagement box may want the MCP server without an
open listener.
`make install` puts the binary in `$PREFIX/bin`, the documentation set (README,
CHANGELOG, SECURITY, operations, port map) in `$PREFIX/share/doc/apex-twin/`,
the `apex-twin(1)` man page in `$PREFIX/share/man/man1/` and both units in
`$PREFIX/lib/systemd/system/`, so a package can use `DESTDIR=/tmp/pkg make
install` without surprises. The proxy unit is separate: an engagement box may
want the MCP server without an open listener.
Flags are fixed: `-std=c99 -Wall -Wextra -Wpedantic -Werror` plus
`-D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE`.
@@ -482,7 +485,7 @@ the copied scope reason is now bounded with a precision, not left to snprintf.
## Status
0.29.0. Built and run: 45 tools, 334 checks, 340 fuzz cases and 76.9% line
0.30.0. Built and run: 45 tools, 334 checks, 340 fuzz cases and 76.9% line
coverage. The loop closes: a probe captures the exchange as a pair, a finding
points at it, `finding_update` gives it a state, an asset records the host it
came from, `cors_check`/`cookie_audit`/`http_options` turn a web answer into a
+204
View File
@@ -0,0 +1,204 @@
.\" apex-twin.1 - manual page for APEX TWIN
.TH APEX-TWIN 1 "2026-11-21" "apex-twin 0.30.0" "User Commands"
.SH NAME
apex-twin \- scope\-gated offensive\-security MCP server
.SH SYNOPSIS
.B apex-twin
.RI [ options ]
.br
.B apex-twin
.B \-\-http
.I PORT
.br
.B apex-twin
.B \-\-proxy
.I PORT
.br
.B apex-twin
.B \-\-check
.br
.B apex-twin
.B \-\-version
.SH DESCRIPTION
.B apex-twin
is a C99/POSIX MCP server that gives an agent reconnaissance and web testing
behind a rules\-of\-engagement gate.
Every tool that can touch a network calls one gate function; a target that is
not named by the scope is refused, and the decision is appended to
.I audit.log
before the action.
No scope file means no engagement: the gate refuses everything until one is
written.
.PP
The binary links libc only; plain HTTP is spoken in\-process, HTTPS is handed to
.BR curl ,
and the radio is the ESP32 Marauder serial CLI.
It is not an exploit framework: there is no shell, no payload that reads data,
and no post\-exploitation.
.SH MODES
.TP
.B apex-twin
MCP over stdin/stdout, one JSON\-RPC line each way.
.TP
.BI "\-\-http " PORT
MCP over HTTP on 127.0.0.1:PORT, endpoint
.BR /mcp .
Loopback only.
.TP
.BI "\-\-proxy " PORT
Forward proxy on 127.0.0.1:PORT for clients such as
.BR "curl \-x" .
Plain HTTP is captured under
.IR traffic/ ;
CONNECT is tunnelled blind.
.TP
.B \-\-check
Print version, tool count, limits and the loaded scope as JSON, then exit.
.TP
.B \-\-version
Print the version and exit.
.SH SCOPE
The scope file is JSON; see
.I examples/scope.json
in the source tree.
Rules are applied in this order:
no scope or expired; the target is in
.IR deny_ip ;
a port is set and not in
.IR allow_port ;
the target is in neither
.I allow_ip
nor
.IR allow_domain ;
the target is private, loopback or link\-local while
.I allow_private
is false; a name outside
.I allow_domain
does not resolve entirely inside
.IR allow_ip .
A name in
.I allow_domain
may not resolve into a private net while
.I allow_private
is false.
Radio transmission additionally needs
.I serial_tx
and a command on the allowlist.
.SH ENVIRONMENT
.TP
.B APEX_HOME
State directory, default
.IR ~/.local/state/apex\-twin .
.TP
.B APEX_SCOPE
Scope file, default
.IR $APEX_HOME/scope.json .
.TP
.B APEX_REWRITE
Proxy rewrite rules, default
.IR $APEX_HOME/rewrite.json .
.TP
.B APEX_SERIAL
Marauder tty, default
.IR /dev/ttyACM0 .
.TP
.B APEX_BAUD
Serial baud, default 115200.
.TP
.B APEX_DRY_RUN
When set to 1, commands are printed but not run.
.TP
.B APEX_DEFAULT_TIMEOUT_MS
Per\-tool timeout, default 60000.
.TP
.B APEX_MAX_TIMEOUT_MS
Hard timeout cap, default 900000.
.TP
.B APEX_WEBHOOK
URL that receives a JSON event for findings at or above the severity floor.
The webhook is operator infrastructure and is not put through the scope gate.
.TP
.B APEX_WEBHOOK_MIN_SEVERITY
Floor for the webhook, default
.IR critical .
.TP
.B APEX_PROXY_MAX_CHILDREN
Concurrent proxy connections before 503, default 64, maximum 1024.
.TP
.B APEX_HTTP_MAX_CHILDREN
Concurrent HTTP MCP connections before 503, default 64, maximum 1024.
.TP
.B APEX_HTTP_HEAD_TIMEOUT_MS
Deadline for an HTTP request head and body, default 20000; 0 disables.
.TP
.B APEX_AUDIT_MAX_BYTES
Rotate
.I audit.log
to
.I audit.log.1
at this size, default 10 MiB; 0 disables.
.TP
.B APEX_EVIDENCE_MAX_BYTES
Largest single evidence blob, default 16 MiB; 0 disables the cap.
.SH FILES
.TP
.I $APEX_HOME/scope.json
The rules of engagement.
.TP
.I $APEX_HOME/audit.log
One JSON line per decision, append\-only, written before the action.
.TP
.I $APEX_HOME/findings/
One JSON file per finding.
.TP
.I $APEX_HOME/evidence/
Raw evidence blobs, mode 0600.
.TP
.I $APEX_HOME/reports/
Rendered Markdown, CSV and JSON reports.
.TP
.I $APEX_HOME/assets/
One record per target, merged on the next observation.
.TP
.I $APEX_HOME/traffic/
Captured request/response pairs.
.TP
.I $APEX_HOME/rewrite.json
Optional proxy rewrite rules, reloaded on SIGHUP.
.SH EXAMPLES
Write a scope and check it:
.PP
.nf
.RS
.B cat > ~/.local/state/apex\-twin/scope.json <<\(aqEOF\(aq
{ "label": "lab", "expires": "2026\-12\-31",
"allow_ip": ["192.0.2.0/24"], "allow_port": ["80", "443"] }
EOF
.B apex\-twin \-\-check
.RE
.fi
.PP
Use it as an MCP server over stdio, or point curl at the proxy:
.PP
.nf
.RS
.B apex\-twin
.B apex\-twin \-\-proxy 8798
.B curl \-x http://127.0.0.1:8798 http://192.0.2.10/
.RE
.fi
.SH LIMITS
HTTP MCP bodies are capped at 8 MiB; proxy chunked bodies at 1 MiB; a captured
proxy response at 1 MiB; one report covers at most 1024 findings; evidence is
capped by
.BR APEX_EVIDENCE_MAX_BYTES .
Both listeners bind loopback only and do not authenticate.
.SH SEE ALSO
.IR docs/operations.md ,
.IR docs/artex\-port.md ,
.I SECURITY.md
and
.I CHANGELOG.md
in the installed documentation directory.
.SH LICENSE
AGPL\-3.0, same as ARTEX.
+2 -1
View File
@@ -31,7 +31,8 @@ make install DESTDIR=/tmp/pkg PREFIX=/usr
```
$PREFIX/bin/apex-twin
$PREFIX/share/doc/apex-twin/README.md
$PREFIX/share/doc/apex-twin/{README,CHANGELOG,SECURITY,operations,artex-port}.md
$PREFIX/share/man/man1/apex-twin.1
$PREFIX/lib/systemd/system/apex-twin.service
$PREFIX/lib/systemd/system/apex-twin-proxy.service
```
+1 -1
View File
@@ -15,7 +15,7 @@
#include "mcp.h"
#define APEX_VERSION "0.29.0"
#define APEX_VERSION "0.30.0"
#define APEX_MAX_OUT (1u << 20)
#define APEX_PATH_MAX 512
#define APEX_PATH_FULL 1024