Estimated time: 20–30 minutes. Complete Getting Started first. For the concepts, see the Data Control Center overview.
Before You Begin
- A configured
provider "barndoor"block (see Getting Started)
Step 1: Adopt the organization config
Data protection has one configuration object per organization, provisioned by the platform. Thebarndoor_dlp_org_config resource adopts that singleton rather than creating anything:
barndoor_dlp_org_config
Because it’s a singleton,
terraform destroy doesn’t delete anything — it resets both settings to the platform defaults (enabled = true, global_dry_run = false) and drops the resource from state.Step 2: Define a detection engine (Protection Profile)
A detection engine — a Protection Profile in the app — binds a detection provider to the data types it scans for. Enforcement policies reference engines, so at least one must exist. Manage it in Terraform, or look up one that was created in the portal:- New engine
- Existing engine (data source)
barndoor_dlp_detection_engine resource, data source
Engines are unique per (
name, provider_type) — the same name across several provider types renders as one merged profile in the app. Deleting an engine that is the only one on an enforcement policy fails with an error naming the referencing policy.Step 3: Define a custom detection type
Custom detection types extend the built-in detectors with organization-specific patterns — project codenames, internal ticket formats, customer ID shapes:barndoor_dlp_custom_detection_type
Patterns are evaluated in order. Regex patterns use Rust regex syntax and are validated by the API — a pattern that doesn’t compile is rejected at apply time, not silently ignored.
The platform assigns the type’s wire name (DETECTION_TYPE_CUSTOM_…), exposed as the detection_type attribute — that’s the value other data protection resources reference.
Step 4: Suppress false positives with allow-list entries
Allow-list entries stop known-safe values from being reported (and acted on) as findings:barndoor_dlp_allow_list_entry
The platform has no update operation for allow-list entries, so changing any attribute replaces the entry (delete + create). Plans will show this as a replacement — that’s expected.
Step 5: Enforce with a policy — dry run first
Enforcement policies decide what happens when a detection engine reports a finding. A policy targets exactly one lane: MCP traffic (tool inputs/outputs) or model-provider traffic (prompts/responses). Start in dry run — the policy evaluates and records findings in activity, but takes no action:barndoor_dlp_enforcement_policy