@node9/policy-engine 2.48.2 → 2.49.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/dist/index.d.mts +31 -3
- package/dist/index.d.ts +31 -3
- package/dist/index.js +176 -1
- package/dist/index.mjs +168 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2551,6 +2551,107 @@ function levelPackageSignals(mode) {
|
|
|
2551
2551
|
return levelOf(mode) === "soft" ? { newPackage: "off", installScript: "off" } : void 0;
|
|
2552
2552
|
}
|
|
2553
2553
|
|
|
2554
|
+
// src/owasp.ts
|
|
2555
|
+
var ASI = {
|
|
2556
|
+
ASI01: "Agent Goal Hijack",
|
|
2557
|
+
ASI02: "Tool Misuse and Exploitation",
|
|
2558
|
+
ASI03: "Identity and Privilege Abuse",
|
|
2559
|
+
ASI04: "Agentic Supply Chain Vulnerabilities",
|
|
2560
|
+
ASI05: "Unexpected Code Execution",
|
|
2561
|
+
ASI06: "Memory and Context Poisoning",
|
|
2562
|
+
ASI07: "Insecure Inter-Agent Communication",
|
|
2563
|
+
ASI08: "Cascading Failures",
|
|
2564
|
+
ASI09: "Human-Agent Trust Exploitation",
|
|
2565
|
+
ASI10: "Rogue Agents"
|
|
2566
|
+
};
|
|
2567
|
+
var ASI_IDS = Object.keys(ASI);
|
|
2568
|
+
function isAsiId(v) {
|
|
2569
|
+
return typeof v === "string" && Object.prototype.hasOwnProperty.call(ASI, v);
|
|
2570
|
+
}
|
|
2571
|
+
var PACK_SHIELD_OWASP = {
|
|
2572
|
+
aws: "ASI02",
|
|
2573
|
+
"bash-safe": "ASI02",
|
|
2574
|
+
docker: "ASI02",
|
|
2575
|
+
filesystem: "ASI02",
|
|
2576
|
+
github: "ASI02",
|
|
2577
|
+
k8s: "ASI02",
|
|
2578
|
+
mongodb: "ASI02",
|
|
2579
|
+
postgres: "ASI02",
|
|
2580
|
+
redis: "ASI02",
|
|
2581
|
+
stripe: "ASI09",
|
|
2582
|
+
paypal: "ASI09",
|
|
2583
|
+
square: "ASI09",
|
|
2584
|
+
plaid: "ASI09",
|
|
2585
|
+
okta: "ASI09",
|
|
2586
|
+
auth0: "ASI09"
|
|
2587
|
+
};
|
|
2588
|
+
var PACK_RULE_OWASP = {
|
|
2589
|
+
"packs.bash-safe.pipe-to-shell": "ASI05",
|
|
2590
|
+
"packs.bash-safe.obfuscated-exec": "ASI05",
|
|
2591
|
+
"packs.bash-safe.eval-remote": "ASI05",
|
|
2592
|
+
"packs.bash-safe.eval-dynamic": "ASI05",
|
|
2593
|
+
"packs.aws.iam-changes": "ASI03",
|
|
2594
|
+
"packs.postgres.grant-revoke": "ASI03"
|
|
2595
|
+
};
|
|
2596
|
+
function packRowOwasp(id, shield) {
|
|
2597
|
+
return PACK_RULE_OWASP[id] ?? PACK_SHIELD_OWASP[shield];
|
|
2598
|
+
}
|
|
2599
|
+
var POSTURE_CATEGORY_OWASP = {
|
|
2600
|
+
Secrets: "ASI03",
|
|
2601
|
+
Data: "ASI03",
|
|
2602
|
+
Privilege: "ASI03",
|
|
2603
|
+
Egress: "ASI02",
|
|
2604
|
+
"Approval gate": "ASI02",
|
|
2605
|
+
"Agent permissions": "ASI02",
|
|
2606
|
+
"Tool governance": "ASI02",
|
|
2607
|
+
Files: "ASI02",
|
|
2608
|
+
Inbound: "ASI02",
|
|
2609
|
+
"Agent inbound": "ASI02",
|
|
2610
|
+
"Network exposure": "ASI02",
|
|
2611
|
+
"Supply chain": "ASI04",
|
|
2612
|
+
"Instruction files": "ASI06",
|
|
2613
|
+
"Outside content": "ASI01",
|
|
2614
|
+
Isolation: "ASI05",
|
|
2615
|
+
Approvals: "ASI09",
|
|
2616
|
+
Cost: "ASI08",
|
|
2617
|
+
Coverage: "ASI10"
|
|
2618
|
+
};
|
|
2619
|
+
function postureCategoryOwasp(category) {
|
|
2620
|
+
return POSTURE_CATEGORY_OWASP[category];
|
|
2621
|
+
}
|
|
2622
|
+
var SCAN_REPO_RULE_OWASP = [
|
|
2623
|
+
// CI-1: tool rules and hooks in agent config
|
|
2624
|
+
["CI-1.broad-allow", "ASI02"],
|
|
2625
|
+
["CI-1.exec-escape-grant", "ASI02"],
|
|
2626
|
+
["CI-1.codex-unsafe-defaults", "ASI02"],
|
|
2627
|
+
["CI-1.skill-allowed-tools", "ASI02"],
|
|
2628
|
+
["CI-1.skill-untrusted-input", "ASI01"],
|
|
2629
|
+
["CI-1.hook-remote-code", "ASI05"],
|
|
2630
|
+
["CI-1.hook-script", "ASI05"],
|
|
2631
|
+
["CI-1.unfollowable-symlink", "ASI04"],
|
|
2632
|
+
// CI-2: workflows that run agents on outside content
|
|
2633
|
+
["CI-2.", "ASI01"],
|
|
2634
|
+
// CI-3: MCP servers and plugins
|
|
2635
|
+
["CI-3.mcp-inline-credential", "ASI03"],
|
|
2636
|
+
["CI-3.mcp-unpinned", "ASI04"],
|
|
2637
|
+
["CI-3.plugin-unpinned", "ASI04"],
|
|
2638
|
+
// CI-4: secrets an agent step can reach
|
|
2639
|
+
["CI-4.", "ASI03"],
|
|
2640
|
+
// CI-6: instruction files and skills
|
|
2641
|
+
["CI-6.skill-script", "ASI05"],
|
|
2642
|
+
["CI-6.", "ASI06"]
|
|
2643
|
+
];
|
|
2644
|
+
var SCAN_REPO_RULES_WITHOUT_RISK = ["CI-0."];
|
|
2645
|
+
function scanRepoRuleOwasp(rule) {
|
|
2646
|
+
let best;
|
|
2647
|
+
for (const entry of SCAN_REPO_RULE_OWASP) {
|
|
2648
|
+
if (rule === entry[0] || rule.startsWith(entry[0])) {
|
|
2649
|
+
if (!best || entry[0].length > best[0].length) best = entry;
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
return best?.[1];
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2554
2655
|
// src/catalog.ts
|
|
2555
2656
|
var VERDICTS = ["off", "log", "review", "block"];
|
|
2556
2657
|
var CHECK_VERDICT_RANK = { off: 0, log: 1, review: 2, block: 3 };
|
|
@@ -2572,6 +2673,7 @@ var PRODUCT_CHECKS = [
|
|
|
2572
2673
|
{
|
|
2573
2674
|
id: "files.shell-startup",
|
|
2574
2675
|
group: "files",
|
|
2676
|
+
owasp: "ASI02",
|
|
2575
2677
|
title: "Shell startup files",
|
|
2576
2678
|
catches: "Writes, replacements and removals of personal shell startup files",
|
|
2577
2679
|
values: ALL,
|
|
@@ -2581,6 +2683,7 @@ var PRODUCT_CHECKS = [
|
|
|
2581
2683
|
{
|
|
2582
2684
|
id: "files.system-auth",
|
|
2583
2685
|
group: "files",
|
|
2686
|
+
owasp: "ASI03",
|
|
2584
2687
|
title: "System authentication files",
|
|
2585
2688
|
catches: "Changes to system authentication files and PAM configuration",
|
|
2586
2689
|
values: ["block"],
|
|
@@ -2591,6 +2694,7 @@ var PRODUCT_CHECKS = [
|
|
|
2591
2694
|
{
|
|
2592
2695
|
id: "files.password-hashes",
|
|
2593
2696
|
group: "files",
|
|
2697
|
+
owasp: "ASI03",
|
|
2594
2698
|
title: "System password hashes",
|
|
2595
2699
|
catches: "Reads and copies of /etc/shadow and /etc/gshadow",
|
|
2596
2700
|
values: ALL,
|
|
@@ -2600,6 +2704,7 @@ var PRODUCT_CHECKS = [
|
|
|
2600
2704
|
{
|
|
2601
2705
|
id: "files.system-dirs",
|
|
2602
2706
|
group: "files",
|
|
2707
|
+
owasp: "ASI02",
|
|
2603
2708
|
title: "System directories",
|
|
2604
2709
|
catches: "Writes, new files and removals under /usr, /etc, /boot, /bin, /sbin, /lib and /var/log, and uploads of system files",
|
|
2605
2710
|
values: ALL,
|
|
@@ -2609,6 +2714,7 @@ var PRODUCT_CHECKS = [
|
|
|
2609
2714
|
{
|
|
2610
2715
|
id: "files.agent-instructions",
|
|
2611
2716
|
group: "files",
|
|
2717
|
+
owasp: "ASI06",
|
|
2612
2718
|
title: "Agent instruction and memory files",
|
|
2613
2719
|
catches: "writes to the files every later agent session loads as instructions (CLAUDE.md, AGENTS.md, memory, agents, commands) and changes to the agent's hooks; Standard asks only when the text carries an instruction to hide, skip approvals or touch secrets",
|
|
2614
2720
|
values: ALL,
|
|
@@ -2619,6 +2725,7 @@ var PRODUCT_CHECKS = [
|
|
|
2619
2725
|
{
|
|
2620
2726
|
id: "commands.inline-exec",
|
|
2621
2727
|
group: "commands",
|
|
2728
|
+
owasp: "ASI05",
|
|
2622
2729
|
title: "Inline code execution",
|
|
2623
2730
|
catches: "inline code (python -c, node -e, a heredoc into an interpreter) that deletes, sends, opens a socket, runs commands, reads protected files or decodes and runs; unreadable inline code",
|
|
2624
2731
|
values: ALL,
|
|
@@ -2628,6 +2735,7 @@ var PRODUCT_CHECKS = [
|
|
|
2628
2735
|
{
|
|
2629
2736
|
id: "commands.eval-dynamic",
|
|
2630
2737
|
group: "commands",
|
|
2738
|
+
owasp: "ASI05",
|
|
2631
2739
|
title: "Eval of dynamic content",
|
|
2632
2740
|
catches: "generated executable names, shell code from stdin, or dynamic eval/-c payloads",
|
|
2633
2741
|
values: ALL,
|
|
@@ -2637,6 +2745,7 @@ var PRODUCT_CHECKS = [
|
|
|
2637
2745
|
{
|
|
2638
2746
|
id: "commands.eval-remote",
|
|
2639
2747
|
group: "commands",
|
|
2748
|
+
owasp: "ASI05",
|
|
2640
2749
|
title: "Eval of a remote download",
|
|
2641
2750
|
catches: "eval or sh over the output of curl or wget",
|
|
2642
2751
|
values: ["block"],
|
|
@@ -2647,6 +2756,7 @@ var PRODUCT_CHECKS = [
|
|
|
2647
2756
|
{
|
|
2648
2757
|
id: "commands.curl-pipe-shell",
|
|
2649
2758
|
group: "commands",
|
|
2759
|
+
owasp: "ASI05",
|
|
2650
2760
|
title: "Remote script piped into a shell",
|
|
2651
2761
|
catches: "curl or wget piped into sh, bash, zsh or PowerShell",
|
|
2652
2762
|
values: ALL,
|
|
@@ -2656,6 +2766,7 @@ var PRODUCT_CHECKS = [
|
|
|
2656
2766
|
{
|
|
2657
2767
|
id: "commands.rm",
|
|
2658
2768
|
group: "commands",
|
|
2769
|
+
owasp: "ASI02",
|
|
2659
2770
|
title: "Delete files",
|
|
2660
2771
|
catches: "rm outside the known build-artifact paths",
|
|
2661
2772
|
values: ALL,
|
|
@@ -2665,6 +2776,7 @@ var PRODUCT_CHECKS = [
|
|
|
2665
2776
|
{
|
|
2666
2777
|
id: "commands.rm-home",
|
|
2667
2778
|
group: "commands",
|
|
2779
|
+
owasp: "ASI02",
|
|
2668
2780
|
title: "Recursive delete of the home directory",
|
|
2669
2781
|
catches: "rm -rf on ~, $HOME, /home or /",
|
|
2670
2782
|
values: ["block"],
|
|
@@ -2675,6 +2787,7 @@ var PRODUCT_CHECKS = [
|
|
|
2675
2787
|
{
|
|
2676
2788
|
id: "commands.chmod",
|
|
2677
2789
|
group: "commands",
|
|
2790
|
+
owasp: "ASI02",
|
|
2678
2791
|
title: "World-writable permissions",
|
|
2679
2792
|
catches: "chmod 777, 0777 or a+rwx",
|
|
2680
2793
|
values: ALL,
|
|
@@ -2684,6 +2797,7 @@ var PRODUCT_CHECKS = [
|
|
|
2684
2797
|
{
|
|
2685
2798
|
id: "commands.sudo",
|
|
2686
2799
|
group: "commands",
|
|
2800
|
+
owasp: "ASI03",
|
|
2687
2801
|
title: "Elevated privileges",
|
|
2688
2802
|
catches: "a command run through sudo",
|
|
2689
2803
|
values: ALL,
|
|
@@ -2693,6 +2807,7 @@ var PRODUCT_CHECKS = [
|
|
|
2693
2807
|
{
|
|
2694
2808
|
id: "commands.git-destructive",
|
|
2695
2809
|
group: "commands",
|
|
2810
|
+
owasp: "ASI02",
|
|
2696
2811
|
title: "Destructive git operation",
|
|
2697
2812
|
catches: "force push, reset --hard, clean -f, branch -D or tag delete, also through -C, env, wrappers, variables and aliases",
|
|
2698
2813
|
values: ALL,
|
|
@@ -2702,6 +2817,7 @@ var PRODUCT_CHECKS = [
|
|
|
2702
2817
|
{
|
|
2703
2818
|
id: "commands.git-hooks-bypass",
|
|
2704
2819
|
group: "commands",
|
|
2820
|
+
owasp: "ASI10",
|
|
2705
2821
|
title: "Git hooks bypassed",
|
|
2706
2822
|
catches: "the agent switches off the git hooks that check its own work: --no-verify, core.hooksPath, HUSKY=0 and its peers, or a hook file removed, emptied or made non-executable",
|
|
2707
2823
|
values: ALL,
|
|
@@ -2711,6 +2827,7 @@ var PRODUCT_CHECKS = [
|
|
|
2711
2827
|
{
|
|
2712
2828
|
id: "commands.git-stage-all",
|
|
2713
2829
|
group: "commands",
|
|
2830
|
+
owasp: "ASI02",
|
|
2714
2831
|
title: "Stage everything at once",
|
|
2715
2832
|
catches: "git add -A, git add ., git commit -a and other ways to stage every change instead of naming the files; off unless you switch it on",
|
|
2716
2833
|
values: ALL,
|
|
@@ -2720,6 +2837,7 @@ var PRODUCT_CHECKS = [
|
|
|
2720
2837
|
{
|
|
2721
2838
|
id: "commands.reverse-shell",
|
|
2722
2839
|
group: "commands",
|
|
2840
|
+
owasp: "ASI05",
|
|
2723
2841
|
title: "Reverse shell",
|
|
2724
2842
|
catches: "a shell wired to a network socket: bash -i >& /dev/tcp/\u2026, nc -e, socat exec:, a socket fd read by a shell, a shell piped to and from nc or telnet",
|
|
2725
2843
|
values: ALL,
|
|
@@ -2729,6 +2847,7 @@ var PRODUCT_CHECKS = [
|
|
|
2729
2847
|
{
|
|
2730
2848
|
id: "commands.node9-disarm",
|
|
2731
2849
|
group: "commands",
|
|
2850
|
+
owasp: "ASI10",
|
|
2732
2851
|
title: "node9 disarmed from the shell",
|
|
2733
2852
|
catches: "a node9 command that clears a session flag, trusts a destination, pauses the gate or weakens a shield, run by the agent",
|
|
2734
2853
|
values: ALL,
|
|
@@ -2738,6 +2857,7 @@ var PRODUCT_CHECKS = [
|
|
|
2738
2857
|
{
|
|
2739
2858
|
id: "commands.sql-ddl",
|
|
2740
2859
|
group: "commands",
|
|
2860
|
+
owasp: "ASI02",
|
|
2741
2861
|
title: "Drop or truncate",
|
|
2742
2862
|
catches: "DROP or TRUNCATE through a database CLI or a database tool",
|
|
2743
2863
|
values: ALL,
|
|
@@ -2752,6 +2872,7 @@ var PRODUCT_CHECKS = [
|
|
|
2752
2872
|
{
|
|
2753
2873
|
id: "commands.sql-no-where",
|
|
2754
2874
|
group: "commands",
|
|
2875
|
+
owasp: "ASI02",
|
|
2755
2876
|
title: "Unscoped SQL mutation",
|
|
2756
2877
|
catches: "DELETE or UPDATE without a WHERE clause",
|
|
2757
2878
|
values: ALL,
|
|
@@ -2761,6 +2882,7 @@ var PRODUCT_CHECKS = [
|
|
|
2761
2882
|
{
|
|
2762
2883
|
id: "commands.temp-binary",
|
|
2763
2884
|
group: "commands",
|
|
2885
|
+
owasp: "ASI05",
|
|
2764
2886
|
title: "Binary from a temp directory",
|
|
2765
2887
|
catches: "an absolute path under /tmp, /var/tmp, /dev/shm or a world-writable file",
|
|
2766
2888
|
values: ALL,
|
|
@@ -2770,6 +2892,7 @@ var PRODUCT_CHECKS = [
|
|
|
2770
2892
|
{
|
|
2771
2893
|
id: "commands.disk-destroy",
|
|
2772
2894
|
group: "commands",
|
|
2895
|
+
owasp: "ASI02",
|
|
2773
2896
|
title: "Disk or filesystem destruction",
|
|
2774
2897
|
catches: "mkfs, shred, dd and the manual-terminal disaster list",
|
|
2775
2898
|
values: ALL,
|
|
@@ -2779,6 +2902,7 @@ var PRODUCT_CHECKS = [
|
|
|
2779
2902
|
{
|
|
2780
2903
|
id: "commands.dangerous-word",
|
|
2781
2904
|
group: "commands",
|
|
2905
|
+
owasp: "ASI02",
|
|
2782
2906
|
title: "Dangerous word",
|
|
2783
2907
|
catches: "a word from a pack or from the config dangerousWords list",
|
|
2784
2908
|
values: ALL,
|
|
@@ -2787,6 +2911,7 @@ var PRODUCT_CHECKS = [
|
|
|
2787
2911
|
{
|
|
2788
2912
|
id: "commands.unanalysable",
|
|
2789
2913
|
group: "commands",
|
|
2914
|
+
owasp: "ASI02",
|
|
2790
2915
|
title: "Command too nested to analyse",
|
|
2791
2916
|
catches: "wrappers nested past the depth the shell parser follows",
|
|
2792
2917
|
values: ALL,
|
|
@@ -2796,6 +2921,7 @@ var PRODUCT_CHECKS = [
|
|
|
2796
2921
|
{
|
|
2797
2922
|
id: "commands.unknown",
|
|
2798
2923
|
group: "commands",
|
|
2924
|
+
owasp: "ASI02",
|
|
2799
2925
|
title: "Any command no check recognised",
|
|
2800
2926
|
catches: "the strict-mode catch-all",
|
|
2801
2927
|
values: ["off", "review"],
|
|
@@ -2806,6 +2932,7 @@ var PRODUCT_CHECKS = [
|
|
|
2806
2932
|
{
|
|
2807
2933
|
id: "data.secrets",
|
|
2808
2934
|
group: "data",
|
|
2935
|
+
owasp: "ASI03",
|
|
2809
2936
|
title: "Secret in arguments",
|
|
2810
2937
|
catches: "an API key, token or private key matching one of the DLP patterns",
|
|
2811
2938
|
values: ALL,
|
|
@@ -2815,6 +2942,7 @@ var PRODUCT_CHECKS = [
|
|
|
2815
2942
|
{
|
|
2816
2943
|
id: "data.secrets-weak",
|
|
2817
2944
|
group: "data",
|
|
2945
|
+
owasp: "ASI03",
|
|
2818
2946
|
title: "Weak credential in arguments",
|
|
2819
2947
|
catches: "a JWT or a bearer token",
|
|
2820
2948
|
values: ALL,
|
|
@@ -2824,6 +2952,7 @@ var PRODUCT_CHECKS = [
|
|
|
2824
2952
|
{
|
|
2825
2953
|
id: "data.pii",
|
|
2826
2954
|
group: "data",
|
|
2955
|
+
owasp: "ASI02",
|
|
2827
2956
|
title: "Personal data in arguments",
|
|
2828
2957
|
catches: "a social security number or a credit card number",
|
|
2829
2958
|
values: ALL,
|
|
@@ -2833,6 +2962,7 @@ var PRODUCT_CHECKS = [
|
|
|
2833
2962
|
{
|
|
2834
2963
|
id: "data.credential-files",
|
|
2835
2964
|
group: "data",
|
|
2965
|
+
owasp: "ASI03",
|
|
2836
2966
|
title: "Credential file read",
|
|
2837
2967
|
catches: "~/.ssh, ~/.aws and .env files, through any reader or any file tool",
|
|
2838
2968
|
values: ALL,
|
|
@@ -2841,6 +2971,7 @@ var PRODUCT_CHECKS = [
|
|
|
2841
2971
|
{
|
|
2842
2972
|
id: "data.credential-files-other",
|
|
2843
2973
|
group: "data",
|
|
2974
|
+
owasp: "ASI03",
|
|
2844
2975
|
title: "Other credential file",
|
|
2845
2976
|
catches: ".netrc, .npmrc, kube and docker config, and a copy of any credential file",
|
|
2846
2977
|
values: ALL,
|
|
@@ -2849,6 +2980,7 @@ var PRODUCT_CHECKS = [
|
|
|
2849
2980
|
{
|
|
2850
2981
|
id: "data.credential-files-unknown",
|
|
2851
2982
|
group: "data",
|
|
2983
|
+
owasp: "ASI03",
|
|
2852
2984
|
title: "Files read by names known only at run time",
|
|
2853
2985
|
catches: "a reader fed names from a listing that can include credential files (find . | xargs cat)",
|
|
2854
2986
|
values: ALL,
|
|
@@ -2857,6 +2989,7 @@ var PRODUCT_CHECKS = [
|
|
|
2857
2989
|
{
|
|
2858
2990
|
id: "data.pipe-chain",
|
|
2859
2991
|
group: "data",
|
|
2992
|
+
owasp: "ASI03",
|
|
2860
2993
|
title: "Sensitive file piped to the network",
|
|
2861
2994
|
catches: "a credential file read and piped into curl, nc or ssh",
|
|
2862
2995
|
values: ALL,
|
|
@@ -2866,6 +2999,7 @@ var PRODUCT_CHECKS = [
|
|
|
2866
2999
|
{
|
|
2867
3000
|
id: "data.pipe-chain-obfuscated",
|
|
2868
3001
|
group: "data",
|
|
3002
|
+
owasp: "ASI03",
|
|
2869
3003
|
title: "Obfuscated exfiltration",
|
|
2870
3004
|
catches: "a sensitive file encoded or compressed on its way to the network",
|
|
2871
3005
|
values: ALL,
|
|
@@ -2878,6 +3012,7 @@ var PRODUCT_CHECKS = [
|
|
|
2878
3012
|
{
|
|
2879
3013
|
id: "data.env-exfil",
|
|
2880
3014
|
group: "data",
|
|
3015
|
+
owasp: "ASI03",
|
|
2881
3016
|
title: "Environment sent out",
|
|
2882
3017
|
catches: "the whole environment (env, printenv, set, export -p, /proc/*/environ) handed to curl, nc or another sender, through $(\u2026), a pipe or a variable",
|
|
2883
3018
|
values: ALL,
|
|
@@ -2887,6 +3022,7 @@ var PRODUCT_CHECKS = [
|
|
|
2887
3022
|
{
|
|
2888
3023
|
id: "data.output-secrets",
|
|
2889
3024
|
group: "data",
|
|
3025
|
+
owasp: "ASI03",
|
|
2890
3026
|
title: "Secret in tool output",
|
|
2891
3027
|
catches: "a credential a tool returned; the session is tainted, nothing is stopped",
|
|
2892
3028
|
values: ["off", "log"],
|
|
@@ -2895,6 +3031,7 @@ var PRODUCT_CHECKS = [
|
|
|
2895
3031
|
{
|
|
2896
3032
|
id: "data.prompt-secrets",
|
|
2897
3033
|
group: "data",
|
|
3034
|
+
owasp: "ASI03",
|
|
2898
3035
|
title: "Secret in the prompt",
|
|
2899
3036
|
catches: "a credential pasted into the conversation",
|
|
2900
3037
|
values: ALL,
|
|
@@ -2903,6 +3040,7 @@ var PRODUCT_CHECKS = [
|
|
|
2903
3040
|
{
|
|
2904
3041
|
id: "data.canary",
|
|
2905
3042
|
group: "data",
|
|
3043
|
+
owasp: "ASI03",
|
|
2906
3044
|
title: "Decoy credential used",
|
|
2907
3045
|
catches: "a planted decoy value appears in a tool call",
|
|
2908
3046
|
values: ALL,
|
|
@@ -2913,6 +3051,7 @@ var PRODUCT_CHECKS = [
|
|
|
2913
3051
|
{
|
|
2914
3052
|
id: "network.unknown-host",
|
|
2915
3053
|
group: "network",
|
|
3054
|
+
owasp: "ASI02",
|
|
2916
3055
|
title: "Unknown host",
|
|
2917
3056
|
catches: "a destination on neither the allowlist nor the builtin list",
|
|
2918
3057
|
values: ["off", "review", "block"],
|
|
@@ -2922,6 +3061,7 @@ var PRODUCT_CHECKS = [
|
|
|
2922
3061
|
{
|
|
2923
3062
|
id: "network.internal-addresses",
|
|
2924
3063
|
group: "network",
|
|
3064
|
+
owasp: "ASI02",
|
|
2925
3065
|
title: "Internal address",
|
|
2926
3066
|
catches: "loopback, the RFC 1918 ranges and carrier-grade NAT",
|
|
2927
3067
|
values: ["off", "block"],
|
|
@@ -2930,6 +3070,7 @@ var PRODUCT_CHECKS = [
|
|
|
2930
3070
|
{
|
|
2931
3071
|
id: "network.metadata",
|
|
2932
3072
|
group: "network",
|
|
3073
|
+
owasp: "ASI02",
|
|
2933
3074
|
title: "Cloud metadata address",
|
|
2934
3075
|
catches: "169.254.169.254 and its peers, link-local and multicast",
|
|
2935
3076
|
values: ["block"],
|
|
@@ -2940,6 +3081,7 @@ var PRODUCT_CHECKS = [
|
|
|
2940
3081
|
{
|
|
2941
3082
|
id: "network.taint-egress",
|
|
2942
3083
|
group: "network",
|
|
3084
|
+
owasp: "ASI01",
|
|
2943
3085
|
title: "Tainted data sent out",
|
|
2944
3086
|
catches: "a file or an output flagged earlier in the session reaches a host not on the allowlist",
|
|
2945
3087
|
values: ALL,
|
|
@@ -2953,6 +3095,7 @@ var PRODUCT_CHECKS = [
|
|
|
2953
3095
|
{
|
|
2954
3096
|
id: "files.jail",
|
|
2955
3097
|
group: "files",
|
|
3098
|
+
owasp: "ASI03",
|
|
2956
3099
|
title: "Jailed path",
|
|
2957
3100
|
catches: "a path the workspace or the developer added to the jail",
|
|
2958
3101
|
values: ALL,
|
|
@@ -2962,6 +3105,7 @@ var PRODUCT_CHECKS = [
|
|
|
2962
3105
|
{
|
|
2963
3106
|
id: "behavior.loops",
|
|
2964
3107
|
group: "behavior",
|
|
3108
|
+
owasp: "ASI08",
|
|
2965
3109
|
title: "Runaway loop",
|
|
2966
3110
|
catches: "the same tool call repeated past the threshold inside the window",
|
|
2967
3111
|
values: ["off", "block"],
|
|
@@ -2971,6 +3115,7 @@ var PRODUCT_CHECKS = [
|
|
|
2971
3115
|
{
|
|
2972
3116
|
id: "behavior.prompt-injection",
|
|
2973
3117
|
group: "behavior",
|
|
3118
|
+
owasp: "ASI01",
|
|
2974
3119
|
title: "Prompt injection in tool output",
|
|
2975
3120
|
catches: "instructions aimed at the model inside content a tool returned",
|
|
2976
3121
|
values: ["off", "log"],
|
|
@@ -2979,6 +3124,7 @@ var PRODUCT_CHECKS = [
|
|
|
2979
3124
|
{
|
|
2980
3125
|
id: "behavior.session-taint",
|
|
2981
3126
|
group: "behavior",
|
|
3127
|
+
owasp: "ASI01",
|
|
2982
3128
|
title: "Action after tainted output",
|
|
2983
3129
|
catches: "a network call or a write after a flagged file or a flagged tool output",
|
|
2984
3130
|
values: ALL,
|
|
@@ -2988,6 +3134,7 @@ var PRODUCT_CHECKS = [
|
|
|
2988
3134
|
{
|
|
2989
3135
|
id: "behavior.untrusted-content",
|
|
2990
3136
|
group: "behavior",
|
|
3137
|
+
owasp: "ASI01",
|
|
2991
3138
|
title: "Send after reading outside content",
|
|
2992
3139
|
catches: "a send to an unknown destination, a destination found in what was read, or a destructive call after the session read an email, a web page or an issue",
|
|
2993
3140
|
values: ["off", "log", "review"],
|
|
@@ -2998,6 +3145,7 @@ var PRODUCT_CHECKS = [
|
|
|
2998
3145
|
{
|
|
2999
3146
|
id: "loading.skill-tamper",
|
|
3000
3147
|
group: "loading",
|
|
3148
|
+
owasp: "ASI04",
|
|
3001
3149
|
title: "Skill file changed",
|
|
3002
3150
|
catches: "a skill or plugin file whose hash differs from the one approved",
|
|
3003
3151
|
values: ["off", "log", "block"],
|
|
@@ -3007,6 +3155,7 @@ var PRODUCT_CHECKS = [
|
|
|
3007
3155
|
{
|
|
3008
3156
|
id: "loading.mcp-tamper",
|
|
3009
3157
|
group: "loading",
|
|
3158
|
+
owasp: "ASI04",
|
|
3010
3159
|
title: "MCP server changed",
|
|
3011
3160
|
catches: "tool definitions that differ from the pinned ones",
|
|
3012
3161
|
values: ALL,
|
|
@@ -3016,6 +3165,7 @@ var PRODUCT_CHECKS = [
|
|
|
3016
3165
|
{
|
|
3017
3166
|
id: "loading.malicious-package",
|
|
3018
3167
|
group: "loading",
|
|
3168
|
+
owasp: "ASI04",
|
|
3019
3169
|
title: "Malicious package",
|
|
3020
3170
|
catches: "an install of a package the index flags",
|
|
3021
3171
|
values: ALL,
|
|
@@ -3025,6 +3175,7 @@ var PRODUCT_CHECKS = [
|
|
|
3025
3175
|
{
|
|
3026
3176
|
id: "loading.unknown-registry",
|
|
3027
3177
|
group: "loading",
|
|
3178
|
+
owasp: "ASI04",
|
|
3028
3179
|
title: "Package from an unknown registry",
|
|
3029
3180
|
catches: "an install that names a registry on the command line (--registry, --index-url, -i, npm_config_registry=\u2026) that is not the public one, not in your npm, yarn, bun, pip or uv config and not on the allowlist",
|
|
3030
3181
|
values: ALL,
|
|
@@ -3039,6 +3190,7 @@ var PRODUCT_CHECKS = [
|
|
|
3039
3190
|
{
|
|
3040
3191
|
id: "actions.money",
|
|
3041
3192
|
group: "actions",
|
|
3193
|
+
owasp: "ASI09",
|
|
3042
3194
|
title: "Money moves",
|
|
3043
3195
|
catches: "a refund, payout, transfer, charge or withdrawal through an app with no protection of its own",
|
|
3044
3196
|
values: ALL,
|
|
@@ -3051,6 +3203,7 @@ var PRODUCT_CHECKS = [
|
|
|
3051
3203
|
{
|
|
3052
3204
|
id: "actions.access",
|
|
3053
3205
|
group: "actions",
|
|
3206
|
+
owasp: "ASI09",
|
|
3054
3207
|
title: "Accounts and access change",
|
|
3055
3208
|
catches: "a password, key, role, permission or user changed through an app with no protection of its own",
|
|
3056
3209
|
values: ALL,
|
|
@@ -3060,6 +3213,7 @@ var PRODUCT_CHECKS = [
|
|
|
3060
3213
|
{
|
|
3061
3214
|
id: "actions.publish",
|
|
3062
3215
|
group: "actions",
|
|
3216
|
+
owasp: "ASI09",
|
|
3063
3217
|
title: "Something is published",
|
|
3064
3218
|
catches: "a release, package, deploy or public post through an app with no protection of its own",
|
|
3065
3219
|
values: ALL,
|
|
@@ -3072,6 +3226,7 @@ var PRODUCT_CHECKS = [
|
|
|
3072
3226
|
{
|
|
3073
3227
|
id: "actions.settings",
|
|
3074
3228
|
group: "actions",
|
|
3229
|
+
owasp: "ASI09",
|
|
3075
3230
|
title: "Repository, account and mailbox settings change",
|
|
3076
3231
|
catches: "a repository made public, a deploy key, webhook or CI secret added, branch protection changed, mail forwarded outside or a public share link, through an app",
|
|
3077
3232
|
values: ALL,
|
|
@@ -3081,6 +3236,7 @@ var PRODUCT_CHECKS = [
|
|
|
3081
3236
|
{
|
|
3082
3237
|
id: "actions.protected-branch",
|
|
3083
3238
|
group: "actions",
|
|
3239
|
+
owasp: "ASI09",
|
|
3084
3240
|
title: "The main branch changes through an app",
|
|
3085
3241
|
catches: "a merge, a commit straight to main or master, or a CI workflow file written through an app",
|
|
3086
3242
|
values: ALL,
|
|
@@ -3105,9 +3261,12 @@ function packRows() {
|
|
|
3105
3261
|
if (!rule.name || SHIELD_RULES_FOLDED_INTO_PRODUCT[rule.name]) continue;
|
|
3106
3262
|
const id = packRowId(shield.name, rule.name);
|
|
3107
3263
|
if (!id) continue;
|
|
3264
|
+
const owasp = packRowOwasp(id, shield.name);
|
|
3265
|
+
if (!owasp) throw new Error(`pack row ${id} has no OWASP risk: add the shield to owasp.ts`);
|
|
3108
3266
|
rows.push({
|
|
3109
3267
|
id,
|
|
3110
3268
|
group: "commands",
|
|
3269
|
+
owasp,
|
|
3111
3270
|
title: rule.name.replace(SHIELD_RULE_NAME, "$3").replace(/-/g, " "),
|
|
3112
3271
|
catches: rule.description ?? rule.reason ?? "",
|
|
3113
3272
|
values: ALL,
|
|
@@ -19306,7 +19465,7 @@ function matchCanaryArgs(args, values) {
|
|
|
19306
19465
|
// src/scan/canonical.ts
|
|
19307
19466
|
var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
|
|
19308
19467
|
var CANONICAL_EXTRACTOR_VERSION = "canonical-v36";
|
|
19309
|
-
var CANONICAL_EXTRACTOR_HASH = "
|
|
19468
|
+
var CANONICAL_EXTRACTOR_HASH = "814655319cb53ff9";
|
|
19310
19469
|
var DEDUPE_PREVIEW_LEN = 120;
|
|
19311
19470
|
function extractCanonicalFindings(call, ctx) {
|
|
19312
19471
|
const out = [];
|
|
@@ -19767,6 +19926,8 @@ export {
|
|
|
19767
19926
|
APP_SHIELD_NAMES,
|
|
19768
19927
|
APP_SHIELD_SPECS,
|
|
19769
19928
|
ARGUMENT_SCAN_LIMITS,
|
|
19929
|
+
ASI,
|
|
19930
|
+
ASI_IDS,
|
|
19770
19931
|
AST_FS_REGEX_RULES,
|
|
19771
19932
|
BASH_TOOL_NAMES,
|
|
19772
19933
|
BUILTIN_DANGEROUS_WORDS,
|
|
@@ -19804,9 +19965,11 @@ export {
|
|
|
19804
19965
|
MODE_VALUES,
|
|
19805
19966
|
NET_BINARIES,
|
|
19806
19967
|
PATTERN_VERB_NAMES,
|
|
19968
|
+
POSTURE_CATEGORY_OWASP,
|
|
19807
19969
|
PRIVILEGE_ESCALATION_RE,
|
|
19808
19970
|
REALTIME_PII_PATTERNS,
|
|
19809
19971
|
REPLACED_SHIELDS,
|
|
19972
|
+
SCAN_REPO_RULES_WITHOUT_RISK,
|
|
19810
19973
|
SCAN_SIGNAL_WEIGHTS,
|
|
19811
19974
|
SENSITIVE_PATH_RE,
|
|
19812
19975
|
SENSITIVE_PATH_REGEXES,
|
|
@@ -19891,6 +20054,7 @@ export {
|
|
|
19891
20054
|
inspectionEntry,
|
|
19892
20055
|
inspectionLayers,
|
|
19893
20056
|
isAgentInstructionPath,
|
|
20057
|
+
isAsiId,
|
|
19894
20058
|
isBashTool,
|
|
19895
20059
|
isBlockAll,
|
|
19896
20060
|
isDestructiveToolName,
|
|
@@ -19936,11 +20100,13 @@ export {
|
|
|
19936
20100
|
normalizePyPiName,
|
|
19937
20101
|
normalizeRecipient,
|
|
19938
20102
|
normalizeTrustedEntry,
|
|
20103
|
+
packRowOwasp,
|
|
19939
20104
|
parseAllSshHostsFromCommand,
|
|
19940
20105
|
parseDestHost,
|
|
19941
20106
|
patternShapeOf,
|
|
19942
20107
|
pipelineTexts,
|
|
19943
20108
|
positionedArgs,
|
|
20109
|
+
postureCategoryOwasp,
|
|
19944
20110
|
previewArgs,
|
|
19945
20111
|
redactText,
|
|
19946
20112
|
registryHost,
|
|
@@ -19957,6 +20123,7 @@ export {
|
|
|
19957
20123
|
scanArgumentSecrets,
|
|
19958
20124
|
scanInjection,
|
|
19959
20125
|
scanInstructionWrite,
|
|
20126
|
+
scanRepoRuleOwasp,
|
|
19960
20127
|
scanText,
|
|
19961
20128
|
scanViews,
|
|
19962
20129
|
sensitivePathMatch,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/policy-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.49.0",
|
|
4
4
|
"description": "Shared policy evaluation engine for node9 — DLP, smart rules, AST shell parsing, shields, loop detection. Pure functions, no I/O. Used by both node9-proxy and the node9 SaaS firewall.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://node9.ai",
|