@bugb-technologies/bravos 1.4.0 → 1.4.1
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 +1 -0
- package/dist/setup.js +12 -3
- package/dist/versions.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ Or remove it (`pipx uninstall bravos` or `uv tool uninstall bravos`). `which -a
|
|
|
32
32
|
4. **Test kits written before 1.4** are reported as needing review and `bind` and are not run until bound (bravos-templatize does it).
|
|
33
33
|
5. **Automatic local testing** starts once a `target: http://localhost:<port>/` line for your app is merged to the default branch, and needs an `origin` remote; without one, tests run only once each, with your typed authorization.
|
|
34
34
|
6. Teammates **without a licence** now see that autopilot and the pre-PR gate are installed but locked for them, with the trial command, instead of "on".
|
|
35
|
+
7. **1.4.1:** `bravos setup` fetches analyzer 0.6.2 (Team plan), whose reachability matches the code graph and whose own GuardLink pin is 2.6.0. `bravos sast run` now starts only with the GuardLink step 1 installs on PATH, so SAST and the rest of Bravos read the threat model with the same GuardLink.
|
|
35
36
|
|
|
36
37
|
## Commands
|
|
37
38
|
|
package/dist/setup.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { checkProofTool, formatProofTool } from './proof-tools.js';
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
4
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { isAbsolute, join } from 'node:path';
|
|
6
6
|
import { bundleEnvironment, hostTarget, install, missingPaths, staged, VERSIONS } from './artifacts.js';
|
|
7
7
|
import { graphBin, graphEnv } from './codegraph.js';
|
|
8
8
|
import { whichBin } from './guardlink.js';
|
|
@@ -104,11 +104,16 @@ export function selfTest(kind, dir, env) {
|
|
|
104
104
|
}
|
|
105
105
|
// @comment -- "Runs the analyzer the way the Python adapter did: bravos-cli analyze ROOT --ci --fail-on never --allow-incomplete-analysis --codegraph <reuse when a graph store exists> --scip off -f json,sarif -o .bravos/sast/<run>/report, under the bundle's environment, then writes meta.json (sha, exit, at) so the briefing's SAST line and bravos sast candidates read it. The exit code is a health signal; findings are read from the report."
|
|
106
106
|
export async function runSast(root, env, opts = {}) {
|
|
107
|
-
await requireFeature(env, 'sast', 'bravos sast run');
|
|
107
|
+
const licence = await requireFeature(env, 'sast', 'bravos sast run');
|
|
108
108
|
const dir = staged(env, 'analyzer');
|
|
109
109
|
const bin = dir ? join(dir, 'bravos-cli') : findAnalyzer(env);
|
|
110
110
|
if (!bin)
|
|
111
111
|
throw new BravosError('bravos-cli is not installed: bravos setup --analyzer fetches it');
|
|
112
|
+
// @comment -- "The analyzer reads the threat model through whatever guardlink is on PATH, and installs its own pinned copy when there is none. Run it only with the GuardLink this bravos pins, so SAST and the rest of bravos read the model with one parser."
|
|
113
|
+
const gl = checkProofTool('guardlink', env);
|
|
114
|
+
if (gl.status !== 'ready') {
|
|
115
|
+
throw new BravosError(`bravos sast run needs the GuardLink this bravos pins (guardlink@${PROOF_TOOL_PINS.guardlink.version}) on PATH, and it is ${gl.status}. Run bravos setup --tools -y first; otherwise the analyzer would read the threat model with a different GuardLink.`);
|
|
116
|
+
}
|
|
112
117
|
const base = join(root, '.bravos', 'sast');
|
|
113
118
|
mkdirSync(base, { recursive: true });
|
|
114
119
|
if (!existsSync(join(base, '.gitignore')))
|
|
@@ -131,7 +136,11 @@ export async function runSast(root, env, opts = {}) {
|
|
|
131
136
|
return a;
|
|
132
137
|
};
|
|
133
138
|
// @comment -- "The analyzer reads the code graph from the same store bravos graph build writes to, so it runs with BRAVOS_CODEGRAPH_DIR set (graphEnv): without it, --codegraph reuse looks in the analyzer's own default store and finds no graph even when one was just built."
|
|
134
|
-
const
|
|
139
|
+
const baseEnv = graphEnv(env);
|
|
140
|
+
// @comment -- "The analyzer looks for its licence only in $BRAVOS_HOME or $BRAVOS_LICENCE, while bravos also falls back to ~/.bravos and ~/.bugb. Hand it the licence file bravos found (the path, never the token), so a SAST run never refuses a licence bravos accepted."
|
|
141
|
+
if (!env.BRAVOS_LICENCE && !env.BRAVOS_LICENSE && isAbsolute(licence.source) && existsSync(licence.source))
|
|
142
|
+
baseEnv.BRAVOS_LICENCE = licence.source;
|
|
143
|
+
const runEnv = dir ? bundleEnvironment(dir, baseEnv) : baseEnv;
|
|
135
144
|
const spawn = (graph) => spawnSync(bin, argvFor(graph), { cwd: root, env: runEnv, encoding: 'utf8', timeout: (opts.timeoutS ?? 1800) * 1000, maxBuffer: 64 * 1024 * 1024, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
136
145
|
let r = spawn(codegraph);
|
|
137
146
|
const notes = [];
|
package/dist/versions.js
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { hooksDir } from './paths.js';
|
|
4
4
|
// @comment -- "The versions of the two binary bundles this CLI installs. Pinned here, not read from the network: a bravos release names the analyzer and code-graph builds it was tested with, and bravos setup fetches exactly those."
|
|
5
5
|
/** The licensed analyzer bundle (bravos-cli plus gitleaks, osv-scanner, kics, zizmor and the rules), published by specter-v1's analyzer-release workflow. */
|
|
6
|
-
export const ANALYZER_VERSION = '0.6.
|
|
6
|
+
export const ANALYZER_VERSION = '0.6.2';
|
|
7
7
|
/** The code graph binaries (codegraph-build, codegraph-mcp), published by specter-v1's codegraph-release workflow. */
|
|
8
8
|
export const CODEGRAPH_VERSION = '0.1.0';
|
|
9
9
|
export const PROOF_TOOL_PINS = JSON.parse(readFileSync(join(hooksDir(), 'lib', 'proof-tool-pins.json'), 'utf8'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bugb-technologies/bravos",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Skills pack and installer that make Claude Code and Codex power users of guardlink (threat-model-as-code) and cert-x-gen (pentest-as-code).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|