/crowdstrike-falcon-foundry:security-patternsfrom crowdstrike-falcon-foundry
Security patterns for Falcon Foundry apps: OAuth scopes, RBAC, input validation, UI security (XSS, CSP), and credential management. Activates during security reviews or when configuring auth.
Ships in crowdstrike-falcon-foundry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
| Capability | RBAC Supported |
|---|---|
| Collections | Yes |
| Dashboards | Yes |
| Functions | Yes |
| UI extensions / pages / navigation | Yes |
| RTR scripts | Yes |
| API integrations | No |
| Queries | No |
| Workflows | No |
RBAC is three linked pieces the table above doesn't spell out — you need all three or the gate is silently absent.
1. Permission (one command, also creates the role):
foundry auth permissions create \
--key "myapp:access" \
--name "My App Access" \
--description "Access to My App" \
--role-name "My App Operator" \
--role-description "My App operator role" \
--no-prompt
--key must be colon-segmented (myapp:access, not a plain word; otherwise invalid permission key, should be permission segments separated by :), and --description must be 50 characters or fewer (input must be at most 50 characters long). --name needs at least 3 characters and --role-description at least 5. The command writes auth.permissions["myapp:access"]: {id, name, description} into manifest.yml and adds the role to auth.roles, with the permission key in its permissions list.
Prefix the key and role name with your app name. A generic name (
app:access,Operator) is hard to tell apart from other apps' roles in the console's role list.
2. Role — appears automatically under auth.roles after step 1; inspect it there, and do NOT run foundry auth roles create for it (that would orphan a duplicate role). Reserve standalone foundry auth roles create for a role built independently of permissions create — e.g. one that bundles permission keys that already exist (via --permissions); it creates a role but no permission:
foundry auth roles create --name "Analyst" --permissions "myapp:access" --description "Read-only analyst access" --no-prompt
That makes a second role carrying already-created permission keys; it does NOT create a new permission. Use it only when you deliberately want a role separate from the one permissions create already made — never to "add" the role from step 1.
3. Artifact gates — pass --permissions "myapp:access" to collections create, functions create, ui pages create, ui extensions create, or ui navigation add (CLI 2.1.2), or add the permission key to the permissions: list the CLI already wrote on an existing artifact (docs). Edit only that list; leave the generated path, entrypoint, and ref values alone. The page gate is what blocks access; a gate on the navigation link only hides the menu entry (Foundry checks roles on pages, not links), so set both:
ui:
pages:
dashboard: # pages is a map keyed by page ID
name: dashboard
path: ui/pages/dashboard/src/dist
entrypoint: ui/pages/dashboard/src/dist/index.html
permissions: [ "myapp:access" ]
navigation:
links:
- path: /
name: Dashboard
permissions: [ "myapp:access" ]
ref: pages.dashboard
collections:
- name: app_config
schema: collections/app_config.json
permissions: [ "myapp:access" ]
foundry apps validate --no-prompt is a free syntax check before deploying. A full end-to-end manifest example is in references/security-examples.md.
foundry auth roles create --help says: "Your new role will be automatically assigned to all Falcon Administrators and can later be assigned to other users individually." The same applies to the role permissions create makes. Implications:
Turning on RBAC is the one change that can lock you out of your own app mid-release. Safe sequence:
foundry auth permissions create — permission + role into the manifest.foundry apps deploy --change-type Minor --change-log "Add RBAC" --no-prompt — the gate is in the deployment but not live until you release.Rollback needs no app access — App Manager upgrade/uninstall are console-admin capabilities the app's own RBAC cannot block. Do NOT git checkout manifest.yml to roll back: that also discards the app_id and per-artifact IDs the deploy wrote back, so the next deploy fails with "an app with the provided name already exists." Revert only the RBAC additions, leaving every deploy-written ID in place — remove the role from its assigned users, delete the auth.permissions and auth.roles entries you added, and set each gated artifact back to permissions: [] (or commit the deploy-written IDs first, then revert just those sections). Then:
foundry apps deploy --change-type Patch --change-log "Roll back RBAC" --no-prompt
foundry apps release --change-type Patch --deployment-id <deployment-id> --notes "Roll back RBAC" --no-prompt
When you gate a collection that a workflow also writes to via a system_action: true store action, the human-role gate does not block those writes — system actions run under the app identity, not the human user's. Confirm it after enabling the gate: trigger a run and verify results still store. If writes stop, roll back as above.
An API integration has no role check, so gate the page that calls it. Anyone who can open a page that calls an integration can send the same request from the browser and skip a function's checks. When a function writes through an integration, restrict the page to a role as well. Foundry checks roles on pages, not on navigation links. When an integration authenticates with a customer's API client, ask for a dedicated client with exactly the scopes the integration needs: every scope a reused shared client holds becomes reachable by the app and its later versions.
Scopes control which Falcon Platform APIs the app can access. Format: <source>:<operation> (e.g., devices:read, detects:write).
Foundry adds each artifact's own scopes for you (custom-storage:* for collections, workflow:* for workflows, foundry-pages:* for UI pages, and so on), so leave those out of auth.scopes. A function also gets the scopes of the FalconPy service classes it imports. Every other Falcon API that a function, UI page, UI extension, or RTR script calls needs its scope in auth.scopes:
foundry auth scopes add --scopes "devices:read,detects:read" --no-prompt
foundry apps validate and deploy reject any auth.scopes entry that isn't on the platform allowlist: Invalid Auth - scopes are not allowed in foundry app: <scope>. Check a scope against references/scope-allowlist.md before adding it. A scope that the API swagger names isn't always on the allowlist. When one isn't, don't add it; tell the user to request it from CrowdStrike.scopes add rejects some allowlisted scopes. It checks a built-in list instead of the server's allowlist, and rejects 43 allowlisted scopes, including humio-auth-proxy:read (which Falcon Next-Gen SIEM searches need), cases:read, and ngsiem-persisted-aggregations:read. With 2.1.2, add those to auth.scopes in manifest.yml by hand. Later CLI versions check the server's allowlist and mark scopes the CID isn't subscribed to (Not available).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)
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 automatically
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
}
}
}
Before storing CrowdStrike API responses in Collections, drop fields the app doesn't need (raw_log, internal_id, system_metadata) and bound string lengths. Store the values raw: HTML-escaping before storage double-escapes on render, and a regex can't strip every script vector. Escape or sanitize at render time instead (see XSS Prevention below). See references/security-examples.md for the implementation.
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.
DOMPurify.sanitize() before any dangerouslySetInnerHTML. React auto-escapes {} expressions.DOMPurify.sanitize() in a computed property before v-html. Vue auto-escapes {{ }} expressions.For complete React and Vue XSS prevention components, see references/security-examples.md.
Configure CSP in manifest.yml for UI pages:
ui:
pages:
my_page: # map keyed by page ID
name: my-page
path: ui/pages/my-page/src/dist
entrypoint: ui/pages/my-page/src/dist/index.html
content_security_policy:
connect-src:
- https://api.example.com
img-src: []
script-src: []
permissions: []
Extensions and pages run in a sandboxed iframe, and foundry-js owns the channel to the Falcon console: connect() pins outbound messages to the console's origin. Don't add your own postMessage calls or message listeners. Read console context with falcon.events.on('data', ...) and talk to other extensions with falcon.sendBroadcast() (see ui-development's references/foundry-js.md).
auth:
scopes: # only what the functions call
- alerts:read
- devices:read
functions:
- name: process-alerts
language: python
max_exec_duration_seconds: 30 # bound runaway executions
collections:
- name: audit_logs
schema: collections/audit_logs.json
permissions: [ "myapp:access" ] # without this, any CID user can read and write it
192.168.x.x, 10.x.x.x) in mock datatest-workstation-01, test_user)crowdstrike.com, falcon-, prod-)<script>, javascript:, onerror=)See references/security-examples.md for mock data validation and CI/CD security patterns.
content_security_policy set on each page and extension in manifest.ymlfalcon.events / falcon.sendBroadcast, with no custom message listenersauth: {scopes: [], permissions: {}, roles: []} and every collection permissions: [] — any Falcon console user in the CID can read and write every collection, including any credentials or per-tenant data stored there. Gate every collection and page (see RBAC above) before the first release if the app handles secrets or multi-tenant data.| Task | Reference |
|---|---|
Which auth.scopes entries validate accepts, and which Foundry adds itself | references/scope-allowlist.md |
| Sanitization, command injection prevention, secure templates | references/security-examples.md |
| CI/CD security pipeline (GitHub Actions) | references/security-examples.md |
| Mock data validation | references/security-examples.md |
| Falcon API clients in functions, CSP, antipatterns, manifest security | references/security-examples.md |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub crowdstrike/foundry-skills --plugin crowdstrike-falcon-foundry14 skills in this plugin
/ai-agents-developmentBuild AI agents and knowledge bases for Falcon Foundry apps. TRIGGER when user asks to "create an AI agent", "add a Foundry agent", "build a knowledge base", "give my agent documents", "expose a collection as an agent tool", "expose an API operation to an agent", "put my agent in Charlotte", "expose an agent as a tool for other agents", "delete an agent or knowledge base", runs `foundry agents create`, `foundry agents delete`, `foundry knowledge-bases create`, or `foundry knowledge-bases delete`, or needs help with the `ai.agents` / `ai.knowledge_bases` manifest blocks, agent system prompts, agent input/output formats, agent exposure, or agent tool references. DO NOT TRIGGER for Fusion SOAR workflow YAML — use workflows-development. DO NOT TRIGGER for serverless function handlers — use functions-development. DO NOT TRIGGER for designing a collection schema itself — use collections-development, then return here to wire the collection up as an agent tool./api-integrationsExpose external APIs to Falcon Foundry via OpenAPI specs. TRIGGER when user asks to "create an API integration", "adapt an OpenAPI spec for Foundry", "expose an API to workflows", "connect to a third-party API", or runs `foundry api-integrations create`. Also trigger when user has an OpenAPI/Swagger spec and wants it working in Falcon Foundry. DO NOT TRIGGER when user wants to call Falcon platform APIs from function code — use functions-falcon-api instead.Other plugins' skills for the same job