Policy Schema Reference
Complete reference for Garnet policy YAML format.Top-Level Fields
Example: Complete Policy
Field Reference
name
Type: string (required)
Description: Human-readable name for the policy.
Example:
type
Type: enum (required)
Values:
allow: Domains/IPs in rules will never trigger Issuesblock: Domains/IPs in rules will always be blocked
scope
Type: ScopeObject | "global" (optional, default: "global")
Description: Defines where the policy applies.
Global Scope
Platform Scope
GitHub Actions Scope
Kubernetes Scope
rules
Type: array<RuleObject> (required)
Description: List of domain/IP patterns to allow or block.
Rule Object
Examples
enabled
Type: boolean (optional, default: true)
Description: Whether the policy is active.
Example:
description
Type: string (optional)
Description: Long-form description of the policy’s purpose.
Example:
metadata
Type: object (optional)
Description: Custom metadata for tracking and auditing.
Example:
Pattern Matching Reference
| Pattern | Matches | Example Matches |
|---|---|---|
example.com | Exact domain only | example.com |
*.example.com | Direct subdomains | api.example.com, www.example.com |
**.example.com | All nested subdomains | api.v2.example.com, deep.nested.example.com |
192.0.2.0/24 | CIDR range | 192.0.2.1 - 192.0.2.254 |
192.0.2.* | IP wildcard | 192.0.2.1 - 192.0.2.255 |
10.*.1.1 | IP pattern | 10.0.1.1, 10.255.1.1 |
Complete Example: Multi-Scope
API: Create Policy
API: Update Policy
API: Delete Policy
API: List Policies
Validation
Before applying, validate your policy YAML:Next Steps
Policy Examples
See common policy configurations