Skip to main content

Policy Configuration

The Policy section controls how Vectra evaluates request policies.

Class: Vectra.BuildingBlocks.Configuration.Policy.PolicyConfiguration


Properties

PropertyTypeDefaultDescription
Enabledbool?trueEnable or disable policy evaluation globally
DefaultProviderstring"Internal"Active policy provider: "Internal" or "Opa"
Providers.Internal.DirectorystringDirectory path containing JSON policy files
Providers.Opa.BaseUrlstringBase URL of your OPA server
Providers.Opa.Pathstring"/v1/data/vectra/authz"OPA decision path
Providers.Opa.TimeoutTimeSpan?00:00:05OPA HTTP request timeout

Internal Provider

The Internal provider loads JSON policy definitions from the local filesystem using FileSystemPolicyLoader. Policies are cached in memory via PolicyCacheService.

"Policy": {
"Enabled": true,
"DefaultProvider": "Internal",
"Providers": {
"Internal": { "Directory": "./policies" }
}
}

Policy files must be placed in the configured directory and named <policy-name>.json. See Policies for the file format.


OPA Provider

The OPA provider delegates evaluation to an external Open Policy Agent server.

"Policy": {
"Enabled": true,
"DefaultProvider": "Opa",
"Providers": {
"Opa": {
"BaseUrl": "http://localhost:8181",
"Path": "/v1/data/vectra/authz",
"Timeout": "00:00:05"
}
}
}

Vectra posts a JSON input document to OPA containing the full RequestContext (agent ID, method, path, headers, body, trust score, policy name) and reads the allow, deny, and hitl decisions from the response.


Disabling Policy Evaluation

Set Enabled: false to skip policy evaluation entirely. Risk scoring and semantic analysis (if enabled) still run.

"Policy": { "Enabled": false }