@atbash/cli 0.3.9-dev.12 → 0.3.9-dev.15

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/dist/config.js DELETED
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CONFIG_FILE = void 0;
37
- exports.loadConfig = loadConfig;
38
- exports.saveConfig = saveConfig;
39
- exports.resolveAgentKey = resolveAgentKey;
40
- exports.resolveOrgName = resolveOrgName;
41
- exports.resolveEndpoint = resolveEndpoint;
42
- exports.resolveProvider = resolveProvider;
43
- exports.resolveProviderApiKey = resolveProviderApiKey;
44
- exports.resolveProviderEndpoint = resolveProviderEndpoint;
45
- exports.resolveProviderModel = resolveProviderModel;
46
- exports.resolveBlockchainRid = resolveBlockchainRid;
47
- const fs = __importStar(require("fs"));
48
- const path = __importStar(require("path"));
49
- const os = __importStar(require("os"));
50
- const CONFIG_FILE = path.join(os.homedir(), ".atbashrc.json");
51
- exports.CONFIG_FILE = CONFIG_FILE;
52
- function loadConfig() {
53
- try {
54
- if (fs.existsSync(CONFIG_FILE)) {
55
- const raw = fs.readFileSync(CONFIG_FILE, "utf-8");
56
- if (!raw.trim())
57
- return {};
58
- return JSON.parse(raw);
59
- }
60
- }
61
- catch (err) {
62
- console.error("Failed to load config file", err);
63
- }
64
- return {};
65
- }
66
- function saveConfig(config) {
67
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", "utf-8");
68
- }
69
- /** Resolve a config value with priority: flag > env > file */
70
- function resolveAgentKey(flagValue) {
71
- return flagValue || process.env.ATBASH_AGENT_KEY || loadConfig().agentKey;
72
- }
73
- function resolveOrgName(flagValue) {
74
- return flagValue || process.env.ATBASH_ORG_NAME || loadConfig().orgName;
75
- }
76
- function resolveEndpoint(flagValue) {
77
- return flagValue || process.env.ATBASH_ENDPOINT || loadConfig().judgeEndpoint;
78
- }
79
- function resolveProvider(flagValue) {
80
- return flagValue || process.env.ATBASH_PROVIDER || loadConfig().provider || "";
81
- }
82
- function resolveProviderApiKey(flagValue) {
83
- return flagValue || process.env.ATBASH_PROVIDER_API_KEY || loadConfig().providerApiKey || "";
84
- }
85
- function resolveProviderEndpoint(flagValue) {
86
- return flagValue || process.env.ATBASH_PROVIDER_ENDPOINT || loadConfig().providerEndpoint || "";
87
- }
88
- function resolveProviderModel(flagValue) {
89
- return flagValue || process.env.ATBASH_PROVIDER_MODEL || loadConfig().providerModel || "";
90
- }
91
- function resolveBlockchainRid(flagValue) {
92
- return flagValue || process.env.ATBASH_BLOCKCHAIN_RID || loadConfig().blockchainRid || "";
93
- }
94
- //# sourceMappingURL=config.js.map
@@ -1 +0,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AO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,SAAgB,eAAe,CAAC,SAAkB;IAChD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU,EAAE,CAAC,aAAa,CAAC;AAChF,CAAC;AAED,SAAgB,eAAe,CAAC,SAAkB;IAChD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC;AACjF,CAAC;AAED,SAAgB,qBAAqB,CAAC,SAAkB;IACtD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,UAAU,EAAE,CAAC,cAAc,IAAI,EAAE,CAAC;AAC/F,CAAC;AAED,SAAgB,uBAAuB,CAAC,SAAkB;IACxD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,UAAU,EAAE,CAAC,gBAAgB,IAAI,EAAE,CAAC;AAClG,CAAC;AAED,SAAgB,oBAAoB,CAAC,SAAkB;IACrD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,UAAU,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC;AAC5F,CAAC;AAED,SAAgB,oBAAoB,CAAC,SAAkB;IACrD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,UAAU,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC;AAC5F,CAAC"}
package/dist/presets.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * Reference policy shapes for the Atbash CLI.
3
- *
4
- * These are reference packs — the starting points an operator might author
5
- * against. They match the format produced by the dashboard's
6
- * buildCompactPolicyText(). Production policies are authored, versioned, and
7
- * signed in the dashboard, not loaded from here.
8
- */
9
- export declare const PRESETS: Record<string, {
10
- name: string;
11
- description: string;
12
- policy: string;
13
- }>;
14
- export declare function listPresets(): string[];
package/dist/presets.js DELETED
@@ -1,73 +0,0 @@
1
- "use strict";
2
- /**
3
- * Reference policy shapes for the Atbash CLI.
4
- *
5
- * These are reference packs — the starting points an operator might author
6
- * against. They match the format produced by the dashboard's
7
- * buildCompactPolicyText(). Production policies are authored, versioned, and
8
- * signed in the dashboard, not loaded from here.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.PRESETS = void 0;
12
- exports.listPresets = listPresets;
13
- exports.PRESETS = {
14
- strict: {
15
- name: "Strict",
16
- description: "Reference shape for privileged-ops agents — blocks IAM elevation, credential export, and bulk exfil; holds every cross-border or over-threshold transfer",
17
- policy: `Agent Policy
18
- Risk: high
19
-
20
- Enabled rules:
21
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $1,000) <!--f1-->
22
- - [Financial] HIGH -> HOLD when Cross-border transactions (threshold: All) <!--f2-->
23
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA confirmation (threshold: Any amount) <!--f3-->
24
- - [Financial] HIGH -> HOLD when Invoice generation or payment request above threshold (threshold: $5,000) <!--f5-->
25
- - [Financial] CRITICAL -> BLOCK when Access to payment gateway API keys or merchant credentials (threshold: Any) <!--f6-->
26
- - [Communication] HIGH -> BLOCK when Mass emails exceeding recipient threshold without approval (threshold: 50 recipients) <!--c2-->
27
- - [Communication] CRITICAL -> BLOCK when Outbound messages to domains on blocklist (threshold: Custom list) <!--c5-->
28
- - [Communication] CRITICAL -> BLOCK when Sending messages impersonating another user or agent (threshold: Any) <!--c7-->
29
- - [File system] CRITICAL -> BLOCK when Read/write to restricted directories (threshold: /etc, /var, ~/.ssh) <!--fs1-->
30
- - [File system] CRITICAL -> BLOCK when Access to credential or secret files (threshold: .env, config, secrets.*) <!--fs3-->
31
- - [Code execution] CRITICAL -> BLOCK when Elevated privilege commands (threshold: sudo, chmod, rm -rf) <!--ce1-->
32
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
33
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->
34
- - [Network] CRITICAL -> BLOCK when Data exfiltration exceeding size (threshold: 10 MB) <!--nw4-->
35
- - [Accounts] CRITICAL -> BLOCK when Privilege escalation or admin scope requests (threshold: Any) <!--ai1-->
36
- - [Accounts] CRITICAL -> BLOCK when Password or credential reset attempts (threshold: Any) <!--ai4-->`,
37
- },
38
- moderate: {
39
- name: "Moderate",
40
- description: "Reference shape for business-ops agents — blocks clear red lines, holds mid-blast-radius actions for human review",
41
- policy: `Agent Policy
42
- Risk: medium
43
-
44
- Enabled rules:
45
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $5,000) <!--f1-->
46
- - [Financial] HIGH -> HOLD when Cross-border transactions (threshold: All) <!--f2-->
47
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA (threshold: Any amount) <!--f3-->
48
- - [Financial] LOW -> PASS when Recurring payments to pre-approved vendors under threshold (threshold: $500) <!--f4-->
49
- - [Communication] MEDIUM -> HOLD when Emails to external domains with large attachments (threshold: 5 MB) <!--c1-->
50
- - [Communication] HIGH -> BLOCK when Mass emails exceeding recipient threshold (threshold: 50 recipients) <!--c2-->
51
- - [Communication] CRITICAL -> BLOCK when Outbound messages to domains on blocklist (threshold: Custom list) <!--c5-->
52
- - [Code execution] CRITICAL -> BLOCK when Elevated privilege commands (threshold: sudo, chmod, rm -rf) <!--ce1-->
53
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
54
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->`,
55
- },
56
- minimal: {
57
- name: "Minimal",
58
- description: "Reference shape for audit-tier rollout — only the categorical red lines, intended for observation before enforcement is turned on",
59
- policy: `Agent Policy
60
- Risk: low
61
-
62
- Enabled rules:
63
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $10,000) <!--f1-->
64
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA (threshold: Any amount) <!--f3-->
65
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
66
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->
67
- - [Network] CRITICAL -> BLOCK when Data exfiltration exceeding size (threshold: 10 MB) <!--nw4-->`,
68
- },
69
- };
70
- function listPresets() {
71
- return Object.keys(exports.PRESETS);
72
- }
73
- //# sourceMappingURL=presets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA8DH,kCAEC;AA9DY,QAAA,OAAO,GAA0E;IAC5F,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0JAA0J;QACvK,MAAM,EAAE;;;;;;;;;;;;;;;;;;;sGAmB0F;KACnG;IAED,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,mHAAmH;QAChI,MAAM,EAAE;;;;;;;;;;;;;6HAaiH;KAC1H;IAED,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,mIAAmI;QAChJ,MAAM,EAAE;;;;;;;;kGAQsF;KAC/F;CACF,CAAC;AAEF,SAAgB,WAAW;IACzB,OAAO,MAAM,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC9B,CAAC"}