Skip to content

Commit ad3af2f

Browse files
authored
Create README.md
1 parent c56ba8c commit ad3af2f

File tree

1 file changed

+29
-0
lines changed
  • Server-Side Components/Business Rules/Quarantine risky attachments by type or size

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Quarantine risky attachments by type or size
2+
3+
## What this solves
4+
Users sometimes upload executables or very large files via email or forms. This rule quarantines risky attachments by copying them off the original record, deleting the original, and keeping an audit trail.
5+
6+
## Where to use
7+
- Table: `sys_attachment`
8+
- When: before insert
9+
- Order: early (for example 50)
10+
11+
## How it works
12+
- Checks file extension and size against configurable thresholds
13+
- Creates or reuses a quarantine record (table `x_quarantine_attachment` or default `incident` as a safe example)
14+
- Copies the new attachment to the quarantine record via `GlideSysAttachment.copy`
15+
- Deletes the original attachment via `GlideSysAttachment.deleteAttachment`
16+
- Logs what happened with minimal, readable messages
17+
18+
## Configure
19+
In the Business Rule:
20+
- `BLOCKED_EXTS`: extensions to quarantine
21+
- `MAX_SIZE_MB`: size threshold
22+
- `QUARANTINE_TABLE`: table to hold quarantined items
23+
- `ASSIGNMENT_GROUP_SYSID`: optional group to triage quarantines
24+
25+
## References
26+
- GlideSysAttachment API
27+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideSysAttachment/concept/c_GlideSysAttachmentAPI.html
28+
- Business Rules
29+
https://www.servicenow.com/docs/bundle/zurich-application-development/page/build/applications/concept/c_BusinessRules.html

0 commit comments

Comments
 (0)