pmsec 0.14.0 → 2026.6.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/package.json +1 -1
- package/src/cli.mjs +4 -3
- package/src/tools/aube.mjs +45 -0
- package/src/tools/mise.mjs +2 -0
- package/src/util/paths.mjs +10 -0
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -10,8 +10,9 @@ import * as cargo from "./tools/cargo.mjs";
|
|
|
10
10
|
import * as mise from "./tools/mise.mjs";
|
|
11
11
|
import * as uv from "./tools/uv.mjs";
|
|
12
12
|
import * as bundler from "./tools/bundler.mjs";
|
|
13
|
+
import * as aube from "./tools/aube.mjs";
|
|
13
14
|
|
|
14
|
-
const TOOLS = [npm, pnpm, yarn, bun, cargo, mise, uv, bundler];
|
|
15
|
+
const TOOLS = [npm, pnpm, yarn, bun, cargo, mise, uv, bundler, aube];
|
|
15
16
|
// Default cooldown for the hardening bundle. Override per-invocation with
|
|
16
17
|
// `--days N`; the default tracks the safest value we'd recommend.
|
|
17
18
|
const BUNDLE_DAYS = 1;
|
|
@@ -22,7 +23,7 @@ export const VERSION = JSON.parse(
|
|
|
22
23
|
const USAGE = `pmsec [options]
|
|
23
24
|
|
|
24
25
|
Zero-config install-time supply-chain hardening across npm, pnpm, yarn,
|
|
25
|
-
bun, cargo, mise, uv, bundler. Default action enables every safe-by-default
|
|
26
|
+
bun, cargo, mise, uv, bundler, aube. Default action enables every safe-by-default
|
|
26
27
|
key each tool exposes (cooldown, audit-level, trust-policy, hardened mode,
|
|
27
28
|
attestation re-verification, ...). No knobs.
|
|
28
29
|
|
|
@@ -30,7 +31,7 @@ Options:
|
|
|
30
31
|
--check Verify the bundle is in place (exit 1 if anything missing)
|
|
31
32
|
--disable Remove the hardening bundle from selected tools
|
|
32
33
|
--doctor Diagnose effective paths/owner/uid (read-only; for unattended-deployment debugging)
|
|
33
|
-
--tool TOOL[,TOOL] Restrict to specific tools (npm,pnpm,yarn,bun,cargo,mise,uv,bundler)
|
|
34
|
+
--tool TOOL[,TOOL] Restrict to specific tools (npm,pnpm,yarn,bun,cargo,mise,uv,bundler,aube)
|
|
34
35
|
--days N Override cooldown days (default 1)
|
|
35
36
|
--force Overwrite stricter existing cooldowns (otherwise enable is monotonic)
|
|
36
37
|
--json Emit JSON output
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { aubeConfigPath } from "../util/paths.mjs";
|
|
2
|
+
import { readSafe, writeAtomic } from "../util/io.mjs";
|
|
3
|
+
import { readKey, setKey, removeKey } from "../util/lines.mjs";
|
|
4
|
+
import { readExtras, applyExtras, removeExtras } from "../util/extras.mjs";
|
|
5
|
+
|
|
6
|
+
export const name = "aube";
|
|
7
|
+
export const key = "minimumReleaseAge";
|
|
8
|
+
export const docs = "https://aube.jdx.dev/";
|
|
9
|
+
export const extras = [
|
|
10
|
+
{ key: "paranoid", expected: "true", line: "paranoid = true" },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export function path(ctx) { return aubeConfigPath(ctx.env, ctx.home, ctx.platform); }
|
|
14
|
+
|
|
15
|
+
function parseDays(value) {
|
|
16
|
+
if (value === null) return null;
|
|
17
|
+
const n = Number(value);
|
|
18
|
+
if (!Number.isFinite(n) || n <= 0) return null;
|
|
19
|
+
return Math.floor(n / 1440);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function read(ctx) {
|
|
23
|
+
const p = path(ctx);
|
|
24
|
+
const raw = await readSafe(p);
|
|
25
|
+
const value = readKey(raw, key);
|
|
26
|
+
return { path: p, configured: value, days: parseDays(value), extras: readExtras(raw, extras) };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function write(days, ctx) {
|
|
30
|
+
const p = path(ctx);
|
|
31
|
+
let text = setKey(await readSafe(p), key, `${key} = ${days * 1440}`);
|
|
32
|
+
text = applyExtras(text, extras);
|
|
33
|
+
await writeAtomic(p, text);
|
|
34
|
+
return { path: p };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function unset(ctx) {
|
|
38
|
+
const p = path(ctx);
|
|
39
|
+
const before = await readSafe(p);
|
|
40
|
+
const cooldown = removeKey(before, key);
|
|
41
|
+
const ex = removeExtras(cooldown.text, extras);
|
|
42
|
+
const removed = cooldown.removed || ex.removed;
|
|
43
|
+
if (removed) await writeAtomic(p, ex.text);
|
|
44
|
+
return { path: p, removed };
|
|
45
|
+
}
|
package/src/tools/mise.mjs
CHANGED
|
@@ -11,6 +11,8 @@ export const minBin = [2026, 4, 22];
|
|
|
11
11
|
export const extras = [
|
|
12
12
|
{ key: "paranoid", expected: "true", line: "paranoid = true", section },
|
|
13
13
|
{ key: "gpg_verify", expected: "true", line: "gpg_verify = true", section },
|
|
14
|
+
{ key: "github_attestations", expected: "true", line: "github_attestations = true", section },
|
|
15
|
+
{ key: "slsa", expected: "true", line: "slsa = true", section },
|
|
14
16
|
];
|
|
15
17
|
|
|
16
18
|
export function path(ctx) { return miseConfigPath(ctx.env, ctx.home, ctx.platform); }
|
package/src/util/paths.mjs
CHANGED
|
@@ -60,3 +60,13 @@ export function miseConfigPath(env = process.env, home = homedir(), platform = p
|
|
|
60
60
|
const base = env.XDG_CONFIG_HOME || join(home, ".config");
|
|
61
61
|
return join(base, "mise", "config.toml");
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
export function aubeConfigPath(env = process.env, home = homedir(), platform = process.platform) {
|
|
65
|
+
if (env.AUBE_CONFIG_FILE) return env.AUBE_CONFIG_FILE;
|
|
66
|
+
if (platform === "win32") {
|
|
67
|
+
const base = env.LOCALAPPDATA || join(home, "AppData", "Local");
|
|
68
|
+
return join(base, "aube", "config.toml");
|
|
69
|
+
}
|
|
70
|
+
const base = env.XDG_CONFIG_HOME || join(home, ".config");
|
|
71
|
+
return join(base, "aube", "config.toml");
|
|
72
|
+
}
|