@kubbisec/ai-win32-x64 0.1.13 → 0.1.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/bin/kubbisec.exe +0 -0
- package/bundled/config/config.d.ts.map +1 -1
- package/bundled/config/config.js +4 -1
- package/bundled/config/config.js.map +1 -1
- package/bundled/copy/cli-reference-index.d.ts +2 -2
- package/bundled/copy/cli-reference-index.d.ts.map +1 -1
- package/bundled/copy/cli-reference-index.js +26 -6
- package/bundled/copy/cli-reference-index.js.map +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/cli-auth.types.d.ts +1 -0
- package/bundled/node_modules/@kubbisec/home/dist/cli-auth.types.d.ts.map +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/cli-auth.types.js +16 -3
- package/bundled/node_modules/@kubbisec/home/dist/cli-auth.types.js.map +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/index.d.ts +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/index.d.ts.map +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/index.js +1 -1
- package/bundled/node_modules/@kubbisec/home/dist/index.js.map +1 -1
- package/bundled/skills/aspm-platform/SKILL.md +9 -4
- package/package.json +1 -1
package/bin/kubbisec.exe
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAYpD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAwB3E;AAED,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED,wBAAgB,aAAa,IAAI,cAAc,CAY9C"}
|
package/bundled/config/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as os from "node:os";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import { getAiStateDir, getKubbisecConfigPath, resolveKubbisecApiUrl } from "@kubbisec/home";
|
|
4
|
+
import { DEFAULT_KUBBISEC_API_URL, getAiStateDir, getKubbisecConfigPath, resolveKubbisecApiUrl, } from "@kubbisec/home";
|
|
5
5
|
export function getKubbisecStateDir() {
|
|
6
6
|
return getAiStateDir();
|
|
7
7
|
}
|
|
@@ -40,6 +40,9 @@ export function saveConfig(partial) {
|
|
|
40
40
|
defaultProject: next.defaultProject,
|
|
41
41
|
clientId: next.clientId,
|
|
42
42
|
};
|
|
43
|
+
if (next.apiUrl !== DEFAULT_KUBBISEC_API_URL) {
|
|
44
|
+
persisted.apiUrl = next.apiUrl;
|
|
45
|
+
}
|
|
43
46
|
fs.writeFileSync(getKubbisecConfigPath(), `${JSON.stringify(persisted, null, 2)}\n`, {
|
|
44
47
|
mode: 0o600,
|
|
45
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[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,MAAM,CAAC;QACzC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,SAAS;QACrC,cAAc,EAAE,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,SAAS;QACvD,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compact CLI index preloaded into kubbisec chat system prompt.
|
|
3
|
-
* Keep in sync with apps/web/.../aspm-commands.md and
|
|
3
|
+
* Keep in sync with apps/web/.../aspm-commands.md, naus-commands.md, and ai-commands.md.
|
|
4
4
|
*/
|
|
5
|
-
export declare const KUBBISEC_CLI_REFERENCE_INDEX = "<cli-reference-index>\nASPM CLI (npm install -g @kubbisec/aspm):\n| Command | Purpose |\n| aspm init | Interactive setup |\n| aspm login | Configure credentials |\n| aspm whoami | Show current config |\n| aspm doctor | Diagnose configuration |\n| aspm scan <file> -s <source> | Local parse only (no API upload) |\n| aspm parse <file> -s <source> | Local dry-run parse |\n| aspm upload <file> -s <source> | Upload security report to API |\n| aspm coverage <file> | Upload coverage (lcov) |\n| aspm parse-coverage <file> | Local coverage parse |\n| aspm projects | List org projects |\n| aspm dashboard |
|
|
5
|
+
export declare const KUBBISEC_CLI_REFERENCE_INDEX = "<cli-reference-index>\nASPM CLI (npm install -g @kubbisec/aspm):\n| Command | Purpose |\n| aspm init | Interactive setup |\n| aspm login | Configure credentials |\n| aspm whoami | Show current config |\n| aspm doctor | Diagnose configuration |\n| aspm scan <file> -s <source> | Local parse only (no API upload) |\n| aspm parse <file> -s <source> | Local dry-run parse |\n| aspm upload <file> -s <source> | Upload security report to API |\n| aspm coverage <file> | Upload coverage (lcov) |\n| aspm parse-coverage <file> | Local coverage parse |\n| aspm gate | Evaluate local reports against inline rules |\n| aspm projects | List org projects |\n| aspm dashboard | Terminal security posture summary |\nGlobal flags: -k/--api-key, -o/--org (org slug, e.g. minha-empresa), -p/--project\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix aspm_\nEnv: KUBBISEC_API_KEY, KUBBISEC_ORG_ID (slug), KUBBISEC_PROJECT (aliases ASPM_API_URL, ASPM_API_KEY, ASPM_ORG_ID)\nScanners (-s): trivy, gitleaks, syft, osv, semgrep, sonar, nmap, skipfish\nReport files: trivy-report.json, gitleaks-report.json, sbom.json, osv-report.json, semgrep-report.json, sonar-report.json, nmap-report.xml, skipfish-report.json\nPer-scanner install (Linux/macOS/Windows): kubbisec://aspm/aspm-scanner-{name} (e.g. aspm-scanner-trivy, aspm-scanner-semgrep)\nCoverage frameworks: kubbisec://aspm/aspm-coverage (Jest, Vitest, pytest, JaCoCo\u2192lcov, PHPUnit/clover, Go)\n\nNAUS CLI (npm install -g @kubbisec/naus):\n| Command | Purpose |\n| naus register [token] [--renew] | Enroll runner (mTLS bootstrap) |\n| naus start [--daemon] [--allow-privileged] | Start runner daemon |\n| naus migrate | Migrate legacy token runner to mTLS |\n| naus validate <file> / naus check <file> | Validate pipeline YAML |\n| naus plan <file> [--format mermaid] | Show dependency waves |\n| naus run <file> | Execute pipeline locally |\n| naus daemon list / naus daemon stop | Background runner sessions |\nDefault pipeline file: .naus.yml\nLocal env: naus run .naus.yml [--env-file .env] [--secret-file .secrets|.secret] (repeatable; defaults .env/.secrets in cwd).\nCloud secrets: Env Packs in KubbiSec UI (not .secrets on remote runner).\nEnv: NAUS_BOOTSTRAP_TOKEN, NAUS_RENEW_RUNNER\n\nKubbiSec AI CLI (npm install -g @kubbisec/ai):\n| Command | Purpose |\n| kubbisec login / logout / whoami | API session |\n| kubbisec doctor | Diagnose CLI setup |\n| kubbisec ls / show <id> | List/show findings |\n| kubbisec fix <id> [-m auto] | AI remediation |\n| kubbisec chat | Interactive terminal chat |\n| kubbisec do [intent] | Orchestrated agent run |\n| kubbisec watch [--logs] | Remediation queue daemon |\n| kubbisec daemon list|logs|stop | Manage watch sessions |\n| kubbisec ap | Trigger Autopilot cycle |\n| kubbisec naus \u2026 / kubbisec aspm \u2026 | CLI hub forwarding |\nAPI key: Perfil \u2192 API Keys (/profile/api-keys), prefix kbs_\nOrg: -o minha-empresa (slug)\nFull docs: kubbisec://ai/README, section ai-commands\n\nNAUS YAML (NOT GitHub Actions): top-level run: (never jobs:); script: + depends_on: (never commands:/needs:); ASPM jobs kind: aspm|aspm_matrix|aspm_gate with tool: (never scanner:).\nFull docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration), kubbisec://ai/* (KubbiSec AI CLI).\naspm-cicd.md is GitHub Actions only \u2014 do not use for NAUS pipelines.\n</cli-reference-index>";
|
|
6
6
|
//# sourceMappingURL=cli-reference-index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-reference-index.d.ts","sourceRoot":"","sources":["../../src/copy/cli-reference-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"cli-reference-index.d.ts","sourceRoot":"","sources":["../../src/copy/cli-reference-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,y3GAwDlB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compact CLI index preloaded into kubbisec chat system prompt.
|
|
3
|
-
* Keep in sync with apps/web/.../aspm-commands.md and
|
|
3
|
+
* Keep in sync with apps/web/.../aspm-commands.md, naus-commands.md, and ai-commands.md.
|
|
4
4
|
*/
|
|
5
5
|
export const KUBBISEC_CLI_REFERENCE_INDEX = `<cli-reference-index>
|
|
6
6
|
ASPM CLI (npm install -g @kubbisec/aspm):
|
|
@@ -14,17 +14,21 @@ ASPM CLI (npm install -g @kubbisec/aspm):
|
|
|
14
14
|
| aspm upload <file> -s <source> | Upload security report to API |
|
|
15
15
|
| aspm coverage <file> | Upload coverage (lcov) |
|
|
16
16
|
| aspm parse-coverage <file> | Local coverage parse |
|
|
17
|
+
| aspm gate | Evaluate local reports against inline rules |
|
|
17
18
|
| aspm projects | List org projects |
|
|
18
|
-
| aspm dashboard |
|
|
19
|
-
Global flags: -k/--api-key, -o/--org, -p/--project
|
|
20
|
-
|
|
19
|
+
| aspm dashboard | Terminal security posture summary |
|
|
20
|
+
Global flags: -k/--api-key, -o/--org (org slug, e.g. minha-empresa), -p/--project
|
|
21
|
+
API key: Perfil → API Keys (/profile/api-keys), prefix aspm_
|
|
22
|
+
Env: KUBBISEC_API_KEY, KUBBISEC_ORG_ID (slug), KUBBISEC_PROJECT (aliases ASPM_API_URL, ASPM_API_KEY, ASPM_ORG_ID)
|
|
21
23
|
Scanners (-s): trivy, gitleaks, syft, osv, semgrep, sonar, nmap, skipfish
|
|
22
24
|
Report files: trivy-report.json, gitleaks-report.json, sbom.json, osv-report.json, semgrep-report.json, sonar-report.json, nmap-report.xml, skipfish-report.json
|
|
25
|
+
Per-scanner install (Linux/macOS/Windows): kubbisec://aspm/aspm-scanner-{name} (e.g. aspm-scanner-trivy, aspm-scanner-semgrep)
|
|
26
|
+
Coverage frameworks: kubbisec://aspm/aspm-coverage (Jest, Vitest, pytest, JaCoCo→lcov, PHPUnit/clover, Go)
|
|
23
27
|
|
|
24
28
|
NAUS CLI (npm install -g @kubbisec/naus):
|
|
25
29
|
| Command | Purpose |
|
|
26
30
|
| naus register [token] [--renew] | Enroll runner (mTLS bootstrap) |
|
|
27
|
-
| naus start | Start runner daemon |
|
|
31
|
+
| naus start [--daemon] [--allow-privileged] | Start runner daemon |
|
|
28
32
|
| naus migrate | Migrate legacy token runner to mTLS |
|
|
29
33
|
| naus validate <file> / naus check <file> | Validate pipeline YAML |
|
|
30
34
|
| naus plan <file> [--format mermaid] | Show dependency waves |
|
|
@@ -35,8 +39,24 @@ Local env: naus run .naus.yml [--env-file .env] [--secret-file .secrets|.secret]
|
|
|
35
39
|
Cloud secrets: Env Packs in KubbiSec UI (not .secrets on remote runner).
|
|
36
40
|
Env: NAUS_BOOTSTRAP_TOKEN, NAUS_RENEW_RUNNER
|
|
37
41
|
|
|
42
|
+
KubbiSec AI CLI (npm install -g @kubbisec/ai):
|
|
43
|
+
| Command | Purpose |
|
|
44
|
+
| kubbisec login / logout / whoami | API session |
|
|
45
|
+
| kubbisec doctor | Diagnose CLI setup |
|
|
46
|
+
| kubbisec ls / show <id> | List/show findings |
|
|
47
|
+
| kubbisec fix <id> [-m auto] | AI remediation |
|
|
48
|
+
| kubbisec chat | Interactive terminal chat |
|
|
49
|
+
| kubbisec do [intent] | Orchestrated agent run |
|
|
50
|
+
| kubbisec watch [--logs] | Remediation queue daemon |
|
|
51
|
+
| kubbisec daemon list|logs|stop | Manage watch sessions |
|
|
52
|
+
| kubbisec ap | Trigger Autopilot cycle |
|
|
53
|
+
| kubbisec naus … / kubbisec aspm … | CLI hub forwarding |
|
|
54
|
+
API key: Perfil → API Keys (/profile/api-keys), prefix kbs_
|
|
55
|
+
Org: -o minha-empresa (slug)
|
|
56
|
+
Full docs: kubbisec://ai/README, section ai-commands
|
|
57
|
+
|
|
38
58
|
NAUS YAML (NOT GitHub Actions): top-level run: (never jobs:); script: + depends_on: (never commands:/needs:); ASPM jobs kind: aspm|aspm_matrix|aspm_gate with tool: (never scanner:).
|
|
39
|
-
Full docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration).
|
|
59
|
+
Full docs via tools: aspm_docs (section aspm-commands), naus_pipeline_docs (naus-commands, naus-pipeline-overview, naus-aspm-integration), kubbisec://ai/* (KubbiSec AI CLI).
|
|
40
60
|
aspm-cicd.md is GitHub Actions only — do not use for NAUS pipelines.
|
|
41
61
|
</cli-reference-index>`;
|
|
42
62
|
//# sourceMappingURL=cli-reference-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-reference-index.js","sourceRoot":"","sources":["../../src/copy/cli-reference-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG
|
|
1
|
+
{"version":3,"file":"cli-reference-index.js","sourceRoot":"","sources":["../../src/copy/cli-reference-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAwDrB,CAAC"}
|
|
@@ -8,6 +8,7 @@ export type CliAuthContext = {
|
|
|
8
8
|
organizations: CliAuthOrganization[];
|
|
9
9
|
apiKeyScope: "organization" | "user";
|
|
10
10
|
};
|
|
11
|
+
export declare function matchCliOrganization(organizations: CliAuthOrganization[], ref: string): CliAuthOrganization | undefined;
|
|
11
12
|
/**
|
|
12
13
|
* Picks organization for CLI login when no interactive picker is needed.
|
|
13
14
|
* Returns null when the caller must prompt (multiple orgs, no --org flag).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-auth.types.d.ts","sourceRoot":"","sources":["../src/cli-auth.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqB9F"}
|
|
1
|
+
{"version":3,"file":"cli-auth.types.d.ts","sourceRoot":"","sources":["../src/cli-auth.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,mBAAmB,EAAE,EACpC,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,SAAS,CASjC;AAMD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqB9F"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
export function matchCliOrganization(organizations, ref) {
|
|
2
|
+
const trimmed = ref.trim();
|
|
3
|
+
if (!trimmed)
|
|
4
|
+
return undefined;
|
|
5
|
+
const byId = organizations.find((org) => org.id === trimmed);
|
|
6
|
+
if (byId)
|
|
7
|
+
return byId;
|
|
8
|
+
const normalized = trimmed.toLowerCase();
|
|
9
|
+
return organizations.find((org) => org.slug.toLowerCase() === normalized);
|
|
10
|
+
}
|
|
11
|
+
function formatOrganizationChoices(organizations) {
|
|
12
|
+
return organizations.map((o) => `${o.name} (${o.slug})`).join(", ");
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Picks organization for CLI login when no interactive picker is needed.
|
|
3
16
|
* Returns null when the caller must prompt (multiple orgs, no --org flag).
|
|
@@ -5,11 +18,11 @@
|
|
|
5
18
|
export function pickLoginOrganization(context, orgFlag) {
|
|
6
19
|
const trimmedFlag = orgFlag?.trim();
|
|
7
20
|
if (trimmedFlag) {
|
|
8
|
-
const match = context.organizations
|
|
21
|
+
const match = matchCliOrganization(context.organizations, trimmedFlag);
|
|
9
22
|
if (!match) {
|
|
10
|
-
throw new Error(`Organization "${trimmedFlag}" is not available for this API key
|
|
23
|
+
throw new Error(`Organization "${trimmedFlag}" is not available for this API key (use organization ID or slug). Available: ${formatOrganizationChoices(context.organizations)}`);
|
|
11
24
|
}
|
|
12
|
-
return
|
|
25
|
+
return match.id;
|
|
13
26
|
}
|
|
14
27
|
if (context.organizations.length === 0) {
|
|
15
28
|
throw new Error("No workspaces found for this API key.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-auth.types.js","sourceRoot":"","sources":["../src/cli-auth.types.ts"],"names":[],"mappings":"AAYA
|
|
1
|
+
{"version":3,"file":"cli-auth.types.js","sourceRoot":"","sources":["../src/cli-auth.types.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,oBAAoB,CAClC,aAAoC,EACpC,GAAW;IAEX,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAC7D,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAEtB,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,yBAAyB,CAAC,aAAoC;IACrE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAuB,EAAE,OAAgB;IAC7E,MAAM,WAAW,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC;IACpC,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,iBAAiB,WAAW,iFAAiF,yBAAyB,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAChK,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC;IAClB,CAAC;IAED,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DEFAULT_KUBBISEC_API_URL, resolveKubbisecApiUrl } from "./api-url.js";
|
|
2
|
-
export { type CliAuthContext, type CliAuthOrganization, pickLoginOrganization, } from "./cli-auth.types.js";
|
|
2
|
+
export { type CliAuthContext, type CliAuthOrganization, matchCliOrganization, pickLoginOrganization, } from "./cli-auth.types.js";
|
|
3
3
|
export { migrateLegacyKubbisecPaths, resetMigrationGuardForTests } from "./migrate.js";
|
|
4
4
|
export { getAiStateDir, getAspmConfigPath, getAspmStateDir, getKbsConfigPath, getKubbisecConfigPath, getKubbisecHomeDir, getMemoryDir, getNausStateDir, getSkillOptBaseDir, getTelemetryDir, } from "./paths.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DEFAULT_KUBBISEC_API_URL, resolveKubbisecApiUrl } from "./api-url.js";
|
|
2
|
-
export { pickLoginOrganization, } from "./cli-auth.types.js";
|
|
2
|
+
export { matchCliOrganization, pickLoginOrganization, } from "./cli-auth.types.js";
|
|
3
3
|
export { migrateLegacyKubbisecPaths, resetMigrationGuardForTests } from "./migrate.js";
|
|
4
4
|
export { getAiStateDir, getAspmConfigPath, getAspmStateDir, getKbsConfigPath, getKubbisecConfigPath, getKubbisecHomeDir, getMemoryDir, getNausStateDir, getSkillOptBaseDir, getTelemetryDir, } from "./paths.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAGL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAGL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -7,7 +7,7 @@ description: KubbiSec ASPM — uploads, gates, projetos e integração com NAUS/
|
|
|
7
7
|
|
|
8
8
|
`npm install -g @kubbisec/aspm` → binário `aspm`.
|
|
9
9
|
|
|
10
|
-
**Docs:** `aspm_docs` (secção `aspm-commands` + guias por scanner). **HARD-GATE:** chamar `aspm_docs` ou `security_scanner_playbook` antes de citar flags completas — não inventar sintaxe.
|
|
10
|
+
**Docs:** `aspm_docs` (secção `aspm-commands` + guias por scanner com install Linux/macOS/Windows). Recursos: `kubbisec://aspm/aspm-scanner-{trivy|gitleaks|osv|syft|semgrep|sonar|nmap|skipfish}`, `kubbisec://aspm/aspm-coverage` (Jest, Vitest, pytest, JaCoCo, Go). **HARD-GATE:** chamar `aspm_docs` ou `security_scanner_playbook` antes de citar flags completas — não inventar sintaxe.
|
|
11
11
|
|
|
12
12
|
## Comandos CLI
|
|
13
13
|
|
|
@@ -23,11 +23,16 @@ description: KubbiSec ASPM — uploads, gates, projetos e integração com NAUS/
|
|
|
23
23
|
| `aspm coverage <file>` | Upload de coverage (lcov) |
|
|
24
24
|
| `aspm parse-coverage <file>` | Parse coverage local |
|
|
25
25
|
| `aspm projects` | Listar projetos da organização |
|
|
26
|
-
| `aspm
|
|
26
|
+
| `aspm gate` | Avaliar relatórios locais contra regras inline |
|
|
27
|
+
| `aspm dashboard` | Resumo de postura no terminal |
|
|
28
|
+
|
|
29
|
+
### Credenciais
|
|
30
|
+
|
|
31
|
+
API key: **Perfil → API Keys** (`/profile/api-keys`). `-o/--org` = **slug** da organização (ex.: `minha-empresa`).
|
|
27
32
|
|
|
28
33
|
### Flags globais
|
|
29
34
|
|
|
30
|
-
`-k/--api-key`, `-o/--org
|
|
35
|
+
`-k/--api-key`, `-o/--org` (slug), `-p/--project`, `-v/--version`, `-h/--help`
|
|
31
36
|
|
|
32
37
|
### Variáveis de ambiente (precedência: flags CLI > env > `~/.kubbisec/config.json`)
|
|
33
38
|
|
|
@@ -35,7 +40,7 @@ description: KubbiSec ASPM — uploads, gates, projetos e integração com NAUS/
|
|
|
35
40
|
|----------|-----------|
|
|
36
41
|
| `KUBBISEC_API_URL` / `ASPM_API_URL` | URL da API |
|
|
37
42
|
| `KUBBISEC_API_KEY` / `ASPM_API_KEY` | API key |
|
|
38
|
-
| `KUBBISEC_ORG_ID` / `ASPM_ORG_ID` |
|
|
43
|
+
| `KUBBISEC_ORG_ID` / `ASPM_ORG_ID` | Slug da organização |
|
|
39
44
|
| `KUBBISEC_PROJECT` / `KUBBISEC_PROJECT_ID` / `ASPM_PROJECT_ID` | Project ID |
|
|
40
45
|
|
|
41
46
|
## Scanners ↔ `-s` ↔ ficheiro de relatório
|