Policy Life Cycle
The complete lifecycle of a policy is as follows:
Policy Authoring
JSON Format / TREX Tool
Generating the Policy template/modifying the Policy
Generating Signed Policy Blob
Key Pairs / TREX Tool
Policy integrity protected
Publishing the Policy Blob
Cloud Storage (AWS / GCP)
Policy uploaded
Download, Validate and Apply Policy
BlueRock Control Plane
Verification of Policy Signature and Policy syntax
Enforcement
BlueRock Control Plane
Rules are evaluated at Program Run-time
Observability
BlueRock Control Plane
Source Events and Violations are logged
Policy Source Configuration
The BlueRock Runtime (bluerockd) loads its configuration from the local configuration file:
/etc/bluerock/bluerock.toml
The bluerock.toml configuration file defines the following parameters:
Runtime settings
Policy storage bucket name
Policy file name
Policy signature file name
Public key used for signature verification
Policy polling interval
Transport authentication settings
Storage bucket region
OTLP event export configuration
If the signature validation fails, the policy will not be loaded.
Example configuration:
When a Policy Is Applied
Policies are applied at runtime by the BlueRock Control Plane service. The service periodically checks the policy source configured in bluerock.toml for updates and loads the latest valid policy.
Policy application occurs in the following situations:
When the BlueRock Control Plane service starts or restarts.
When a newer policy version is detected in the configured cloud storage location during periodic checks.
Policy Loading Workflow
The BlueRock Runtime (bluerockd) reads the local bluerock.toml configuration file.
It connects to the configured policy storage location (for example an S3 bucket).
The service checks whether a newer policy version is available.
If a new version is detected, the policy package is downloaded.
The policy signature is verified using the configured public key.
If verification succeeds, the policy configuration is validated.
The validated policy is applied to the BlueRock sensors (App Sensors and Kernel Sensors) for runtime enforcement.
Sensors generate MCP events and evaluate them against the configured policy rules during MCP client–server interactions.
Violations are exported through OpenTelemetry (OTEL) using OTLP streams to external observability systems such as AWS CloudWatch or Google LogExplorer.
If signature verification or policy validation fails, the policy is rejected and the system continues using the previously active or default built-in policy.
Enforcement Modes
Policies support two enforcement modes:
observe (remediate:false)
Log violations but allow program execution
enforce (remediate:true)
Block program execution and log violation
Policy Generation and Signing using TREX tool
Validation Overview
After uploading the policy artifacts and restarting the BlueRock Control Plane service, validation should confirm that the policy was successfully retrieved, verified, and applied by the BlueRock runtime.
Validation includes the following checks:
Confirm BlueRock Control Plane service is running
Confirm policy download and signature verification in runtime logs
Confirm policy lifecycle events in CloudWatch (OTEL telemetry)
Trigger rule condition
Confirm runtime activity after policy execution
1. Confirm BlueRock Control Plane Service Is Running
Verify that the BlueRock Control Plane service is running on the instance.
Example output:
This confirms that the BlueRock Control Plane service is active and running.
2. Confirm Policy Download and Signature Verification in Runtime Logs
Check the BlueRock Control Plane service logs to confirm that the policy has been downloaded and applied.
Example output:
The log entry below confirms that the BlueRock runtime successfully loaded the generated policy:
3. Confirm Policy Lifecycle Events in CloudWatch (OTEL Telemetry)
BlueRock emits OpenTelemetry (OTEL) telemetry events during the policy lifecycle process. These events provide visibility into policy retrieval, validation, and application during runtime startup.
To verify these events:
Open the AWS CloudWatch Console
Navigate to:
Open the BlueRock telemetry log group:
Select the latest log stream:
Locate the policy lifecycle events generated during service startup.
These events are emitted by the BlueRock Control Plane - Policy Control Manager (PCM) component running on the deployed EC2 instance.
Example OTEL Policy Lifecycle Events
Policy Download Attempt
Policy Download Started
Policy Download Completed
Policy Download Success
This sequence confirms that the BlueRock Control Plane successfully downloaded, validated, and applied the configured runtime policy.
4. Confirm Runtime Policy Is Loaded
Check the BlueRock Runtime logs to confirm that the policy has been successfully loaded.
Example command:
Example output:
This confirms that the runtime policy engine has successfully loaded the configured policy.
5. Trigger Rule Condition
Run commands that generate runtime activity to trigger policy evaluation and produce event logs for any policy violations (WARN or ERROR).
Example command:
This command generates a network request event, allowing the runtime policy engine to evaluate activity on the host.
6. Verify Policy Evaluation in Logs
Re-check the runtime logs to confirm that the rule evaluation and any violations are recorded.
Last updated