Security Policies
Overview
Security policies define the runtime behavior permitted for your CI/CD pipelines and deployments. The Runtime Sensor enforces these policies at the kernel level using eBPF technology, intercepting and validating security-relevant operations before they execute.
What Are Security Policies?
A security policy is a JSON document that specifies:
- Allowed operations: Which processes can execute, what files can be accessed, which network connections are permitted
- Enforcement mode: Whether to observe, enforce, or derive policy rules
- Security boundaries: Constraints on containers, kernel operations, memory access, and inter-process communication
Policies follow a deny-by-default model—operations not explicitly permitted are blocked when enforcement is enabled.
Key Concepts
Policy Domains
Security policies cover multiple security domains:
| Domain | Description | Examples |
|---|---|---|
| File System | File and directory operations | Process execution, file reads/writes, path creation/deletion |
| Networking | TCP/IP, Unix sockets, raw sockets | Outbound connections, listening ports, packet sniffing |
| Containers | Container runtime operations | Image execution, socket access |
| Memory | Memory-related operations | Memory mapping, W+X protection |
| Process | Process management | Process termination, resource limits, scheduling |
| Kernel | Kernel-level operations | eBPF programs, kernel modules, direct memory access |
| IPC | Inter-process communication | Unix sockets, System V shared memory, message queues |
Enforcement Modes
Policies operate in one of three modes:
| Mode | Behavior | Use Case |
|---|---|---|
derive | Monitor all behavior and generate policy rules | Initial setup—run your pipeline to capture baseline behavior |
observe | Log violations without blocking operations | Testing and refinement—validate policy before enforcement |
enforce | Block unauthorized operations and fail builds | Production—active protection against policy violations |
Rule Format
Most policy rules follow a pipe-delimited format that specifies actors and targets:
actor|target
actor|target|additional_contextFor example, an IP connection rule:
/usr/bin/curl|api.example.com|443This permits the curl binary to connect to api.example.com on port 443.
Wildcards and Patterns
Policies support several pattern matching features:
| Pattern | Description | Example |
|---|---|---|
all | Matches any value | "all" permits all values for that field |
{a,b,c} | Brace expansion | {80,443} matches port 80 or 443 |
%workspace% | Job workspace directory | %workspace%/build/output for build artifacts |
Policy Lifecycle
The recommended workflow for creating and deploying security policies:
1. Derive
Start with a policy in derive mode and run your pipeline:
{
"mode": "derive"
}After the build completes, the Runtime Sensor outputs a derived policy containing rules for all observed behavior.
2. Refine
Review the derived policy and refine it:
- Consolidate paths using brace expansion
- Remove overly specific rules for ephemeral files
- Group similar operations where appropriate
3. Observe
Deploy the refined policy in observe mode:
{
"mode": "observe"
}Run several builds and review any violations in Team Server. Adjust the policy as needed.
4. Enforce
Once builds run cleanly in observe mode, switch to enforce:
{
"mode": "enforce"
}The Runtime Sensor now actively blocks unauthorized operations.
Policy Management
Security policies are managed through Team Server:
- Create policies: Define policies using the built-in editor with JSON schema validation
- Assign policies: Link policies to pipelines for enforcement
- Monitor violations: View and investigate policy violations
- Version history: Track policy changes with audit logging
To create a policy in Team Server:
- Navigate to Policies in the main menu
- Click Create
- Enter a Name, Description, and Version
- Write or paste your policy JSON
- Click Create
To assign a policy to a pipeline:
- Navigate to Policies
- Click the Assign Policy (link icon) for your policy
- Search and select the pipeline(s) to protect
- Click Assign
Next Steps
- Specification — Full reference for policy format and all available rules
- Example Policies — Real-world policy examples for common use cases