@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.js
CHANGED
|
@@ -38,6 +38,8 @@ __export(src_exports, {
|
|
|
38
38
|
APP_SHIELD_NAMES: () => APP_SHIELD_NAMES,
|
|
39
39
|
APP_SHIELD_SPECS: () => APP_SHIELD_SPECS,
|
|
40
40
|
ARGUMENT_SCAN_LIMITS: () => ARGUMENT_SCAN_LIMITS,
|
|
41
|
+
ASI: () => ASI,
|
|
42
|
+
ASI_IDS: () => ASI_IDS,
|
|
41
43
|
AST_FS_REGEX_RULES: () => AST_FS_REGEX_RULES,
|
|
42
44
|
BASH_TOOL_NAMES: () => BASH_TOOL_NAMES,
|
|
43
45
|
BUILTIN_DANGEROUS_WORDS: () => BUILTIN_DANGEROUS_WORDS,
|
|
@@ -75,9 +77,11 @@ __export(src_exports, {
|
|
|
75
77
|
MODE_VALUES: () => MODE_VALUES,
|
|
76
78
|
NET_BINARIES: () => NET_BINARIES,
|
|
77
79
|
PATTERN_VERB_NAMES: () => PATTERN_VERB_NAMES,
|
|
80
|
+
POSTURE_CATEGORY_OWASP: () => POSTURE_CATEGORY_OWASP,
|
|
78
81
|
PRIVILEGE_ESCALATION_RE: () => PRIVILEGE_ESCALATION_RE,
|
|
79
82
|
REALTIME_PII_PATTERNS: () => REALTIME_PII_PATTERNS,
|
|
80
83
|
REPLACED_SHIELDS: () => REPLACED_SHIELDS,
|
|
84
|
+
SCAN_REPO_RULES_WITHOUT_RISK: () => SCAN_REPO_RULES_WITHOUT_RISK,
|
|
81
85
|
SCAN_SIGNAL_WEIGHTS: () => SCAN_SIGNAL_WEIGHTS,
|
|
82
86
|
SENSITIVE_PATH_RE: () => SENSITIVE_PATH_RE,
|
|
83
87
|
SENSITIVE_PATH_REGEXES: () => SENSITIVE_PATH_REGEXES,
|
|
@@ -162,6 +166,7 @@ __export(src_exports, {
|
|
|
162
166
|
inspectionEntry: () => inspectionEntry,
|
|
163
167
|
inspectionLayers: () => inspectionLayers,
|
|
164
168
|
isAgentInstructionPath: () => isAgentInstructionPath,
|
|
169
|
+
isAsiId: () => isAsiId,
|
|
165
170
|
isBashTool: () => isBashTool,
|
|
166
171
|
isBlockAll: () => isBlockAll,
|
|
167
172
|
isDestructiveToolName: () => isDestructiveToolName,
|
|
@@ -207,11 +212,13 @@ __export(src_exports, {
|
|
|
207
212
|
normalizePyPiName: () => normalizePyPiName,
|
|
208
213
|
normalizeRecipient: () => normalizeRecipient,
|
|
209
214
|
normalizeTrustedEntry: () => normalizeTrustedEntry,
|
|
215
|
+
packRowOwasp: () => packRowOwasp,
|
|
210
216
|
parseAllSshHostsFromCommand: () => parseAllSshHostsFromCommand,
|
|
211
217
|
parseDestHost: () => parseDestHost,
|
|
212
218
|
patternShapeOf: () => patternShapeOf,
|
|
213
219
|
pipelineTexts: () => pipelineTexts,
|
|
214
220
|
positionedArgs: () => positionedArgs,
|
|
221
|
+
postureCategoryOwasp: () => postureCategoryOwasp,
|
|
215
222
|
previewArgs: () => previewArgs,
|
|
216
223
|
redactText: () => redactText,
|
|
217
224
|
registryHost: () => registryHost,
|
|
@@ -228,6 +235,7 @@ __export(src_exports, {
|
|
|
228
235
|
scanArgumentSecrets: () => scanArgumentSecrets,
|
|
229
236
|
scanInjection: () => scanInjection,
|
|
230
237
|
scanInstructionWrite: () => scanInstructionWrite,
|
|
238
|
+
scanRepoRuleOwasp: () => scanRepoRuleOwasp,
|
|
231
239
|
scanText: () => scanText,
|
|
232
240
|
scanViews: () => scanViews,
|
|
233
241
|
sensitivePathMatch: () => sensitivePathMatch,
|
|
@@ -2805,6 +2813,107 @@ function levelPackageSignals(mode) {
|
|
|
2805
2813
|
return levelOf(mode) === "soft" ? { newPackage: "off", installScript: "off" } : void 0;
|
|
2806
2814
|
}
|
|
2807
2815
|
|
|
2816
|
+
// src/owasp.ts
|
|
2817
|
+
var ASI = {
|
|
2818
|
+
ASI01: "Agent Goal Hijack",
|
|
2819
|
+
ASI02: "Tool Misuse and Exploitation",
|
|
2820
|
+
ASI03: "Identity and Privilege Abuse",
|
|
2821
|
+
ASI04: "Agentic Supply Chain Vulnerabilities",
|
|
2822
|
+
ASI05: "Unexpected Code Execution",
|
|
2823
|
+
ASI06: "Memory and Context Poisoning",
|
|
2824
|
+
ASI07: "Insecure Inter-Agent Communication",
|
|
2825
|
+
ASI08: "Cascading Failures",
|
|
2826
|
+
ASI09: "Human-Agent Trust Exploitation",
|
|
2827
|
+
ASI10: "Rogue Agents"
|
|
2828
|
+
};
|
|
2829
|
+
var ASI_IDS = Object.keys(ASI);
|
|
2830
|
+
function isAsiId(v) {
|
|
2831
|
+
return typeof v === "string" && Object.prototype.hasOwnProperty.call(ASI, v);
|
|
2832
|
+
}
|
|
2833
|
+
var PACK_SHIELD_OWASP = {
|
|
2834
|
+
aws: "ASI02",
|
|
2835
|
+
"bash-safe": "ASI02",
|
|
2836
|
+
docker: "ASI02",
|
|
2837
|
+
filesystem: "ASI02",
|
|
2838
|
+
github: "ASI02",
|
|
2839
|
+
k8s: "ASI02",
|
|
2840
|
+
mongodb: "ASI02",
|
|
2841
|
+
postgres: "ASI02",
|
|
2842
|
+
redis: "ASI02",
|
|
2843
|
+
stripe: "ASI09",
|
|
2844
|
+
paypal: "ASI09",
|
|
2845
|
+
square: "ASI09",
|
|
2846
|
+
plaid: "ASI09",
|
|
2847
|
+
okta: "ASI09",
|
|
2848
|
+
auth0: "ASI09"
|
|
2849
|
+
};
|
|
2850
|
+
var PACK_RULE_OWASP = {
|
|
2851
|
+
"packs.bash-safe.pipe-to-shell": "ASI05",
|
|
2852
|
+
"packs.bash-safe.obfuscated-exec": "ASI05",
|
|
2853
|
+
"packs.bash-safe.eval-remote": "ASI05",
|
|
2854
|
+
"packs.bash-safe.eval-dynamic": "ASI05",
|
|
2855
|
+
"packs.aws.iam-changes": "ASI03",
|
|
2856
|
+
"packs.postgres.grant-revoke": "ASI03"
|
|
2857
|
+
};
|
|
2858
|
+
function packRowOwasp(id, shield) {
|
|
2859
|
+
return PACK_RULE_OWASP[id] ?? PACK_SHIELD_OWASP[shield];
|
|
2860
|
+
}
|
|
2861
|
+
var POSTURE_CATEGORY_OWASP = {
|
|
2862
|
+
Secrets: "ASI03",
|
|
2863
|
+
Data: "ASI03",
|
|
2864
|
+
Privilege: "ASI03",
|
|
2865
|
+
Egress: "ASI02",
|
|
2866
|
+
"Approval gate": "ASI02",
|
|
2867
|
+
"Agent permissions": "ASI02",
|
|
2868
|
+
"Tool governance": "ASI02",
|
|
2869
|
+
Files: "ASI02",
|
|
2870
|
+
Inbound: "ASI02",
|
|
2871
|
+
"Agent inbound": "ASI02",
|
|
2872
|
+
"Network exposure": "ASI02",
|
|
2873
|
+
"Supply chain": "ASI04",
|
|
2874
|
+
"Instruction files": "ASI06",
|
|
2875
|
+
"Outside content": "ASI01",
|
|
2876
|
+
Isolation: "ASI05",
|
|
2877
|
+
Approvals: "ASI09",
|
|
2878
|
+
Cost: "ASI08",
|
|
2879
|
+
Coverage: "ASI10"
|
|
2880
|
+
};
|
|
2881
|
+
function postureCategoryOwasp(category) {
|
|
2882
|
+
return POSTURE_CATEGORY_OWASP[category];
|
|
2883
|
+
}
|
|
2884
|
+
var SCAN_REPO_RULE_OWASP = [
|
|
2885
|
+
// CI-1: tool rules and hooks in agent config
|
|
2886
|
+
["CI-1.broad-allow", "ASI02"],
|
|
2887
|
+
["CI-1.exec-escape-grant", "ASI02"],
|
|
2888
|
+
["CI-1.codex-unsafe-defaults", "ASI02"],
|
|
2889
|
+
["CI-1.skill-allowed-tools", "ASI02"],
|
|
2890
|
+
["CI-1.skill-untrusted-input", "ASI01"],
|
|
2891
|
+
["CI-1.hook-remote-code", "ASI05"],
|
|
2892
|
+
["CI-1.hook-script", "ASI05"],
|
|
2893
|
+
["CI-1.unfollowable-symlink", "ASI04"],
|
|
2894
|
+
// CI-2: workflows that run agents on outside content
|
|
2895
|
+
["CI-2.", "ASI01"],
|
|
2896
|
+
// CI-3: MCP servers and plugins
|
|
2897
|
+
["CI-3.mcp-inline-credential", "ASI03"],
|
|
2898
|
+
["CI-3.mcp-unpinned", "ASI04"],
|
|
2899
|
+
["CI-3.plugin-unpinned", "ASI04"],
|
|
2900
|
+
// CI-4: secrets an agent step can reach
|
|
2901
|
+
["CI-4.", "ASI03"],
|
|
2902
|
+
// CI-6: instruction files and skills
|
|
2903
|
+
["CI-6.skill-script", "ASI05"],
|
|
2904
|
+
["CI-6.", "ASI06"]
|
|
2905
|
+
];
|
|
2906
|
+
var SCAN_REPO_RULES_WITHOUT_RISK = ["CI-0."];
|
|
2907
|
+
function scanRepoRuleOwasp(rule) {
|
|
2908
|
+
let best;
|
|
2909
|
+
for (const entry of SCAN_REPO_RULE_OWASP) {
|
|
2910
|
+
if (rule === entry[0] || rule.startsWith(entry[0])) {
|
|
2911
|
+
if (!best || entry[0].length > best[0].length) best = entry;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
return best?.[1];
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2808
2917
|
// src/catalog.ts
|
|
2809
2918
|
var VERDICTS = ["off", "log", "review", "block"];
|
|
2810
2919
|
var CHECK_VERDICT_RANK = { off: 0, log: 1, review: 2, block: 3 };
|
|
@@ -2826,6 +2935,7 @@ var PRODUCT_CHECKS = [
|
|
|
2826
2935
|
{
|
|
2827
2936
|
id: "files.shell-startup",
|
|
2828
2937
|
group: "files",
|
|
2938
|
+
owasp: "ASI02",
|
|
2829
2939
|
title: "Shell startup files",
|
|
2830
2940
|
catches: "Writes, replacements and removals of personal shell startup files",
|
|
2831
2941
|
values: ALL,
|
|
@@ -2835,6 +2945,7 @@ var PRODUCT_CHECKS = [
|
|
|
2835
2945
|
{
|
|
2836
2946
|
id: "files.system-auth",
|
|
2837
2947
|
group: "files",
|
|
2948
|
+
owasp: "ASI03",
|
|
2838
2949
|
title: "System authentication files",
|
|
2839
2950
|
catches: "Changes to system authentication files and PAM configuration",
|
|
2840
2951
|
values: ["block"],
|
|
@@ -2845,6 +2956,7 @@ var PRODUCT_CHECKS = [
|
|
|
2845
2956
|
{
|
|
2846
2957
|
id: "files.password-hashes",
|
|
2847
2958
|
group: "files",
|
|
2959
|
+
owasp: "ASI03",
|
|
2848
2960
|
title: "System password hashes",
|
|
2849
2961
|
catches: "Reads and copies of /etc/shadow and /etc/gshadow",
|
|
2850
2962
|
values: ALL,
|
|
@@ -2854,6 +2966,7 @@ var PRODUCT_CHECKS = [
|
|
|
2854
2966
|
{
|
|
2855
2967
|
id: "files.system-dirs",
|
|
2856
2968
|
group: "files",
|
|
2969
|
+
owasp: "ASI02",
|
|
2857
2970
|
title: "System directories",
|
|
2858
2971
|
catches: "Writes, new files and removals under /usr, /etc, /boot, /bin, /sbin, /lib and /var/log, and uploads of system files",
|
|
2859
2972
|
values: ALL,
|
|
@@ -2863,6 +2976,7 @@ var PRODUCT_CHECKS = [
|
|
|
2863
2976
|
{
|
|
2864
2977
|
id: "files.agent-instructions",
|
|
2865
2978
|
group: "files",
|
|
2979
|
+
owasp: "ASI06",
|
|
2866
2980
|
title: "Agent instruction and memory files",
|
|
2867
2981
|
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",
|
|
2868
2982
|
values: ALL,
|
|
@@ -2873,6 +2987,7 @@ var PRODUCT_CHECKS = [
|
|
|
2873
2987
|
{
|
|
2874
2988
|
id: "commands.inline-exec",
|
|
2875
2989
|
group: "commands",
|
|
2990
|
+
owasp: "ASI05",
|
|
2876
2991
|
title: "Inline code execution",
|
|
2877
2992
|
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",
|
|
2878
2993
|
values: ALL,
|
|
@@ -2882,6 +2997,7 @@ var PRODUCT_CHECKS = [
|
|
|
2882
2997
|
{
|
|
2883
2998
|
id: "commands.eval-dynamic",
|
|
2884
2999
|
group: "commands",
|
|
3000
|
+
owasp: "ASI05",
|
|
2885
3001
|
title: "Eval of dynamic content",
|
|
2886
3002
|
catches: "generated executable names, shell code from stdin, or dynamic eval/-c payloads",
|
|
2887
3003
|
values: ALL,
|
|
@@ -2891,6 +3007,7 @@ var PRODUCT_CHECKS = [
|
|
|
2891
3007
|
{
|
|
2892
3008
|
id: "commands.eval-remote",
|
|
2893
3009
|
group: "commands",
|
|
3010
|
+
owasp: "ASI05",
|
|
2894
3011
|
title: "Eval of a remote download",
|
|
2895
3012
|
catches: "eval or sh over the output of curl or wget",
|
|
2896
3013
|
values: ["block"],
|
|
@@ -2901,6 +3018,7 @@ var PRODUCT_CHECKS = [
|
|
|
2901
3018
|
{
|
|
2902
3019
|
id: "commands.curl-pipe-shell",
|
|
2903
3020
|
group: "commands",
|
|
3021
|
+
owasp: "ASI05",
|
|
2904
3022
|
title: "Remote script piped into a shell",
|
|
2905
3023
|
catches: "curl or wget piped into sh, bash, zsh or PowerShell",
|
|
2906
3024
|
values: ALL,
|
|
@@ -2910,6 +3028,7 @@ var PRODUCT_CHECKS = [
|
|
|
2910
3028
|
{
|
|
2911
3029
|
id: "commands.rm",
|
|
2912
3030
|
group: "commands",
|
|
3031
|
+
owasp: "ASI02",
|
|
2913
3032
|
title: "Delete files",
|
|
2914
3033
|
catches: "rm outside the known build-artifact paths",
|
|
2915
3034
|
values: ALL,
|
|
@@ -2919,6 +3038,7 @@ var PRODUCT_CHECKS = [
|
|
|
2919
3038
|
{
|
|
2920
3039
|
id: "commands.rm-home",
|
|
2921
3040
|
group: "commands",
|
|
3041
|
+
owasp: "ASI02",
|
|
2922
3042
|
title: "Recursive delete of the home directory",
|
|
2923
3043
|
catches: "rm -rf on ~, $HOME, /home or /",
|
|
2924
3044
|
values: ["block"],
|
|
@@ -2929,6 +3049,7 @@ var PRODUCT_CHECKS = [
|
|
|
2929
3049
|
{
|
|
2930
3050
|
id: "commands.chmod",
|
|
2931
3051
|
group: "commands",
|
|
3052
|
+
owasp: "ASI02",
|
|
2932
3053
|
title: "World-writable permissions",
|
|
2933
3054
|
catches: "chmod 777, 0777 or a+rwx",
|
|
2934
3055
|
values: ALL,
|
|
@@ -2938,6 +3059,7 @@ var PRODUCT_CHECKS = [
|
|
|
2938
3059
|
{
|
|
2939
3060
|
id: "commands.sudo",
|
|
2940
3061
|
group: "commands",
|
|
3062
|
+
owasp: "ASI03",
|
|
2941
3063
|
title: "Elevated privileges",
|
|
2942
3064
|
catches: "a command run through sudo",
|
|
2943
3065
|
values: ALL,
|
|
@@ -2947,6 +3069,7 @@ var PRODUCT_CHECKS = [
|
|
|
2947
3069
|
{
|
|
2948
3070
|
id: "commands.git-destructive",
|
|
2949
3071
|
group: "commands",
|
|
3072
|
+
owasp: "ASI02",
|
|
2950
3073
|
title: "Destructive git operation",
|
|
2951
3074
|
catches: "force push, reset --hard, clean -f, branch -D or tag delete, also through -C, env, wrappers, variables and aliases",
|
|
2952
3075
|
values: ALL,
|
|
@@ -2956,6 +3079,7 @@ var PRODUCT_CHECKS = [
|
|
|
2956
3079
|
{
|
|
2957
3080
|
id: "commands.git-hooks-bypass",
|
|
2958
3081
|
group: "commands",
|
|
3082
|
+
owasp: "ASI10",
|
|
2959
3083
|
title: "Git hooks bypassed",
|
|
2960
3084
|
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",
|
|
2961
3085
|
values: ALL,
|
|
@@ -2965,6 +3089,7 @@ var PRODUCT_CHECKS = [
|
|
|
2965
3089
|
{
|
|
2966
3090
|
id: "commands.git-stage-all",
|
|
2967
3091
|
group: "commands",
|
|
3092
|
+
owasp: "ASI02",
|
|
2968
3093
|
title: "Stage everything at once",
|
|
2969
3094
|
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",
|
|
2970
3095
|
values: ALL,
|
|
@@ -2974,6 +3099,7 @@ var PRODUCT_CHECKS = [
|
|
|
2974
3099
|
{
|
|
2975
3100
|
id: "commands.reverse-shell",
|
|
2976
3101
|
group: "commands",
|
|
3102
|
+
owasp: "ASI05",
|
|
2977
3103
|
title: "Reverse shell",
|
|
2978
3104
|
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",
|
|
2979
3105
|
values: ALL,
|
|
@@ -2983,6 +3109,7 @@ var PRODUCT_CHECKS = [
|
|
|
2983
3109
|
{
|
|
2984
3110
|
id: "commands.node9-disarm",
|
|
2985
3111
|
group: "commands",
|
|
3112
|
+
owasp: "ASI10",
|
|
2986
3113
|
title: "node9 disarmed from the shell",
|
|
2987
3114
|
catches: "a node9 command that clears a session flag, trusts a destination, pauses the gate or weakens a shield, run by the agent",
|
|
2988
3115
|
values: ALL,
|
|
@@ -2992,6 +3119,7 @@ var PRODUCT_CHECKS = [
|
|
|
2992
3119
|
{
|
|
2993
3120
|
id: "commands.sql-ddl",
|
|
2994
3121
|
group: "commands",
|
|
3122
|
+
owasp: "ASI02",
|
|
2995
3123
|
title: "Drop or truncate",
|
|
2996
3124
|
catches: "DROP or TRUNCATE through a database CLI or a database tool",
|
|
2997
3125
|
values: ALL,
|
|
@@ -3006,6 +3134,7 @@ var PRODUCT_CHECKS = [
|
|
|
3006
3134
|
{
|
|
3007
3135
|
id: "commands.sql-no-where",
|
|
3008
3136
|
group: "commands",
|
|
3137
|
+
owasp: "ASI02",
|
|
3009
3138
|
title: "Unscoped SQL mutation",
|
|
3010
3139
|
catches: "DELETE or UPDATE without a WHERE clause",
|
|
3011
3140
|
values: ALL,
|
|
@@ -3015,6 +3144,7 @@ var PRODUCT_CHECKS = [
|
|
|
3015
3144
|
{
|
|
3016
3145
|
id: "commands.temp-binary",
|
|
3017
3146
|
group: "commands",
|
|
3147
|
+
owasp: "ASI05",
|
|
3018
3148
|
title: "Binary from a temp directory",
|
|
3019
3149
|
catches: "an absolute path under /tmp, /var/tmp, /dev/shm or a world-writable file",
|
|
3020
3150
|
values: ALL,
|
|
@@ -3024,6 +3154,7 @@ var PRODUCT_CHECKS = [
|
|
|
3024
3154
|
{
|
|
3025
3155
|
id: "commands.disk-destroy",
|
|
3026
3156
|
group: "commands",
|
|
3157
|
+
owasp: "ASI02",
|
|
3027
3158
|
title: "Disk or filesystem destruction",
|
|
3028
3159
|
catches: "mkfs, shred, dd and the manual-terminal disaster list",
|
|
3029
3160
|
values: ALL,
|
|
@@ -3033,6 +3164,7 @@ var PRODUCT_CHECKS = [
|
|
|
3033
3164
|
{
|
|
3034
3165
|
id: "commands.dangerous-word",
|
|
3035
3166
|
group: "commands",
|
|
3167
|
+
owasp: "ASI02",
|
|
3036
3168
|
title: "Dangerous word",
|
|
3037
3169
|
catches: "a word from a pack or from the config dangerousWords list",
|
|
3038
3170
|
values: ALL,
|
|
@@ -3041,6 +3173,7 @@ var PRODUCT_CHECKS = [
|
|
|
3041
3173
|
{
|
|
3042
3174
|
id: "commands.unanalysable",
|
|
3043
3175
|
group: "commands",
|
|
3176
|
+
owasp: "ASI02",
|
|
3044
3177
|
title: "Command too nested to analyse",
|
|
3045
3178
|
catches: "wrappers nested past the depth the shell parser follows",
|
|
3046
3179
|
values: ALL,
|
|
@@ -3050,6 +3183,7 @@ var PRODUCT_CHECKS = [
|
|
|
3050
3183
|
{
|
|
3051
3184
|
id: "commands.unknown",
|
|
3052
3185
|
group: "commands",
|
|
3186
|
+
owasp: "ASI02",
|
|
3053
3187
|
title: "Any command no check recognised",
|
|
3054
3188
|
catches: "the strict-mode catch-all",
|
|
3055
3189
|
values: ["off", "review"],
|
|
@@ -3060,6 +3194,7 @@ var PRODUCT_CHECKS = [
|
|
|
3060
3194
|
{
|
|
3061
3195
|
id: "data.secrets",
|
|
3062
3196
|
group: "data",
|
|
3197
|
+
owasp: "ASI03",
|
|
3063
3198
|
title: "Secret in arguments",
|
|
3064
3199
|
catches: "an API key, token or private key matching one of the DLP patterns",
|
|
3065
3200
|
values: ALL,
|
|
@@ -3069,6 +3204,7 @@ var PRODUCT_CHECKS = [
|
|
|
3069
3204
|
{
|
|
3070
3205
|
id: "data.secrets-weak",
|
|
3071
3206
|
group: "data",
|
|
3207
|
+
owasp: "ASI03",
|
|
3072
3208
|
title: "Weak credential in arguments",
|
|
3073
3209
|
catches: "a JWT or a bearer token",
|
|
3074
3210
|
values: ALL,
|
|
@@ -3078,6 +3214,7 @@ var PRODUCT_CHECKS = [
|
|
|
3078
3214
|
{
|
|
3079
3215
|
id: "data.pii",
|
|
3080
3216
|
group: "data",
|
|
3217
|
+
owasp: "ASI02",
|
|
3081
3218
|
title: "Personal data in arguments",
|
|
3082
3219
|
catches: "a social security number or a credit card number",
|
|
3083
3220
|
values: ALL,
|
|
@@ -3087,6 +3224,7 @@ var PRODUCT_CHECKS = [
|
|
|
3087
3224
|
{
|
|
3088
3225
|
id: "data.credential-files",
|
|
3089
3226
|
group: "data",
|
|
3227
|
+
owasp: "ASI03",
|
|
3090
3228
|
title: "Credential file read",
|
|
3091
3229
|
catches: "~/.ssh, ~/.aws and .env files, through any reader or any file tool",
|
|
3092
3230
|
values: ALL,
|
|
@@ -3095,6 +3233,7 @@ var PRODUCT_CHECKS = [
|
|
|
3095
3233
|
{
|
|
3096
3234
|
id: "data.credential-files-other",
|
|
3097
3235
|
group: "data",
|
|
3236
|
+
owasp: "ASI03",
|
|
3098
3237
|
title: "Other credential file",
|
|
3099
3238
|
catches: ".netrc, .npmrc, kube and docker config, and a copy of any credential file",
|
|
3100
3239
|
values: ALL,
|
|
@@ -3103,6 +3242,7 @@ var PRODUCT_CHECKS = [
|
|
|
3103
3242
|
{
|
|
3104
3243
|
id: "data.credential-files-unknown",
|
|
3105
3244
|
group: "data",
|
|
3245
|
+
owasp: "ASI03",
|
|
3106
3246
|
title: "Files read by names known only at run time",
|
|
3107
3247
|
catches: "a reader fed names from a listing that can include credential files (find . | xargs cat)",
|
|
3108
3248
|
values: ALL,
|
|
@@ -3111,6 +3251,7 @@ var PRODUCT_CHECKS = [
|
|
|
3111
3251
|
{
|
|
3112
3252
|
id: "data.pipe-chain",
|
|
3113
3253
|
group: "data",
|
|
3254
|
+
owasp: "ASI03",
|
|
3114
3255
|
title: "Sensitive file piped to the network",
|
|
3115
3256
|
catches: "a credential file read and piped into curl, nc or ssh",
|
|
3116
3257
|
values: ALL,
|
|
@@ -3120,6 +3261,7 @@ var PRODUCT_CHECKS = [
|
|
|
3120
3261
|
{
|
|
3121
3262
|
id: "data.pipe-chain-obfuscated",
|
|
3122
3263
|
group: "data",
|
|
3264
|
+
owasp: "ASI03",
|
|
3123
3265
|
title: "Obfuscated exfiltration",
|
|
3124
3266
|
catches: "a sensitive file encoded or compressed on its way to the network",
|
|
3125
3267
|
values: ALL,
|
|
@@ -3132,6 +3274,7 @@ var PRODUCT_CHECKS = [
|
|
|
3132
3274
|
{
|
|
3133
3275
|
id: "data.env-exfil",
|
|
3134
3276
|
group: "data",
|
|
3277
|
+
owasp: "ASI03",
|
|
3135
3278
|
title: "Environment sent out",
|
|
3136
3279
|
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",
|
|
3137
3280
|
values: ALL,
|
|
@@ -3141,6 +3284,7 @@ var PRODUCT_CHECKS = [
|
|
|
3141
3284
|
{
|
|
3142
3285
|
id: "data.output-secrets",
|
|
3143
3286
|
group: "data",
|
|
3287
|
+
owasp: "ASI03",
|
|
3144
3288
|
title: "Secret in tool output",
|
|
3145
3289
|
catches: "a credential a tool returned; the session is tainted, nothing is stopped",
|
|
3146
3290
|
values: ["off", "log"],
|
|
@@ -3149,6 +3293,7 @@ var PRODUCT_CHECKS = [
|
|
|
3149
3293
|
{
|
|
3150
3294
|
id: "data.prompt-secrets",
|
|
3151
3295
|
group: "data",
|
|
3296
|
+
owasp: "ASI03",
|
|
3152
3297
|
title: "Secret in the prompt",
|
|
3153
3298
|
catches: "a credential pasted into the conversation",
|
|
3154
3299
|
values: ALL,
|
|
@@ -3157,6 +3302,7 @@ var PRODUCT_CHECKS = [
|
|
|
3157
3302
|
{
|
|
3158
3303
|
id: "data.canary",
|
|
3159
3304
|
group: "data",
|
|
3305
|
+
owasp: "ASI03",
|
|
3160
3306
|
title: "Decoy credential used",
|
|
3161
3307
|
catches: "a planted decoy value appears in a tool call",
|
|
3162
3308
|
values: ALL,
|
|
@@ -3167,6 +3313,7 @@ var PRODUCT_CHECKS = [
|
|
|
3167
3313
|
{
|
|
3168
3314
|
id: "network.unknown-host",
|
|
3169
3315
|
group: "network",
|
|
3316
|
+
owasp: "ASI02",
|
|
3170
3317
|
title: "Unknown host",
|
|
3171
3318
|
catches: "a destination on neither the allowlist nor the builtin list",
|
|
3172
3319
|
values: ["off", "review", "block"],
|
|
@@ -3176,6 +3323,7 @@ var PRODUCT_CHECKS = [
|
|
|
3176
3323
|
{
|
|
3177
3324
|
id: "network.internal-addresses",
|
|
3178
3325
|
group: "network",
|
|
3326
|
+
owasp: "ASI02",
|
|
3179
3327
|
title: "Internal address",
|
|
3180
3328
|
catches: "loopback, the RFC 1918 ranges and carrier-grade NAT",
|
|
3181
3329
|
values: ["off", "block"],
|
|
@@ -3184,6 +3332,7 @@ var PRODUCT_CHECKS = [
|
|
|
3184
3332
|
{
|
|
3185
3333
|
id: "network.metadata",
|
|
3186
3334
|
group: "network",
|
|
3335
|
+
owasp: "ASI02",
|
|
3187
3336
|
title: "Cloud metadata address",
|
|
3188
3337
|
catches: "169.254.169.254 and its peers, link-local and multicast",
|
|
3189
3338
|
values: ["block"],
|
|
@@ -3194,6 +3343,7 @@ var PRODUCT_CHECKS = [
|
|
|
3194
3343
|
{
|
|
3195
3344
|
id: "network.taint-egress",
|
|
3196
3345
|
group: "network",
|
|
3346
|
+
owasp: "ASI01",
|
|
3197
3347
|
title: "Tainted data sent out",
|
|
3198
3348
|
catches: "a file or an output flagged earlier in the session reaches a host not on the allowlist",
|
|
3199
3349
|
values: ALL,
|
|
@@ -3207,6 +3357,7 @@ var PRODUCT_CHECKS = [
|
|
|
3207
3357
|
{
|
|
3208
3358
|
id: "files.jail",
|
|
3209
3359
|
group: "files",
|
|
3360
|
+
owasp: "ASI03",
|
|
3210
3361
|
title: "Jailed path",
|
|
3211
3362
|
catches: "a path the workspace or the developer added to the jail",
|
|
3212
3363
|
values: ALL,
|
|
@@ -3216,6 +3367,7 @@ var PRODUCT_CHECKS = [
|
|
|
3216
3367
|
{
|
|
3217
3368
|
id: "behavior.loops",
|
|
3218
3369
|
group: "behavior",
|
|
3370
|
+
owasp: "ASI08",
|
|
3219
3371
|
title: "Runaway loop",
|
|
3220
3372
|
catches: "the same tool call repeated past the threshold inside the window",
|
|
3221
3373
|
values: ["off", "block"],
|
|
@@ -3225,6 +3377,7 @@ var PRODUCT_CHECKS = [
|
|
|
3225
3377
|
{
|
|
3226
3378
|
id: "behavior.prompt-injection",
|
|
3227
3379
|
group: "behavior",
|
|
3380
|
+
owasp: "ASI01",
|
|
3228
3381
|
title: "Prompt injection in tool output",
|
|
3229
3382
|
catches: "instructions aimed at the model inside content a tool returned",
|
|
3230
3383
|
values: ["off", "log"],
|
|
@@ -3233,6 +3386,7 @@ var PRODUCT_CHECKS = [
|
|
|
3233
3386
|
{
|
|
3234
3387
|
id: "behavior.session-taint",
|
|
3235
3388
|
group: "behavior",
|
|
3389
|
+
owasp: "ASI01",
|
|
3236
3390
|
title: "Action after tainted output",
|
|
3237
3391
|
catches: "a network call or a write after a flagged file or a flagged tool output",
|
|
3238
3392
|
values: ALL,
|
|
@@ -3242,6 +3396,7 @@ var PRODUCT_CHECKS = [
|
|
|
3242
3396
|
{
|
|
3243
3397
|
id: "behavior.untrusted-content",
|
|
3244
3398
|
group: "behavior",
|
|
3399
|
+
owasp: "ASI01",
|
|
3245
3400
|
title: "Send after reading outside content",
|
|
3246
3401
|
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",
|
|
3247
3402
|
values: ["off", "log", "review"],
|
|
@@ -3252,6 +3407,7 @@ var PRODUCT_CHECKS = [
|
|
|
3252
3407
|
{
|
|
3253
3408
|
id: "loading.skill-tamper",
|
|
3254
3409
|
group: "loading",
|
|
3410
|
+
owasp: "ASI04",
|
|
3255
3411
|
title: "Skill file changed",
|
|
3256
3412
|
catches: "a skill or plugin file whose hash differs from the one approved",
|
|
3257
3413
|
values: ["off", "log", "block"],
|
|
@@ -3261,6 +3417,7 @@ var PRODUCT_CHECKS = [
|
|
|
3261
3417
|
{
|
|
3262
3418
|
id: "loading.mcp-tamper",
|
|
3263
3419
|
group: "loading",
|
|
3420
|
+
owasp: "ASI04",
|
|
3264
3421
|
title: "MCP server changed",
|
|
3265
3422
|
catches: "tool definitions that differ from the pinned ones",
|
|
3266
3423
|
values: ALL,
|
|
@@ -3270,6 +3427,7 @@ var PRODUCT_CHECKS = [
|
|
|
3270
3427
|
{
|
|
3271
3428
|
id: "loading.malicious-package",
|
|
3272
3429
|
group: "loading",
|
|
3430
|
+
owasp: "ASI04",
|
|
3273
3431
|
title: "Malicious package",
|
|
3274
3432
|
catches: "an install of a package the index flags",
|
|
3275
3433
|
values: ALL,
|
|
@@ -3279,6 +3437,7 @@ var PRODUCT_CHECKS = [
|
|
|
3279
3437
|
{
|
|
3280
3438
|
id: "loading.unknown-registry",
|
|
3281
3439
|
group: "loading",
|
|
3440
|
+
owasp: "ASI04",
|
|
3282
3441
|
title: "Package from an unknown registry",
|
|
3283
3442
|
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",
|
|
3284
3443
|
values: ALL,
|
|
@@ -3293,6 +3452,7 @@ var PRODUCT_CHECKS = [
|
|
|
3293
3452
|
{
|
|
3294
3453
|
id: "actions.money",
|
|
3295
3454
|
group: "actions",
|
|
3455
|
+
owasp: "ASI09",
|
|
3296
3456
|
title: "Money moves",
|
|
3297
3457
|
catches: "a refund, payout, transfer, charge or withdrawal through an app with no protection of its own",
|
|
3298
3458
|
values: ALL,
|
|
@@ -3305,6 +3465,7 @@ var PRODUCT_CHECKS = [
|
|
|
3305
3465
|
{
|
|
3306
3466
|
id: "actions.access",
|
|
3307
3467
|
group: "actions",
|
|
3468
|
+
owasp: "ASI09",
|
|
3308
3469
|
title: "Accounts and access change",
|
|
3309
3470
|
catches: "a password, key, role, permission or user changed through an app with no protection of its own",
|
|
3310
3471
|
values: ALL,
|
|
@@ -3314,6 +3475,7 @@ var PRODUCT_CHECKS = [
|
|
|
3314
3475
|
{
|
|
3315
3476
|
id: "actions.publish",
|
|
3316
3477
|
group: "actions",
|
|
3478
|
+
owasp: "ASI09",
|
|
3317
3479
|
title: "Something is published",
|
|
3318
3480
|
catches: "a release, package, deploy or public post through an app with no protection of its own",
|
|
3319
3481
|
values: ALL,
|
|
@@ -3326,6 +3488,7 @@ var PRODUCT_CHECKS = [
|
|
|
3326
3488
|
{
|
|
3327
3489
|
id: "actions.settings",
|
|
3328
3490
|
group: "actions",
|
|
3491
|
+
owasp: "ASI09",
|
|
3329
3492
|
title: "Repository, account and mailbox settings change",
|
|
3330
3493
|
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",
|
|
3331
3494
|
values: ALL,
|
|
@@ -3335,6 +3498,7 @@ var PRODUCT_CHECKS = [
|
|
|
3335
3498
|
{
|
|
3336
3499
|
id: "actions.protected-branch",
|
|
3337
3500
|
group: "actions",
|
|
3501
|
+
owasp: "ASI09",
|
|
3338
3502
|
title: "The main branch changes through an app",
|
|
3339
3503
|
catches: "a merge, a commit straight to main or master, or a CI workflow file written through an app",
|
|
3340
3504
|
values: ALL,
|
|
@@ -3359,9 +3523,12 @@ function packRows() {
|
|
|
3359
3523
|
if (!rule.name || SHIELD_RULES_FOLDED_INTO_PRODUCT[rule.name]) continue;
|
|
3360
3524
|
const id = packRowId(shield.name, rule.name);
|
|
3361
3525
|
if (!id) continue;
|
|
3526
|
+
const owasp = packRowOwasp(id, shield.name);
|
|
3527
|
+
if (!owasp) throw new Error(`pack row ${id} has no OWASP risk: add the shield to owasp.ts`);
|
|
3362
3528
|
rows.push({
|
|
3363
3529
|
id,
|
|
3364
3530
|
group: "commands",
|
|
3531
|
+
owasp,
|
|
3365
3532
|
title: rule.name.replace(SHIELD_RULE_NAME, "$3").replace(/-/g, " "),
|
|
3366
3533
|
catches: rule.description ?? rule.reason ?? "",
|
|
3367
3534
|
values: ALL,
|
|
@@ -19560,7 +19727,7 @@ function matchCanaryArgs(args, values) {
|
|
|
19560
19727
|
// src/scan/canonical.ts
|
|
19561
19728
|
var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
|
|
19562
19729
|
var CANONICAL_EXTRACTOR_VERSION = "canonical-v36";
|
|
19563
|
-
var CANONICAL_EXTRACTOR_HASH = "
|
|
19730
|
+
var CANONICAL_EXTRACTOR_HASH = "814655319cb53ff9";
|
|
19564
19731
|
var DEDUPE_PREVIEW_LEN = 120;
|
|
19565
19732
|
function extractCanonicalFindings(call, ctx) {
|
|
19566
19733
|
const out = [];
|
|
@@ -20022,6 +20189,8 @@ var ENGINE_VERSION = "1.4.0";
|
|
|
20022
20189
|
APP_SHIELD_NAMES,
|
|
20023
20190
|
APP_SHIELD_SPECS,
|
|
20024
20191
|
ARGUMENT_SCAN_LIMITS,
|
|
20192
|
+
ASI,
|
|
20193
|
+
ASI_IDS,
|
|
20025
20194
|
AST_FS_REGEX_RULES,
|
|
20026
20195
|
BASH_TOOL_NAMES,
|
|
20027
20196
|
BUILTIN_DANGEROUS_WORDS,
|
|
@@ -20059,9 +20228,11 @@ var ENGINE_VERSION = "1.4.0";
|
|
|
20059
20228
|
MODE_VALUES,
|
|
20060
20229
|
NET_BINARIES,
|
|
20061
20230
|
PATTERN_VERB_NAMES,
|
|
20231
|
+
POSTURE_CATEGORY_OWASP,
|
|
20062
20232
|
PRIVILEGE_ESCALATION_RE,
|
|
20063
20233
|
REALTIME_PII_PATTERNS,
|
|
20064
20234
|
REPLACED_SHIELDS,
|
|
20235
|
+
SCAN_REPO_RULES_WITHOUT_RISK,
|
|
20065
20236
|
SCAN_SIGNAL_WEIGHTS,
|
|
20066
20237
|
SENSITIVE_PATH_RE,
|
|
20067
20238
|
SENSITIVE_PATH_REGEXES,
|
|
@@ -20146,6 +20317,7 @@ var ENGINE_VERSION = "1.4.0";
|
|
|
20146
20317
|
inspectionEntry,
|
|
20147
20318
|
inspectionLayers,
|
|
20148
20319
|
isAgentInstructionPath,
|
|
20320
|
+
isAsiId,
|
|
20149
20321
|
isBashTool,
|
|
20150
20322
|
isBlockAll,
|
|
20151
20323
|
isDestructiveToolName,
|
|
@@ -20191,11 +20363,13 @@ var ENGINE_VERSION = "1.4.0";
|
|
|
20191
20363
|
normalizePyPiName,
|
|
20192
20364
|
normalizeRecipient,
|
|
20193
20365
|
normalizeTrustedEntry,
|
|
20366
|
+
packRowOwasp,
|
|
20194
20367
|
parseAllSshHostsFromCommand,
|
|
20195
20368
|
parseDestHost,
|
|
20196
20369
|
patternShapeOf,
|
|
20197
20370
|
pipelineTexts,
|
|
20198
20371
|
positionedArgs,
|
|
20372
|
+
postureCategoryOwasp,
|
|
20199
20373
|
previewArgs,
|
|
20200
20374
|
redactText,
|
|
20201
20375
|
registryHost,
|
|
@@ -20212,6 +20386,7 @@ var ENGINE_VERSION = "1.4.0";
|
|
|
20212
20386
|
scanArgumentSecrets,
|
|
20213
20387
|
scanInjection,
|
|
20214
20388
|
scanInstructionWrite,
|
|
20389
|
+
scanRepoRuleOwasp,
|
|
20215
20390
|
scanText,
|
|
20216
20391
|
scanViews,
|
|
20217
20392
|
sensitivePathMatch,
|