domniguard 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,42 @@
1
- # Temporary Holding Version
1
+ # DOmniGuard — AI-Driven Server Security Daemon
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ DOmniGuard is a lightweight, single-binary Linux security daemon combining periodic health/security checks, real-time log/FIM/process/network watchers, HMAC-SHA256 signed webhooks, an MCP (Model Context Protocol) server with a 3-tier policy engine, Telegram Human-in-the-Loop approvals, and SQLite audit & rollback.
4
+
5
+ ## Installation
6
+
7
+ ### Via npm (requires Node.js >= 18 during installation)
8
+ ```bash
9
+ sudo npm install -g domniguard
10
+ sudo domniguard setup
11
+ ```
12
+ Once `domniguard setup` completes, the Go binary is installed at `/usr/local/bin/domniguard` and runs independently of Node.js via systemd or OpenRC.
13
+
14
+ ### Via curl (no Node.js required)
15
+ ```bash
16
+ curl -sSL https://unpkg.com/domniguard/install.sh | sudo bash
17
+ ```
18
+
19
+ ## Quick Commands
20
+ - `domniguard run --config /etc/domniguard/config.yaml` — Run the daemon
21
+ - `domniguard mcp --stdio` — Bridge stdio MCP client to running daemon Unix socket
22
+ - `domniguard validate-config --config /etc/domniguard/config.yaml` — Validate YAML config
23
+ - `domniguard doctor --config /etc/domniguard/config.yaml` — Inspect OS, backends, and connectivity
24
+ - `domniguard actions list|approve|reject|rollback` — Manage approval actions via CLI
25
+ - `domniguard audit show <event_id>` — View incident timeline
26
+ - `domniguard setup` / `domniguard uninstall [--purge]` — Install/remove daemon service
27
+
28
+ ## Webhook Verification (AI Agent Side)
29
+ Every webhook includes:
30
+ - `X-DOmniGuard-Event-Id`
31
+ - `X-DOmniGuard-Timestamp` (Unix seconds)
32
+ - `X-DOmniGuard-Signature`: `sha256=<hex>` computed over `<timestamp>.<raw_body>` using HMAC-SHA256
33
+
34
+ Verify in your agent by rejecting timestamps with `|now - timestamp| > 300` seconds and comparing the HMAC digest in constant time.
35
+
36
+ ## Security Model
37
+ - Non-loopback HTTP MCP server strictly requires TLS (and supports optional mTLS).
38
+ - Hardcoded guardrails cannot be disabled via config: protected admin/private/local IPs, system PIDs/processes, path sandboxing + sensitive file denylist, and strict argument validation (no `sh -c`).
39
+ - Action tools not declared in policies default to `require_approval`.
40
+
41
+ ## License
42
+ UNLICENSED (Proprietary).
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("child_process");
5
+
6
+ const key = `${process.platform}-${process.arch}`;
7
+ const packages = {
8
+ "linux-x64": "domniguard-linux-x64",
9
+ "linux-arm64": "domniguard-linux-arm64",
10
+ };
11
+
12
+ const pkg = packages[key];
13
+ if (!pkg) {
14
+ console.error(`domniguard: unsupported platform ${key} (DOmniGuard runs on Linux x64/arm64 only)`);
15
+ process.exit(1);
16
+ }
17
+
18
+ let binPath;
19
+ try {
20
+ binPath = require.resolve(`${pkg}/bin/domniguard`);
21
+ } catch (err) {
22
+ console.error(`domniguard: failed to locate binary package ${pkg}: ${err.message}`);
23
+ process.exit(1);
24
+ }
25
+
26
+ const res = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
27
+ if (res.error) {
28
+ console.error(`domniguard: failed to execute ${binPath}: ${res.error.message}`);
29
+ process.exit(1);
30
+ }
31
+ process.exit(res.status ?? 1);
package/install.sh ADDED
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [ "$(uname -s)" != "Linux" ]; then
5
+ echo "domniguard: only Linux is supported" >&2
6
+ exit 1
7
+ fi
8
+
9
+ ARCH_RAW="$(uname -m)"
10
+ case "$ARCH_RAW" in
11
+ x86_64|amd64) ARCH="x64" ;;
12
+ aarch64|arm64) ARCH="arm64" ;;
13
+ *)
14
+ echo "domniguard: unsupported CPU architecture: $ARCH_RAW" >&2
15
+ exit 1
16
+ ;;
17
+ esac
18
+
19
+ PKG="domniguard-linux-${ARCH}"
20
+ META_URL="https://registry.npmjs.org/${PKG}/latest"
21
+
22
+ TMP_DIR="$(mktemp -d)"
23
+ trap 'rm -rf "$TMP_DIR"' EXIT
24
+
25
+ echo "Fetching package metadata from npm registry (${ARCH})..."
26
+ curl -fsSL "$META_URL" -o "$TMP_DIR/meta.json"
27
+
28
+ TARBALL_URL="$(python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(d["dist"]["tarball"])' "$TMP_DIR/meta.json" 2>/dev/null || \
29
+ node -e 'const d=require(process.argv[1]); console.log(d.dist.tarball)' "$TMP_DIR/meta.json" 2>/dev/null || \
30
+ grep -oE '"tarball":"[^"]+"' "$TMP_DIR/meta.json" | head -n1 | cut -d'"' -f4)"
31
+
32
+ INTEGRITY="$(python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(d["dist"].get("integrity",""))' "$TMP_DIR/meta.json" 2>/dev/null || \
33
+ node -e 'const d=require(process.argv[1]); console.log(d.dist.integrity||"")' "$TMP_DIR/meta.json" 2>/dev/null || \
34
+ grep -oE '"integrity":"sha512-[^"]+"' "$TMP_DIR/meta.json" | head -n1 | cut -d'"' -f4)"
35
+
36
+ if [ -z "$TARBALL_URL" ]; then
37
+ echo "domniguard: failed to resolve tarball URL from registry metadata" >&2
38
+ exit 1
39
+ fi
40
+
41
+ echo "Downloading $TARBALL_URL..."
42
+ curl -fsSL "$TARBALL_URL" -o "$TMP_DIR/pkg.tgz"
43
+
44
+ if [ -n "$INTEGRITY" ] && [[ "$INTEGRITY" == sha512-* ]]; then
45
+ EXPECTED_B64="${INTEGRITY#sha512-}"
46
+ if command -v openssl >/dev/null 2>&1; then
47
+ ACTUAL_B64="$(openssl dgst -sha512 -binary "$TMP_DIR/pkg.tgz" | openssl base64 -A)"
48
+ elif command -v python3 >/dev/null 2>&1; then
49
+ ACTUAL_B64="$(python3 -c 'import base64,hashlib,sys; print(base64.b64encode(hashlib.sha512(open(sys.argv[1],"rb").read()).digest()).decode())' "$TMP_DIR/pkg.tgz")"
50
+ else
51
+ ACTUAL_B64=""
52
+ fi
53
+ if [ -n "$ACTUAL_B64" ] && [ "$ACTUAL_B64" != "$EXPECTED_B64" ]; then
54
+ echo "domniguard: integrity verification failed!" >&2
55
+ exit 1
56
+ fi
57
+ echo "Verified SHA-512 integrity."
58
+ fi
59
+
60
+ tar -xzf "$TMP_DIR/pkg.tgz" -C "$TMP_DIR"
61
+ BIN_PATH="$TMP_DIR/package/bin/domniguard"
62
+ chmod +x "$BIN_PATH"
63
+
64
+ exec "$BIN_PATH" setup "$@"
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "domniguard",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "DOmniGuard AI-Driven Linux Server Security Daemon (MCP + Webhook)",
5
+ "license": "UNLICENSED",
6
+ "bin": {
7
+ "domniguard": "bin/domniguard.js"
8
+ },
9
+ "files": [
10
+ "bin/domniguard.js",
11
+ "install.sh",
12
+ "README.md"
13
+ ],
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "optionalDependencies": {
18
+ "domniguard-linux-x64": "0.1.0",
19
+ "domniguard-linux-arm64": "0.1.0"
20
+ }
21
+ }