Repository navigation
Done
Description
I was using 0.6.0 via docker (installed using the quickstart steps) and upgraded today by reissuing the quickstart steps; the container did not start and this was the error message in the logs:
_ ____ _____ _______ __
/ \ | _ \_ _| ____\ \/ /
/ _ \ | |_) || | | _| \ /
/ ___ \| _ < | | | |___ / \
/_/ \_\_| \_\|_| |_____/_/\_\
AI autonomous penetration testing system
version 0.7.0-367-gb8cd251 · linux/amd64 · go1.26.11 · listening on :8787
2026/11/28 17:30:24 INFO [config] snapshot {"version":"0.7.0-367-gb8cd251","config_file":"/app/config.json","config_file_found":false,"pg_dsn":"postgres://artex:xxxxx@postgres:5432/artex?sslmode=disable","pg_dsn_source":"environment variables ARTEX_PG_HOST/USER/PASSWORD/DBNAME","data_dir":"/app/data","skill_dir":"/app/skills","key_dir":"/app/keys","addr":":8787","proxy":":8788","noise_profile":"off","untrusted_boundary":true,"trusted_proxies":[]}
2026/11/28 17:30:24 [exec] agent processes run as uid 10001 gid 10001; the run directories under /app/data/tasks are shared with that group
2026/11/28 17:30:24 ERROR [config] enforce isolation failed err="agent isolation self-test failed: the file tools can read /app/data/traffic/_ca/mitmproxy-ca.pem; Bash can read /app/data/traffic/_ca/mitmproxy-ca.pem. A Linux server running as root with the privilege drop does not start without agent isolation: fix the cause above, or pass -dev-insecure-no-isolation for development only"
[artex] abnormal exit (code=1), restarting in 60s
Adding the -dev-insecure-no-isolation parameter to the start.sh script allow the container to start but I get a red warning message on top stating "Agent isolation is degraded: agent shells, tools and file tools run with the server's identity and may read its keys, config and database credentials."
Here are the permissions:
root@cde505d8b487:/app/data/traffic/_ca# ls -al
total 15
drwxr-xr-x 2 root root 5 Nov 19 12:40 .
drwxr-xr-x 5 root root 5 Nov 19 12:40 ..
-rw-r--r-- 1 root root 1257 Nov 19 12:40 mitmproxy-ca-cert.cer
-rw-r--r-- 1 root root 1257 Nov 19 12:40 mitmproxy-ca-cert.pem
-rw------- 1 root root 2961 Nov 19 12:40 mitmproxy-ca.pem
root@cde505d8b487:/app/data/traffic/_ca#
Reacted by github-actions
Activity
github-actions commentedon Nov 28, 2026
Thanks — this is a bug: the startup isolation self-test detects that
/app/data/traffic/_ca/mitmproxy-ca.pemis readable by the agent identity (uid/gid 10001), and the server fails closed instead of starting. Using-dev-insecure-no-isolationonly masks it, as the warning says.To reproduce and fix we still need:
docker-compose.ymlvariant,start.sh, or plaindocker run), plus the diff from your 0.6.0 setup/app/data,user:,group_add,read_only, umaskls -lnaR /app/data/traffic/_caandstaton the data dir, inside the containerI'm not certain from the summary which code path owns the CA-directory permissions, so the above details matter.
🤖 automated reply from the repo bot. A human maintainer reads everything. Ping me in any comment with
@artex-bot.Dukotah commentedon Nov 28, 2026
The permissions in that listing are already correct, which I think points this away from a permissions fix and at the self-test's access check.
0600 root:rootis exactly whattraffic.Opensets (traffic/traffic.go:352), and uid 10001 should not be able to open it. So the mode bits and the self-test disagree.Why I do not think this is ARTEX's privilege drop
Both probes failed, and they reach the filesystem by two unrelated mechanisms:
fsuid/fsgid/setgroupson a locked thread (agent/filetools_identity_linux.go), and a non-zero fsuid is what clearsCAP_DAC_OVERRIDE/CAP_DAC_READ_SEARCHfor that threadenterFileIdentityalso reads the ids back and fails loudly if they did not take, and that is not the error reported here — the ids took, and the open still succeeded. Two independent mechanisms agreeing that a0600 root:rootfile is readable is more consistent with the filesystem not enforcing the mode than with the drop being broken.The tell in that listing
The directory's
st_sizeis 5, which is the number of entries (.,.., three files), not a block size like 4096. Reporting directory size as the dirent count is characteristic of ZFS. The parent showing5for its own five entries fits the same pattern.That matters because on ZFS access can be granted by NFSv4 ACLs that the mode bits do not describe, and
ls -lshows no trailing+for them unless the dataset isacltype=posixacl. A dataset carrying a permissive inherited ACL would display-rw-------and still allow uid 10001 to open the file — which is exactly the contradiction in this report.I want to be clear this is a hypothesis from one
lsoutput, not something I have reproduced.Commands that would settle it
Inside the container, with the data volume mounted:
Step 4 splits the two possibilities cleanly. If it prints
READABLE, the data directory is on a filesystem or ACL configuration that does not enforce the mode, and the self-test is right to fail closed — the fix is on the volume, not in ARTEX. If it printsrefused, the self-test has a false positive and the bug is in the probe.On the host, also worth having:
zfs get acltype,aclmode,aclinherit,xattr <dataset>if this is ZFS, and whether the./datapath in the compose file is a bind mount onto that dataset.A suggestion either way
Whichever way step 4 goes, the current message sends a reporter to the wrong place. It names the path and says the file tools can read it, which reads as "your permissions are wrong" — and here the permissions are right, so the reporter reasonably went to
ls, found nothing wrong, and reached for-dev-insecure-no-isolation.I would include in the failure what made the read succeed: the
fsuid/fsgidactually in effect for the probe,st_mode/st_uid/st_gidasstat()returned them, and the filesystem type fromstatfs. For this report that would have printed something likefsuid=10001 mode=0600 uid=0 gid=0 fs=zfs, which states the contradiction outright and points at the volume instead of at the file.That is a small, self-contained change to
fileToolIsolationFailuresand its Bash counterpart. Happy to send it as a PR if it is wanted — it is useful independently of what is causing this particular report, since right now a false positive and a genuinely unenforced volume produce the same message.Z0l commentedon Nov 29, 2026
Thanks for the detailed response, please find below the output of the 5 commands. An additional note on my setup: ARTEX is running in a docker container inside an lxc container on proxmox. Let me know if there is anything else I can help with.
jamesKhor commentedon Nov 30, 2026
Thanks @Z0l for checking the key as uid 10001. We haven’t reproduced the failure on your Docker-in-LXC/ZFS setup. We found that the two startup probes report success opening the path for reading. The directory fixture we tested in #700 doesn't establish what happened with your regular CA key.
One detail that might explain the different observations is timing. In your build (
b8cd251), the isolation check runs before the traffic store opens. Opening the store sets the existing CA key to0600. Did you runstatandsetprivbefore or after the first successful start with the development flag? If you’ve since restarted the same image with the same volume and the flag removed, did the error recur?If you already have a pre-upgrade snapshot, this command in its ARTEX data directory prints just the old permissions and ownership:
stat -c 'mode=%a owner=%u:%g type=%F' traffic/_ca/mitmproxy-ca.pem. No need to restore a snapshot or share the key itself. We’re keeping #700 focused on reporting what the probes saw at startup.Z0l commentedon Nov 30, 2026
I ran the
statandsetprivcommands after the first successful start. As I don't have a pre-upgrade snapshot, I have edited start.sh and removed the development flag and can confirm the container starts successfully and the warning message is gone.fix(security): stub LockDownCAKey on non-unix builds (BaaRai#664)
fix(security): tighten CA key permissions before startup isolation ch…
Merge pull request #763 from kalt2212/fix/tighten-ca-key-startup-orde…
BaaRai commentedon Dec 1, 2026
Fixed on main by #763, and it will be in the next release. The startup lockdown now tightens /app/data/traffic/_ca/mitmproxy-ca.pem to 0600 before the isolation self-test runs, so a CA key left 0644 by an older version (the /app/d... path in your log) no longer fails the start after an upgrade. A symlinked CA key is refused and still fails closed. Workaround on 0.7.0/0.7.1 until that release: stop the stack, run chmod 600 data/traffic/_ca/mitmproxy-ca.pem on the host, then start it again. Your existing data directory is kept.
test: CA key lockdown against symlinked parents, hard links and non-r…
fix(security): tighten CA key permissions before startup isolation ch…
fix(security): stub LockDownCAKey on non-unix builds (BaaRai#664)
Merge pull request BaaRai#763 from kalt2212/fix/tighten-ca-key-startu…
test: CA key lockdown against symlinked parents, hard links and non-r…