security-patterns
Skill30 starsChanged 59 days agoMITView on GitHub
Security patterns for Falcon Foundry apps including OAuth scopes, RBAC, input validation, UI security, and credential management. TRIGGER when user asks to "configure OAuth scopes", "secure a Foundry app", "handle secrets", "add input validation", or needs to review a Foundry app for security concerns (XSS, CSP, credential management). Also trigger during pre-deployment security reviews.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- ku5ic/claude-kittheir own version, first seen Oct 6, 2026
- bdouble/pm-vibecode-opstheir own version, first seen Jun 24, 2026
- Eyadkelleh/awesome-skills-securitytheir own version, first seen Jun 8, 2026
- ShulkwiSEC/bb-hugetheir own version, first seen Jun 4, 2026
- terrene-foundation/pacttheir own version, first seen Apr 6, 2026
- bejranonda/LLM-Autonomous-Agent-Plugin-for-Claudetheir own version, first seen Apr 1, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- Eyadkelleh/awesome-skills-security★ 387same name
- bdouble/pm-vibecode-ops★ 42same name
- bejranonda/LLM-Autonomous-Agent-Plugin-for-Claude★ 28same name
- ShulkwiSEC/bb-huge★ 22same name
- ku5ic/claude-kit★ 2same name
- terrene-foundation/pact★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ai-agents-developmentSkill
- api-integrationsSkill
- collections-developmentSkill
- debugging-workflowsSkill
- development-workflowSkill
- e2e-testingSkill
- functions-developmentSkill
- functions-falcon-apiSkill
- fusion-redirectSkill
- ui-developmentSkill
- workflows-developmentSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 1 is distinctive, and 6 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 46
Only use foundry auth scopes add for Falcon Platform API scopes needed by functions, UI extensions, UI pages, or RTR scripts.
- Distinctive: line 77
Use strict schemas to prevent data corruption and injection:
- Very specific: line 110
React: Use DOMPurify.sanitize() before any dangerouslySetInnerHTML.
- Very specific: line 111
Vue: Use DOMPurify.sanitize() in a computed property before v-html.
- Very specific: line 177
Use only RFC 1918 IPs (192.168.x.x, 10.x.x.x) in mock data
- Very specific: line 178
Use obviously fake hostnames and users (test-workstation-01, test_user)
- Very specific: line 180
Test XSS prevention with known attack vectors (<script>, javascript:, onerror=)
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Foundry Security Patterns
Part of a suite. If
development-workflowhas not already run, and this is a new app or its first capability, load thedevelopment-workflowskill first — it owns the CLI prerequisite check, scaffolding order, and manifest coordination.
Security patterns for Falcon Foundry app development covering authentication, input validation, UI security, and platform-specific considerations. Foundry apps run on a cybersecurity platform — security is a core requirement.
RBAC (Role-Based Access Control)
| Capability | RBAC Supported |
| Collections | Yes |
| Dashboards | Yes |
| Functions | Yes |
| UI extensions / pages / navigation | Yes |
| RTR scripts | Yes |
| API integrations | No |
| Queries | No |
| Workflows | No |
API Scope Management
Scopes control which Falcon Platform APIs the app can access. Format: <source>:<operation> (e.g., devices:read, detects:write).
| Scopes set automatically | Scopes need explicit addition |
| API integrations, Collections, Dashboards, Queries, UI navigation, UI sockets, Workflows | Functions, UI extensions, UI pages, RTR scripts |
foundry auth roles create --name "Analyst" --description "Read-only analyst access"
foundry auth scopes add --scope "devices:read" --scope "detects:read"Only use foundry auth scopes add for Falcon Platform API scopes needed by functions, UI extensions, UI pages, or RTR scripts. OAuth scopes for CLI-created artifacts are managed automatically.
Minimal Scope Principle
Request only the scopes your app needs. Broad scopes like alerts:* or devices:* increase the blast radius if the app is compromised.
# manifest.yml
auth:
scopes:
- "alerts:read" # Read alerts — avoid "alerts:write" unless needed
- "detects:read" # Read detections
- "devices:read" # Device information (Hosts API)Credential Security
Credentials MUST be in environment variables, not in code. FalconPy handles credential discovery automatically inside FDK handlers (see functions-falcon-api):
# Inside FDK handler — auth is automatic
falcon = Alerts() # Do not pass credentials
# Outside handler (local testing) — use env vars
# FALCON_CLIENT_ID and FALCON_CLIENT_SECRET read automaticallyInput Validation
JSON Schema for Collections
Use strict schemas to prevent data corruption and injection:
{
"type": "object",
"required": ["timestamp", "event_type", "source"],
"additionalProperties": false,
"properties": {
"event_type": {
"type": "string",
"enum": ["alert", "detection", "incident"]
},
"source": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$",
"maxLength": 50
}
}
}API Response Sanitization
Sanitize CrowdStrike API responses before storing in Collections: remove sensitive fields (raw_log, internal_id, system_metadata), strip script injection, escape HTML entities, and truncate strings. See references/security-examples.md for full implementation.
Function Input Validation
Validate that input is a dict and enforce size limits (e.g., 10KB) to prevent abuse. Return generic error messages — MUST NOT expose stack traces or internal state in responses.
UI Security
XSS Prevention
- React: Use
DOMPurify.sanitize()before anydangerouslySetInnerHTML. React auto-escapes{}expressions. - Vue: Use
DOMPurify.sanitize()in a computed property beforev-html. Vue auto-escapes{{ }}expressions.
For complete React and Vue XSS prevention components, see references/security-examples.md.
Content Security Policy
Configure CSP in manifest.yml for UI pages:
ui:
pages:
- name: my-page
csp:
connect_src:
- "'self'"
- "https://api.crowdstrike.com"
img_src:
- "'self'"
- "data:"
script_src:
- "'self'"Iframe Security for Extensions
Extensions run in sandboxed iframes. Validate message origins against Falcon console domains:
const allowedOrigins = [
'https://falcon.crowdstrike.com',
'https://falcon.eu-1.crowdstrike.com',
'https://falcon.us-gov-1.crowdstrike.com',
];
window.addEventListener('message', (event) => {
if (!allowedOrigins.includes(event.origin)) return;
// Process event.data
});For the full SecureConsoleMessaging class, see references/security-examples.md.
Manifest Security Configuration
app:
name: "my-security-app"
auth:
scopes:
- "alerts:read"
- "devices:read"
functions:
- name: "process-alerts"
language: "python"
max_exec_duration_seconds: 30 # Prevent runaway execution
max_exec_memory_mb: 128 # Limit resource usage
collections:
- name: "audit_logs"
ttl: 86400 # Auto-expire sensitive data (24 hours)Test Data Security
- Use only RFC 1918 IPs (
192.168.x.x,10.x.x.x) in mock data - Use obviously fake hostnames and users (
test-workstation-01,test_user) - Validate mock data does not contain production indicators (
crowdstrike.com,falcon-,prod-) - Test XSS prevention with known attack vectors (
<script>,javascript:,onerror=)
See references/security-examples.md for mock data validation and CI/CD security patterns.
Pre-Deployment Checklist
- OAuth scopes: minimal required permissions only
- Input validation: JSON schemas enforce strict validation
- XSS prevention: all user data sanitized before rendering
- CSP headers: Content Security Policy configured
- Postmessage security: origin validation implemented
- Secret management: no hardcoded credentials
- Function security: input size limits and timeout controls
- Collection security: access controls and data sanitization
- Test data: only fake data in tests and development
- Error handling: no sensitive data in error messages or logs
Reading Guide
| Task | Reference |
| Sanitization, command injection prevention, secure templates | references/security-examples.md |
| CI/CD security pipeline (GitHub Actions) | references/security-examples.md |
| PostMessage class, mock data validation | references/security-examples.md |
| Token lifecycle, antipatterns, manifest security, performance | references/security-examples.md |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

