From df10844720aa467c7d7f3e4717f9039d7a1f82d4 Mon Sep 17 00:00:00 2001 From: Sean Kilfoy <20802814+skilfoy@users.noreply.github.com> Date: Thu, 26 Nov 2026 07:29:49 +0000 Subject: [PATCH] Archive v0.3.14 and turn the unsafe defaults off. This branch is the English archive, not the current product. In-app updates stay off unless ARTEX_UPDATES=1, the release workflow can no longer publish :latest, Terraform rejects a world-open admin CIDR, and CI rejects the known-bad prebuilt images. --- .github/workflows/english.yml | 2 ++ .github/workflows/release.yml | 6 +++- CHANGELOG.md | 4 +++ README.md | 14 +++++--- SECURITY.md | 45 +++++++++++++++++++++++ docker-compose.cloud.yml | 1 + docker-compose.yml | 2 ++ infra/aws/main.tf | 8 ++++- infra/azure/main.tf | 8 ++++- infra/gcp/main.tf | 8 ++++- scripts/check_supply_chain.py | 67 +++++++++++++++++++++++++++++++++++ server/update.go | 25 +++++++++++++ server/updates_gate_test.go | 22 ++++++++++++ 13 files changed, 204 insertions(+), 8 deletions(-) create mode 100644 SECURITY.md create mode 100644 scripts/check_supply_chain.py create mode 100644 server/updates_gate_test.go diff --git a/.github/workflows/english.yml b/.github/workflows/english.yml index 3ac09ed..a6b8803 100644 --- a/.github/workflows/english.yml +++ b/.github/workflows/english.yml @@ -11,3 +11,5 @@ jobs: - uses: actions/checkout@v4 - name: Scan for Han characters, blocked markers, and comment calques run: python3 scripts/check_english.py + - name: Reject known-bad prebuilt images + run: python3 scripts/check_supply_chain.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cbf2e1..3bd87c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,6 +58,10 @@ jobs: run: sha256sum *.zip > SHA256SUMS - uses: softprops/action-gh-release@v2 with: + prerelease: true + make_latest: false + body: | + Archive build of the v0.3.14 English tree. Do not expose this console. The maintained line is the `next` branch. files: | dist/*.zip dist/SHA256SUMS @@ -81,4 +85,4 @@ jobs: push: true tags: | ghcr.io/skilfoy/artex-english:${{ github.ref_name }} - ghcr.io/skilfoy/artex-english:latest + # Never publish :latest from this archive. v0.3.14 is not a current release. diff --git a/CHANGELOG.md b/CHANGELOG.md index a4ec498..31d8a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +- This branch is the v0.3.14 English archive. Do not expose it. The maintained line is `next`. +- In-app updates no longer phone home or install a binary unless `ARTEX_UPDATES=1`. +- Supply-chain CI rejects known-bad prebuilt image names outside the files that document them. +- Terraform `admin_cidr` must be a specific network. `0.0.0.0/0` is rejected. - Company asset counts and the usage ledger now match the rows. The session no longer quotes commands, payloads, or credentials. - Replaced the README gallery with frames from the current production preview. The dashboard frame shows the token chart, and the findings frame shows Northwind. - The sidebar company control filters tasks, assets, and findings to Acme or Northwind. Clearing it shows both. diff --git a/README.md b/README.md index 42ebcf3..4aa8998 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # ARTEX English -An English-language fork of [Autumn-27/ARTEX](https://github.com/Autumn-27/ARTEX), an autonomous security research system with a Go backend, PostgreSQL storage, and a Next.js interface. +> **Archive line, do not expose.** This branch is the natural-English edition of upstream **v0.3.14**. That release has a publicly reported console authentication bypass. Later maintained lines fixed it. Do not put this build on a network, and do not treat it as the current product. +> +> The current line is [`next`](https://github.com/skilfoy/ARTEX-English/tree/next), based on [BaaRai/ARTEX v0.7.0](https://github.com/BaaRai/ARTEX/releases/tag/v0.7.0), with this fork's cloud installer and a defender pack. Read [SECURITY.md](SECURITY.md). In-app updates on this archive are off unless `ARTEX_UPDATES=1`. + +An English-language fork of Autumn-27/ARTEX, an autonomous security research system with a Go backend, PostgreSQL storage, and a Next.js interface. The original repository was deleted on 2026-10-08. The last open upstream tag, v0.3.15, is archived at [Hinln/ARTEX](https://github.com/Hinln/ARTEX). This repository is not ThreatBook RedAgents and it is not an official continuation by the original author. The interface contains task planning, agent sessions, findings, asset graphs, traffic evidence, approval records, model configuration, and system settings. The hosted preview uses simulated data. A functioning local installation requires PostgreSQL and an LLM configuration. @@ -129,8 +133,10 @@ For integrated local development, `./dev.sh` starts the Go backend, traffic prox ## License and use conditions -ARTEX is licensed under the [GNU Affero General Public License, version 3](LICENSE). Preserve the license, source disclosure obligations, and attribution when distributing modified versions or offering them over a network. +ARTEX is licensed under the [GNU Affero General Public License, version 3](LICENSE). Preserve the license, source disclosure obligations, and attribution when distributing modified versions or offering them over a network. If you run this program as a network service, AGPL requires you to offer the corresponding source to users of that service. -The upstream author states that use is restricted to personal study, source code research, and technical verification in a locally isolated environment. The author expressly prohibits scanning, probing, exploiting, or attacking websites, online services, or networked systems, including systems owned by or authorized for the user. The stated restrictions also prohibit actual penetration testing, attack and defense exercises, production use, and unlawful or destructive activity. Users are responsible for applicable legal requirements. The software is provided as is without warranties, and the author disclaims liability for losses arising from its use. The application displays these conditions at login. Consult the [upstream source](https://github.com/Autumn-27/ARTEX/blob/main/README.md) for the author's complete notice. +Run it only in a lab you control, against systems you own or have explicit written authorization to test. Do not expose the console or the recording proxy to the internet. A public census in November 2026 found on the order of a thousand ARTEX consoles reachable from the internet. -This fork acknowledges [Autumn-27 and the upstream contributors](https://github.com/Autumn-27/ARTEX/graphs/contributors). Its English text is a translation and adaptation for accessibility. Git history preserves the upstream source and its original wording. +The original author published a stricter notice, which this build still shows at login and which remains in git history: personal study and local technical verification, and a prohibition on scanning or attacking networked systems. That notice is not erased here. The deleted upstream README is not a living link. Use the v0.3.15 archive at [Hinln/ARTEX](https://github.com/Hinln/ARTEX) when you need the last open upstream tree. + +This fork acknowledges Autumn-27 and the upstream contributors. Its English text is a translation and adaptation for accessibility. Git history preserves the upstream source and its original wording. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..6895a5b --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,45 @@ +# Security + +This repository has two lines. + +| Branch | What it is | Expose it? | +| --- | --- | --- | +| `main` | Natural-English archive of upstream v0.3.14 | No | +| `next` | Operator distribution based on BaaRai/ARTEX v0.7.0, plus this fork's cloud installer and defender pack | Only inside a lab you control | + +`main` inherits a publicly reported console authentication weakness from v0.3.14. Maintained lines after that release fixed it. This archive does not try to re-implement that fix in place. Use `next`, or do not run it. + +## Reporting + +Report vulnerabilities in this fork to the maintainer through [GitHub private vulnerability reporting](https://github.com/skilfoy/ARTEX-English/security) on this repository, or by opening a GitHub security advisory. Do not file an exploit in a public issue. + +This is not the deleted Autumn-27 project and it is not ThreatBook RedAgents. Reports about those belong with their owners. Reports about BaaRai/ARTEX itself also belong [there](https://github.com/BaaRai/ARTEX/blob/main/SECURITY.md) when the behavior is unchanged from that base. + +## What this archive changed + +* In-app updates are off unless `ARTEX_UPDATES=1`. The default path does not contact GitHub and does not swap the binary. +* Local Compose publishes `8787` and `8788` on `127.0.0.1` only. +* The cloud stack does not publish Postgres, the console, or the recording proxy. SSH and the web ports are limited to `admin_cidr`. `admin_cidr` cannot be `0.0.0.0/0`. +* CI rejects the prebuilt image names `tomicdd/artex` and `congdonglinux/artex`. Those images were reported in November 2026 to carry an unauthenticated command backdoor. Build from this source tree. Do not run a community image you did not build. +* There is no recommended GitHub Release of this archive. A tag on `main` is marked a prerelease and is not `latest`. + +## Operator rules + +* Run it only against systems you own or have written authorization to test. +* Do not publish port 8787 or 8788. +* Keep the recording-proxy data and Postgres private. Both can contain credentials from the lab. +* Treat agent tool output as untrusted. The `next` line frames that output by default. This archive does not. +* A self-update that is switched on becomes a remote code path. Leave it off until you are on `next` and you have verified the release checksums yourself. + +## Supply chain + +Build the binary and the container from this repository. Pin anything you mirror. The floating tag `postgres:16-alpine` in Compose is still a gap on `main`; do not "fix" it by switching to an unpublished third-party ARTEX image. + +Known-bad image names, listed so they can be blocked: + +* `tomicdd/artex` +* `congdonglinux/artex` + +## Intended use + +ARTEX can execute commands and send network traffic. That is the product. Authorization is not created by installing it. The original author also displayed a stricter study-only notice at login. That notice remains in this archive. Read it before you start the process. diff --git a/docker-compose.cloud.yml b/docker-compose.cloud.yml index 5c41dc7..ed19ab6 100644 --- a/docker-compose.cloud.yml +++ b/docker-compose.cloud.yml @@ -27,6 +27,7 @@ services: ARTEX_PG_DSN: postgres://artex:${POSTGRES_PASSWORD}@postgres:5432/artex?sslmode=disable ARTEX_DATA_DIR: /app/data ARTEX_KEY_DIR: /app/state + ARTEX_UPDATES: "0" volumes: - ./data:/app/data - appstate:/app/state diff --git a/docker-compose.yml b/docker-compose.yml index 083ac88..03f4d33 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,8 @@ services: ARTEX_LLM_MODEL: ${ARTEX_LLM_MODEL:-} ARTEX_LLM_BASE_URL: ${ARTEX_LLM_BASE_URL:-} ARTEX_LLM_PROXY: ${ARTEX_LLM_PROXY:-} + # Off by default. This archive must not download a replacement binary. + ARTEX_UPDATES: ${ARTEX_UPDATES:-0} ports: - "127.0.0.1:8787:8787" - "127.0.0.1:8788:8788" diff --git a/infra/aws/main.tf b/infra/aws/main.tf index 8d06305..1d4fc78 100644 --- a/infra/aws/main.tf +++ b/infra/aws/main.tf @@ -31,7 +31,13 @@ variable "instance_type" { description = "Optional. Overrides the machine selected by tier. Disk size, swap, and the Node build heap still come from tier." } variable "ssh_public_key" { type = string } -variable "admin_cidr" { type = string } +variable "admin_cidr" { + type = string + validation { + condition = can(cidrhost(var.admin_cidr, 0)) && var.admin_cidr != "0.0.0.0/0" && var.admin_cidr != "::/0" + error_message = "admin_cidr must be a specific CIDR, not the whole internet. Use a /32 or a tight network." + } +} variable "web_cidrs" { type = list(string) default = [] diff --git a/infra/azure/main.tf b/infra/azure/main.tf index caf743c..795c981 100644 --- a/infra/azure/main.tf +++ b/infra/azure/main.tf @@ -31,7 +31,13 @@ variable "vm_size" { description = "Optional. Overrides the size selected by tier. Disk size, swap, and the Node build heap still come from tier." } variable "ssh_public_key" { type = string } -variable "admin_cidr" { type = string } +variable "admin_cidr" { + type = string + validation { + condition = can(cidrhost(var.admin_cidr, 0)) && var.admin_cidr != "0.0.0.0/0" && var.admin_cidr != "::/0" + error_message = "admin_cidr must be a specific CIDR, not the whole internet. Use a /32 or a tight network." + } +} variable "web_cidrs" { type = list(string) default = [] diff --git a/infra/gcp/main.tf b/infra/gcp/main.tf index dee2f18..a70a33e 100644 --- a/infra/gcp/main.tf +++ b/infra/gcp/main.tf @@ -38,7 +38,13 @@ variable "machine_type" { description = "Optional. Overrides the machine selected by tier. Disk size, swap, and the Node build heap still come from tier." } variable "ssh_public_key" { type = string } -variable "admin_cidr" { type = string } +variable "admin_cidr" { + type = string + validation { + condition = can(cidrhost(var.admin_cidr, 0)) && var.admin_cidr != "0.0.0.0/0" && var.admin_cidr != "::/0" + error_message = "admin_cidr must be a specific CIDR, not the whole internet. Use a /32 or a tight network." + } +} variable "web_cidrs" { type = list(string) default = [] diff --git a/scripts/check_supply_chain.py b/scripts/check_supply_chain.py new file mode 100644 index 0000000..1a647e5 --- /dev/null +++ b/scripts/check_supply_chain.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""Fail the build if a tracked file pulls a known-bad ARTEX image. + +The markers are documented on purpose in a short allowlist. Anywhere else +they are a supply-chain failure, not a citation. +""" + +from __future__ import annotations + +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] + +# Image names published as backdoored in November 2026. These are identifiers, +# not instructions. +MARKERS = ( + "tomicdd/artex", + "congdonglinux/artex", +) + +# Files that are allowed to name the bad images so operators can reject them. +ALLOWED = { + "scripts/check_supply_chain.py", + "SECURITY.md", + "README.md", + "CHANGELOG.md", +} + + +def tracked_files() -> list[Path]: + skip_dirs = {".git", "web/node_modules", "node_modules"} + out: list[Path] = [] + for path in ROOT.rglob("*"): + if not path.is_file(): + continue + rel = path.relative_to(ROOT).as_posix() + if any(rel == d or rel.startswith(d + "/") for d in skip_dirs): + continue + if rel in ALLOWED or rel.startswith("detections/"): + continue + out.append(path) + return out + + +def main() -> int: + hits: list[str] = [] + for path in tracked_files(): + try: + text = path.read_text(encoding="utf-8", errors="ignore") + except OSError: + continue + rel = path.relative_to(ROOT).as_posix() + for marker in MARKERS: + if marker in text.lower() or marker in text: + hits.append(f"{rel}: contains {marker}") + if hits: + print("known-bad image reference outside the allowlist:", file=sys.stderr) + for hit in hits: + print(f" {hit}", file=sys.stderr) + return 1 + print(f"supply-chain check ok ({len(list(tracked_files()))} files, markers absent)") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/server/update.go b/server/update.go index 5fb2763..b9f6cda 100644 --- a/server/update.go +++ b/server/update.go @@ -7,13 +7,26 @@ import ( "fmt" "log" "net/http" + "os" "runtime" + "strings" "sync" "time" "github.com/skilfoy/ARTEX-English/selfupdate" ) +// updatesEnabled is off unless an operator opts in. This tree is the v0.3.14 +// English archive: it must not phone home or swap its own binary by default. +func updatesEnabled() bool { + switch strings.ToLower(strings.TrimSpace(os.Getenv("ARTEX_UPDATES"))) { + case "1", "true", "on", "yes": + return true + default: + return false + } +} + // HTTP surface for one-click updates. Download, verification, and swap all live in the selfupdate // package; this file only owns the auth boundary, the single-flight lock, progress broadcast, and telling main "it is time to exit". // @@ -224,6 +237,14 @@ func (s *Server) updateCheck(w http.ResponseWriter, r *http.Request) { "boot_notice": boot.Detail, "rolled_back": boot.RolledBack, } + if !updatesEnabled() { + out["updates_enabled"] = false + out["has_update"] = false + out["reason"] = "In-app updates are disabled. This archive does not fetch or install release binaries. Set ARTEX_UPDATES=1 only if you accept that risk." + writeJSON(w, 200, out) + return + } + out["updates_enabled"] = true // The top-bar hint uses the cache (the default). "Check for updates" passes force=1 and bypasses it. force := r.URL.Query().Get("force") != "" @@ -268,6 +289,10 @@ func (s *Server) updateCheck(w http.ResponseWriter, r *http.Request) { // Returns 202 immediately. The work runs on a background goroutine: a full download can take minutes, // and doing it inside the request would be cut off by a reverse-proxy timeout. Progress is /api/update/stream. func (s *Server) updateApply(w http.ResponseWriter, r *http.Request) { + if !updatesEnabled() { + writeErr(w, 403, "in-app updates are disabled") + return + } current := BuildVersion // Use the cache, so what gets installed is the version the user saw and confirmed in the UI. diff --git a/server/updates_gate_test.go b/server/updates_gate_test.go new file mode 100644 index 0000000..f3de212 --- /dev/null +++ b/server/updates_gate_test.go @@ -0,0 +1,22 @@ +package server + +import "testing" + +func TestUpdatesDisabledByDefault(t *testing.T) { + t.Setenv("ARTEX_UPDATES", "") + if updatesEnabled() { + t.Fatal("updates must be off by default") + } + for _, v := range []string{"0", "false", "no", "off"} { + t.Setenv("ARTEX_UPDATES", v) + if updatesEnabled() { + t.Fatalf("ARTEX_UPDATES=%q should stay off", v) + } + } + for _, v := range []string{"1", "true", "on", "yes"} { + t.Setenv("ARTEX_UPDATES", v) + if !updatesEnabled() { + t.Fatalf("ARTEX_UPDATES=%q should enable updates", v) + } + } +}