@highflame/policy 2.1.33 → 2.1.34
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/_schemas/sentry/templates/defaults/file_safety.cedar +10 -68
- package/_schemas/sentry/templates/defaults/organization.cedar +1 -25
- package/_schemas/sentry/templates/defaults/semantic.cedar +0 -49
- package/_schemas/sentry/templates/templates.json +6 -6
- package/dist/sentry-defaults.gen.js +23 -154
- package/package.json +1 -1
|
@@ -1,87 +1,29 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// File & Attachment Safety Policy (Default)
|
|
3
3
|
// =============================================================================
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// confidential and restricted documents from being shared with AI.
|
|
4
|
+
// Blocks file uploads to AI chat services when document content contains
|
|
5
|
+
// secrets or PII.
|
|
7
6
|
//
|
|
8
7
|
// Detection layers:
|
|
9
|
-
// 1.
|
|
10
|
-
// 2. PII
|
|
11
|
-
// 3. Injection payloads in files — from Shield InjectionDetector
|
|
8
|
+
// 1. Secrets in file content — from Shield SecretsDetector
|
|
9
|
+
// 2. PII in file content — from Shield PIIRegexDetector
|
|
12
10
|
//
|
|
13
11
|
// Compliance:
|
|
14
|
-
// Microsoft Information Protection (MIP) — label-based access control
|
|
15
12
|
// NIST 800-53 SC-28 (Protection of Information at Rest)
|
|
16
13
|
// GDPR Art. 32 (Security of Processing)
|
|
17
|
-
// ISO 27001 A.8.2 (Information Classification)
|
|
18
14
|
//
|
|
19
15
|
// Category: file_safety
|
|
20
16
|
// Namespace: Sentry
|
|
21
17
|
// =============================================================================
|
|
22
18
|
|
|
23
19
|
// ---------------------------------------------------------------------------
|
|
24
|
-
// Section 1:
|
|
25
|
-
// Block
|
|
26
|
-
// Labels are read from document metadata via MIP SDK / Graph API.
|
|
20
|
+
// Section 1: File Content Security
|
|
21
|
+
// Block text files containing secrets or PII.
|
|
27
22
|
// ---------------------------------------------------------------------------
|
|
28
23
|
|
|
29
|
-
// Block
|
|
30
|
-
@id("sentry-file-block-restricted")
|
|
31
|
-
@name("Block restricted documents")
|
|
32
|
-
@description("Block uploads of documents with 'restricted' sensitivity level. Restricted documents contain the most sensitive data (board materials, M&A, legal privilege) and must never be shared with AI services.")
|
|
33
|
-
@severity("critical")
|
|
34
|
-
@tags("mip,restricted,classification,compliance,iso-27001")
|
|
35
|
-
@reject_message("Upload blocked: this document is classified as RESTRICTED. Restricted documents must never be shared with AI services. Contact your security team if you need to process this content.")
|
|
36
|
-
forbid (
|
|
37
|
-
principal,
|
|
38
|
-
action == Sentry::Action::"upload_file",
|
|
39
|
-
resource
|
|
40
|
-
)
|
|
41
|
-
when {
|
|
42
|
-
context has sensitivity_level && context.sensitivity_level == "restricted"
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Block confidential documents
|
|
46
|
-
@id("sentry-file-block-confidential")
|
|
47
|
-
@name("Block confidential documents")
|
|
48
|
-
@description("Block uploads of documents with 'confidential' sensitivity level. Confidential documents (financial reports, customer data, internal strategy) should not be shared with external AI services.")
|
|
49
|
-
@severity("critical")
|
|
50
|
-
@tags("mip,confidential,classification,compliance,iso-27001")
|
|
51
|
-
@reject_message("Upload blocked: this document is classified as CONFIDENTIAL. Confidential documents should not be shared with AI services without explicit authorization.")
|
|
52
|
-
forbid (
|
|
53
|
-
principal,
|
|
54
|
-
action == Sentry::Action::"upload_file",
|
|
55
|
-
resource
|
|
56
|
-
)
|
|
57
|
-
when {
|
|
58
|
-
context has sensitivity_level && context.sensitivity_level == "confidential"
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Block rights-managed documents
|
|
62
|
-
@id("sentry-file-block-rights-managed")
|
|
63
|
-
@name("Block rights-managed documents")
|
|
64
|
-
@description("Block uploads of documents with IRM/RMS rights management restrictions. Rights-managed documents have explicit access controls that would be bypassed by sharing with AI services.")
|
|
65
|
-
@severity("critical")
|
|
66
|
-
@tags("mip,irm,rms,rights-management,compliance")
|
|
67
|
-
@reject_message("Upload blocked: this document has rights management restrictions that prohibit sharing with AI services.")
|
|
68
|
-
forbid (
|
|
69
|
-
principal,
|
|
70
|
-
action == Sentry::Action::"upload_file",
|
|
71
|
-
resource
|
|
72
|
-
)
|
|
73
|
-
when {
|
|
74
|
-
context has is_rights_managed && context.is_rights_managed
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// ---------------------------------------------------------------------------
|
|
78
|
-
// Section 2: File Content Security
|
|
79
|
-
// Block files containing secrets, PII, or injection payloads.
|
|
80
|
-
// ---------------------------------------------------------------------------
|
|
81
|
-
|
|
82
|
-
// Block files containing secrets
|
|
24
|
+
// Block text files with secrets
|
|
83
25
|
@id("sentry-file-block-secrets")
|
|
84
|
-
@name("Block files with secrets")
|
|
26
|
+
@name("Block text files with secrets")
|
|
85
27
|
@description("Block file uploads when secrets or credentials are detected in document content. Prevents uploading configuration files, code, or documents containing API keys, tokens, or passwords to AI services.")
|
|
86
28
|
@severity("critical")
|
|
87
29
|
@tags("secrets,file-upload,credentials,nist-sc-28")
|
|
@@ -95,9 +37,9 @@ when {
|
|
|
95
37
|
context has contains_secrets && context.contains_secrets
|
|
96
38
|
};
|
|
97
39
|
|
|
98
|
-
// Block
|
|
40
|
+
// Block text files with PII
|
|
99
41
|
@id("sentry-pii-block-uploads")
|
|
100
|
-
@name("Block
|
|
42
|
+
@name("Block text files with PII")
|
|
101
43
|
@description("Block file uploads when PII is detected in document content. Prevents sharing of documents containing personal data (customer lists, HR records, medical files) with AI services.")
|
|
102
44
|
@severity("critical")
|
|
103
45
|
@tags("pii,file-upload,data-protection,gdpr-art-32")
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
// in clipboard.cedar.
|
|
7
7
|
//
|
|
8
8
|
// This template covers:
|
|
9
|
-
// - Source code protection in messages (non-paste channels)
|
|
10
9
|
// - Session-aware threat escalation
|
|
11
10
|
//
|
|
12
11
|
// Category: organization
|
|
@@ -14,30 +13,7 @@
|
|
|
14
13
|
// =============================================================================
|
|
15
14
|
|
|
16
15
|
// ---------------------------------------------------------------------------
|
|
17
|
-
// Section 1:
|
|
18
|
-
// Prevent bulk source code from being shared via messages.
|
|
19
|
-
// Paste-targeted code protection is in clipboard.cedar.
|
|
20
|
-
// ---------------------------------------------------------------------------
|
|
21
|
-
|
|
22
|
-
// Block messages with high code content
|
|
23
|
-
@id("sentry-org-block-code-messages")
|
|
24
|
-
@name("Block messages with source code")
|
|
25
|
-
@description("Block messages when source code constitutes more than 80% of the content. Prevents bulk source code exfiltration to external AI services.")
|
|
26
|
-
@severity("high")
|
|
27
|
-
@tags("source-code,ip-protection,data-leakage")
|
|
28
|
-
@reject_message("Message blocked: the content appears to be primarily source code (>80%). Bulk source code should not be shared with external AI services to protect intellectual property.")
|
|
29
|
-
forbid (
|
|
30
|
-
principal,
|
|
31
|
-
action == Sentry::Action::"process_prompt",
|
|
32
|
-
resource
|
|
33
|
-
)
|
|
34
|
-
when {
|
|
35
|
-
context has contains_code && context.contains_code &&
|
|
36
|
-
context has code_ratio && context.code_ratio > 80
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
// Section 2: Session-Aware Escalation
|
|
16
|
+
// Section 1: Session-Aware Escalation
|
|
41
17
|
// Escalate protections when threats are detected across the session.
|
|
42
18
|
// ---------------------------------------------------------------------------
|
|
43
19
|
|
|
@@ -59,22 +59,6 @@ when {
|
|
|
59
59
|
context has injection_score && context.injection_score >= 75
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
// Block injection payloads hidden in uploaded documents
|
|
63
|
-
@id("sentry-semantic-block-file-injection")
|
|
64
|
-
@name("Block injection in uploaded files")
|
|
65
|
-
@description("Block file uploads when prompt injection patterns are detected in the document content. Attackers embed injection payloads in PDFs, documents, and spreadsheets to hijack AI behavior via RAG or file analysis.")
|
|
66
|
-
@severity("critical")
|
|
67
|
-
@tags("injection,file-upload,security,owasp-llm01")
|
|
68
|
-
@reject_message("Upload blocked: prompt injection patterns were detected in the uploaded document. Files containing adversarial instructions cannot be shared with AI services.")
|
|
69
|
-
forbid (
|
|
70
|
-
principal,
|
|
71
|
-
action == Sentry::Action::"upload_file",
|
|
72
|
-
resource
|
|
73
|
-
)
|
|
74
|
-
when {
|
|
75
|
-
context has detected_threats && context.detected_threats.contains("prompt_injection")
|
|
76
|
-
};
|
|
77
|
-
|
|
78
62
|
// ---------------------------------------------------------------------------
|
|
79
63
|
// Section 2: Jailbreak Detection
|
|
80
64
|
// Blocks jailbreak attempts in messages sent to AI services.
|
|
@@ -133,36 +117,3 @@ when {
|
|
|
133
117
|
context has highest_severity && context.highest_severity == "critical"
|
|
134
118
|
};
|
|
135
119
|
|
|
136
|
-
// Block messages with high severity semantic threats
|
|
137
|
-
@id("sentry-semantic-block-high-severity")
|
|
138
|
-
@name("Block high severity threats")
|
|
139
|
-
@description("Block messages when threat detection reports high severity (>= 3) in semantic categories. Catches threats that individually are below critical but collectively indicate adversarial intent.")
|
|
140
|
-
@severity("high")
|
|
141
|
-
@tags("semantic,severity,security,defense-in-depth")
|
|
142
|
-
@reject_message("Content blocked: security scanners detected high severity issues. Review your content for manipulative or adversarial patterns.")
|
|
143
|
-
forbid (
|
|
144
|
-
principal,
|
|
145
|
-
action == Sentry::Action::"process_prompt",
|
|
146
|
-
resource
|
|
147
|
-
)
|
|
148
|
-
when {
|
|
149
|
-
context has threat_categories && context has max_threat_severity &&
|
|
150
|
-
context.threat_categories.contains("injection") &&
|
|
151
|
-
context.max_threat_severity >= 3
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// Block content with multiple concurrent threats
|
|
155
|
-
@id("sentry-semantic-block-multi-threat")
|
|
156
|
-
@name("Block multi-threat content")
|
|
157
|
-
@description("Block content when multiple distinct threats are detected simultaneously (3+). Multiple concurrent threats strongly indicate an adversarial attack chain or compromised content.")
|
|
158
|
-
@severity("high")
|
|
159
|
-
@tags("multi-threat,security,defense-in-depth")
|
|
160
|
-
@reject_message("Content blocked: multiple security threats were detected simultaneously. This pattern indicates potentially adversarial content.")
|
|
161
|
-
forbid (
|
|
162
|
-
principal,
|
|
163
|
-
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
164
|
-
resource
|
|
165
|
-
)
|
|
166
|
-
when {
|
|
167
|
-
context has threat_count && context.threat_count >= 3
|
|
168
|
-
};
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
{
|
|
27
27
|
"id": "file_safety",
|
|
28
28
|
"name": "File & Attachment Safety",
|
|
29
|
-
"description": "
|
|
29
|
+
"description": "Block file uploads containing secrets or PII in document content"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"id": "clipboard",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"id": "organization",
|
|
38
38
|
"name": "Organization Rules",
|
|
39
|
-
"description": "Cross-cutting organization-wide rules:
|
|
39
|
+
"description": "Cross-cutting organization-wide rules: session-aware threat escalation"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
"defaults": [
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
{
|
|
92
92
|
"id": "sentry-file-safety-default",
|
|
93
93
|
"name": "File & Attachment Safety",
|
|
94
|
-
"description": "
|
|
94
|
+
"description": "Block file uploads containing secrets or PII in document content",
|
|
95
95
|
"category": "file_safety",
|
|
96
96
|
"file": "defaults/file_safety.cedar",
|
|
97
97
|
"severity": "critical",
|
|
98
|
-
"tags": ["
|
|
98
|
+
"tags": ["file-upload", "secrets", "pii", "dlp"]
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"id": "sentry-clipboard-default",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
{
|
|
110
110
|
"id": "sentry-organization-default",
|
|
111
111
|
"name": "Organization Rules",
|
|
112
|
-
"description": "Cross-cutting organization-wide policies:
|
|
112
|
+
"description": "Cross-cutting organization-wide policies: session-aware threat escalation",
|
|
113
113
|
"category": "organization",
|
|
114
114
|
"file": "defaults/organization.cedar",
|
|
115
115
|
"severity": "high",
|
|
116
|
-
"tags": ["
|
|
116
|
+
"tags": ["session", "escalation", "organization"]
|
|
117
117
|
}
|
|
118
118
|
]
|
|
119
119
|
}
|
|
@@ -93,22 +93,6 @@ when {
|
|
|
93
93
|
context has injection_score && context.injection_score >= 75
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
// Block injection payloads hidden in uploaded documents
|
|
97
|
-
@id("sentry-semantic-block-file-injection")
|
|
98
|
-
@name("Block injection in uploaded files")
|
|
99
|
-
@description("Block file uploads when prompt injection patterns are detected in the document content. Attackers embed injection payloads in PDFs, documents, and spreadsheets to hijack AI behavior via RAG or file analysis.")
|
|
100
|
-
@severity("critical")
|
|
101
|
-
@tags("injection,file-upload,security,owasp-llm01")
|
|
102
|
-
@reject_message("Upload blocked: prompt injection patterns were detected in the uploaded document. Files containing adversarial instructions cannot be shared with AI services.")
|
|
103
|
-
forbid (
|
|
104
|
-
principal,
|
|
105
|
-
action == Sentry::Action::"upload_file",
|
|
106
|
-
resource
|
|
107
|
-
)
|
|
108
|
-
when {
|
|
109
|
-
context has detected_threats && context.detected_threats.contains("prompt_injection")
|
|
110
|
-
};
|
|
111
|
-
|
|
112
96
|
// ---------------------------------------------------------------------------
|
|
113
97
|
// Section 2: Jailbreak Detection
|
|
114
98
|
// Blocks jailbreak attempts in messages sent to AI services.
|
|
@@ -167,39 +151,6 @@ when {
|
|
|
167
151
|
context has highest_severity && context.highest_severity == "critical"
|
|
168
152
|
};
|
|
169
153
|
|
|
170
|
-
// Block messages with high severity semantic threats
|
|
171
|
-
@id("sentry-semantic-block-high-severity")
|
|
172
|
-
@name("Block high severity threats")
|
|
173
|
-
@description("Block messages when threat detection reports high severity (>= 3) in semantic categories. Catches threats that individually are below critical but collectively indicate adversarial intent.")
|
|
174
|
-
@severity("high")
|
|
175
|
-
@tags("semantic,severity,security,defense-in-depth")
|
|
176
|
-
@reject_message("Content blocked: security scanners detected high severity issues. Review your content for manipulative or adversarial patterns.")
|
|
177
|
-
forbid (
|
|
178
|
-
principal,
|
|
179
|
-
action == Sentry::Action::"process_prompt",
|
|
180
|
-
resource
|
|
181
|
-
)
|
|
182
|
-
when {
|
|
183
|
-
context has threat_categories && context has max_threat_severity &&
|
|
184
|
-
context.threat_categories.contains("injection") &&
|
|
185
|
-
context.max_threat_severity >= 3
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// Block content with multiple concurrent threats
|
|
189
|
-
@id("sentry-semantic-block-multi-threat")
|
|
190
|
-
@name("Block multi-threat content")
|
|
191
|
-
@description("Block content when multiple distinct threats are detected simultaneously (3+). Multiple concurrent threats strongly indicate an adversarial attack chain or compromised content.")
|
|
192
|
-
@severity("high")
|
|
193
|
-
@tags("multi-threat,security,defense-in-depth")
|
|
194
|
-
@reject_message("Content blocked: multiple security threats were detected simultaneously. This pattern indicates potentially adversarial content.")
|
|
195
|
-
forbid (
|
|
196
|
-
principal,
|
|
197
|
-
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
198
|
-
resource
|
|
199
|
-
)
|
|
200
|
-
when {
|
|
201
|
-
context has threat_count && context.threat_count >= 3
|
|
202
|
-
};
|
|
203
154
|
`;
|
|
204
155
|
const SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR = `// =============================================================================
|
|
205
156
|
// Content Safety Policy (Default)
|
|
@@ -666,87 +617,29 @@ when {
|
|
|
666
617
|
const SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR = `// =============================================================================
|
|
667
618
|
// File & Attachment Safety Policy (Default)
|
|
668
619
|
// =============================================================================
|
|
669
|
-
//
|
|
670
|
-
//
|
|
671
|
-
// confidential and restricted documents from being shared with AI.
|
|
620
|
+
// Blocks file uploads to AI chat services when document content contains
|
|
621
|
+
// secrets or PII.
|
|
672
622
|
//
|
|
673
623
|
// Detection layers:
|
|
674
|
-
// 1.
|
|
675
|
-
// 2. PII
|
|
676
|
-
// 3. Injection payloads in files — from Shield InjectionDetector
|
|
624
|
+
// 1. Secrets in file content — from Shield SecretsDetector
|
|
625
|
+
// 2. PII in file content — from Shield PIIRegexDetector
|
|
677
626
|
//
|
|
678
627
|
// Compliance:
|
|
679
|
-
// Microsoft Information Protection (MIP) — label-based access control
|
|
680
628
|
// NIST 800-53 SC-28 (Protection of Information at Rest)
|
|
681
629
|
// GDPR Art. 32 (Security of Processing)
|
|
682
|
-
// ISO 27001 A.8.2 (Information Classification)
|
|
683
630
|
//
|
|
684
631
|
// Category: file_safety
|
|
685
632
|
// Namespace: Sentry
|
|
686
633
|
// =============================================================================
|
|
687
634
|
|
|
688
635
|
// ---------------------------------------------------------------------------
|
|
689
|
-
// Section 1:
|
|
690
|
-
// Block
|
|
691
|
-
// Labels are read from document metadata via MIP SDK / Graph API.
|
|
636
|
+
// Section 1: File Content Security
|
|
637
|
+
// Block text files containing secrets or PII.
|
|
692
638
|
// ---------------------------------------------------------------------------
|
|
693
639
|
|
|
694
|
-
// Block
|
|
695
|
-
@id("sentry-file-block-restricted")
|
|
696
|
-
@name("Block restricted documents")
|
|
697
|
-
@description("Block uploads of documents with 'restricted' sensitivity level. Restricted documents contain the most sensitive data (board materials, M&A, legal privilege) and must never be shared with AI services.")
|
|
698
|
-
@severity("critical")
|
|
699
|
-
@tags("mip,restricted,classification,compliance,iso-27001")
|
|
700
|
-
@reject_message("Upload blocked: this document is classified as RESTRICTED. Restricted documents must never be shared with AI services. Contact your security team if you need to process this content.")
|
|
701
|
-
forbid (
|
|
702
|
-
principal,
|
|
703
|
-
action == Sentry::Action::"upload_file",
|
|
704
|
-
resource
|
|
705
|
-
)
|
|
706
|
-
when {
|
|
707
|
-
context has sensitivity_level && context.sensitivity_level == "restricted"
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
// Block confidential documents
|
|
711
|
-
@id("sentry-file-block-confidential")
|
|
712
|
-
@name("Block confidential documents")
|
|
713
|
-
@description("Block uploads of documents with 'confidential' sensitivity level. Confidential documents (financial reports, customer data, internal strategy) should not be shared with external AI services.")
|
|
714
|
-
@severity("critical")
|
|
715
|
-
@tags("mip,confidential,classification,compliance,iso-27001")
|
|
716
|
-
@reject_message("Upload blocked: this document is classified as CONFIDENTIAL. Confidential documents should not be shared with AI services without explicit authorization.")
|
|
717
|
-
forbid (
|
|
718
|
-
principal,
|
|
719
|
-
action == Sentry::Action::"upload_file",
|
|
720
|
-
resource
|
|
721
|
-
)
|
|
722
|
-
when {
|
|
723
|
-
context has sensitivity_level && context.sensitivity_level == "confidential"
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
// Block rights-managed documents
|
|
727
|
-
@id("sentry-file-block-rights-managed")
|
|
728
|
-
@name("Block rights-managed documents")
|
|
729
|
-
@description("Block uploads of documents with IRM/RMS rights management restrictions. Rights-managed documents have explicit access controls that would be bypassed by sharing with AI services.")
|
|
730
|
-
@severity("critical")
|
|
731
|
-
@tags("mip,irm,rms,rights-management,compliance")
|
|
732
|
-
@reject_message("Upload blocked: this document has rights management restrictions that prohibit sharing with AI services.")
|
|
733
|
-
forbid (
|
|
734
|
-
principal,
|
|
735
|
-
action == Sentry::Action::"upload_file",
|
|
736
|
-
resource
|
|
737
|
-
)
|
|
738
|
-
when {
|
|
739
|
-
context has is_rights_managed && context.is_rights_managed
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
// ---------------------------------------------------------------------------
|
|
743
|
-
// Section 2: File Content Security
|
|
744
|
-
// Block files containing secrets, PII, or injection payloads.
|
|
745
|
-
// ---------------------------------------------------------------------------
|
|
746
|
-
|
|
747
|
-
// Block files containing secrets
|
|
640
|
+
// Block text files with secrets
|
|
748
641
|
@id("sentry-file-block-secrets")
|
|
749
|
-
@name("Block files with secrets")
|
|
642
|
+
@name("Block text files with secrets")
|
|
750
643
|
@description("Block file uploads when secrets or credentials are detected in document content. Prevents uploading configuration files, code, or documents containing API keys, tokens, or passwords to AI services.")
|
|
751
644
|
@severity("critical")
|
|
752
645
|
@tags("secrets,file-upload,credentials,nist-sc-28")
|
|
@@ -760,9 +653,9 @@ when {
|
|
|
760
653
|
context has contains_secrets && context.contains_secrets
|
|
761
654
|
};
|
|
762
655
|
|
|
763
|
-
// Block
|
|
656
|
+
// Block text files with PII
|
|
764
657
|
@id("sentry-pii-block-uploads")
|
|
765
|
-
@name("Block
|
|
658
|
+
@name("Block text files with PII")
|
|
766
659
|
@description("Block file uploads when PII is detected in document content. Prevents sharing of documents containing personal data (customer lists, HR records, medical files) with AI services.")
|
|
767
660
|
@severity("critical")
|
|
768
661
|
@tags("pii,file-upload,data-protection,gdpr-art-32")
|
|
@@ -883,7 +776,6 @@ const SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR = `// ===========================
|
|
|
883
776
|
// in clipboard.cedar.
|
|
884
777
|
//
|
|
885
778
|
// This template covers:
|
|
886
|
-
// - Source code protection in messages (non-paste channels)
|
|
887
779
|
// - Session-aware threat escalation
|
|
888
780
|
//
|
|
889
781
|
// Category: organization
|
|
@@ -891,30 +783,7 @@ const SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR = `// ===========================
|
|
|
891
783
|
// =============================================================================
|
|
892
784
|
|
|
893
785
|
// ---------------------------------------------------------------------------
|
|
894
|
-
// Section 1:
|
|
895
|
-
// Prevent bulk source code from being shared via messages.
|
|
896
|
-
// Paste-targeted code protection is in clipboard.cedar.
|
|
897
|
-
// ---------------------------------------------------------------------------
|
|
898
|
-
|
|
899
|
-
// Block messages with high code content
|
|
900
|
-
@id("sentry-org-block-code-messages")
|
|
901
|
-
@name("Block messages with source code")
|
|
902
|
-
@description("Block messages when source code constitutes more than 80% of the content. Prevents bulk source code exfiltration to external AI services.")
|
|
903
|
-
@severity("high")
|
|
904
|
-
@tags("source-code,ip-protection,data-leakage")
|
|
905
|
-
@reject_message("Message blocked: the content appears to be primarily source code (>80%). Bulk source code should not be shared with external AI services to protect intellectual property.")
|
|
906
|
-
forbid (
|
|
907
|
-
principal,
|
|
908
|
-
action == Sentry::Action::"process_prompt",
|
|
909
|
-
resource
|
|
910
|
-
)
|
|
911
|
-
when {
|
|
912
|
-
context has contains_code && context.contains_code &&
|
|
913
|
-
context has code_ratio && context.code_ratio > 80
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
// ---------------------------------------------------------------------------
|
|
917
|
-
// Section 2: Session-Aware Escalation
|
|
786
|
+
// Section 1: Session-Aware Escalation
|
|
918
787
|
// Escalate protections when threats are detected across the session.
|
|
919
788
|
// ---------------------------------------------------------------------------
|
|
920
789
|
|
|
@@ -942,9 +811,9 @@ export const SENTRY_CATEGORIES = [
|
|
|
942
811
|
{ id: 'pii', name: 'PII Detection', description: 'Detect and block personally identifiable information (PII) such as credit card numbers, SSNs, health data, and other sensitive personal data from being shared with AI chat services' },
|
|
943
812
|
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity threats in messages, pasted content, and uploaded files' },
|
|
944
813
|
{ id: 'content_safety', name: 'Content Safety', description: 'Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions across messages, paste, and file uploads' },
|
|
945
|
-
{ id: 'file_safety', name: 'File & Attachment Safety', description: '
|
|
814
|
+
{ id: 'file_safety', name: 'File & Attachment Safety', description: 'Block file uploads containing secrets or PII in document content' },
|
|
946
815
|
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services — block paste outright, block when secrets, PII, source code, large threat-laden pastes, encoded payloads, or invisible characters are detected' },
|
|
947
|
-
{ id: 'organization', name: 'Organization Rules', description: 'Cross-cutting organization-wide rules:
|
|
816
|
+
{ id: 'organization', name: 'Organization Rules', description: 'Cross-cutting organization-wide rules: session-aware threat escalation' },
|
|
948
817
|
];
|
|
949
818
|
// =============================================================================
|
|
950
819
|
// DEFAULT POLICIES
|
|
@@ -1004,11 +873,11 @@ export const SENTRY_TEMPLATES = [
|
|
|
1004
873
|
{
|
|
1005
874
|
id: 'sentry-file-safety-default',
|
|
1006
875
|
name: 'File & Attachment Safety',
|
|
1007
|
-
description: '
|
|
876
|
+
description: 'Block file uploads containing secrets or PII in document content',
|
|
1008
877
|
category: 'file_safety',
|
|
1009
878
|
cedarText: SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR,
|
|
1010
879
|
severity: 'critical',
|
|
1011
|
-
tags: ['
|
|
880
|
+
tags: ['file-upload', 'secrets', 'pii', 'dlp'],
|
|
1012
881
|
},
|
|
1013
882
|
{
|
|
1014
883
|
id: 'sentry-clipboard-default',
|
|
@@ -1022,11 +891,11 @@ export const SENTRY_TEMPLATES = [
|
|
|
1022
891
|
{
|
|
1023
892
|
id: 'sentry-organization-default',
|
|
1024
893
|
name: 'Organization Rules',
|
|
1025
|
-
description: 'Cross-cutting organization-wide policies:
|
|
894
|
+
description: 'Cross-cutting organization-wide policies: session-aware threat escalation',
|
|
1026
895
|
category: 'organization',
|
|
1027
896
|
cedarText: SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR,
|
|
1028
897
|
severity: 'high',
|
|
1029
|
-
tags: ['
|
|
898
|
+
tags: ['session', 'escalation', 'organization'],
|
|
1030
899
|
},
|
|
1031
900
|
];
|
|
1032
901
|
// =============================================================================
|
|
@@ -1061,7 +930,7 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1061
930
|
{
|
|
1062
931
|
"id": "file_safety",
|
|
1063
932
|
"name": "File & Attachment Safety",
|
|
1064
|
-
"description": "
|
|
933
|
+
"description": "Block file uploads containing secrets or PII in document content"
|
|
1065
934
|
},
|
|
1066
935
|
{
|
|
1067
936
|
"id": "clipboard",
|
|
@@ -1071,7 +940,7 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1071
940
|
{
|
|
1072
941
|
"id": "organization",
|
|
1073
942
|
"name": "Organization Rules",
|
|
1074
|
-
"description": "Cross-cutting organization-wide rules:
|
|
943
|
+
"description": "Cross-cutting organization-wide rules: session-aware threat escalation"
|
|
1075
944
|
}
|
|
1076
945
|
],
|
|
1077
946
|
"defaults": [
|
|
@@ -1126,11 +995,11 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1126
995
|
{
|
|
1127
996
|
"id": "sentry-file-safety-default",
|
|
1128
997
|
"name": "File & Attachment Safety",
|
|
1129
|
-
"description": "
|
|
998
|
+
"description": "Block file uploads containing secrets or PII in document content",
|
|
1130
999
|
"category": "file_safety",
|
|
1131
1000
|
"file": "defaults/file_safety.cedar",
|
|
1132
1001
|
"severity": "critical",
|
|
1133
|
-
"tags": ["
|
|
1002
|
+
"tags": ["file-upload", "secrets", "pii", "dlp"]
|
|
1134
1003
|
},
|
|
1135
1004
|
{
|
|
1136
1005
|
"id": "sentry-clipboard-default",
|
|
@@ -1144,11 +1013,11 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1144
1013
|
{
|
|
1145
1014
|
"id": "sentry-organization-default",
|
|
1146
1015
|
"name": "Organization Rules",
|
|
1147
|
-
"description": "Cross-cutting organization-wide policies:
|
|
1016
|
+
"description": "Cross-cutting organization-wide policies: session-aware threat escalation",
|
|
1148
1017
|
"category": "organization",
|
|
1149
1018
|
"file": "defaults/organization.cedar",
|
|
1150
1019
|
"severity": "high",
|
|
1151
|
-
"tags": ["
|
|
1020
|
+
"tags": ["session", "escalation", "organization"]
|
|
1152
1021
|
}
|
|
1153
1022
|
]
|
|
1154
1023
|
}
|