Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
BETAGovernancePolicy

Blast radius analysis for policies

Estimate the impact of a Harness policy change before you save it by replaying the policy against recent evaluations.

This feature is in Beta and requires enablement. View all early access features.

When you change a Rego policy, the new version applies to the next evaluation of every policy set that includes it. Blast radius analysis shows which entities the change would affect before that happens. It replays your policy against recent evaluations, so you can see which entities would pass and which would fail.


What you will learn from this topic


Before you begin

Before you run a blast radius analysis, ensure you have:

  • A policy: A new policy or an existing policy at the account, organization, or project scope. Go to Harness Policy As Code overview to create one.

  • Policy permissions: The permissions to view and edit policies at the scope where you open the policy. Go to RBAC in Harness to review roles and permissions.

  • Evaluation history: Recent evaluations for the entity type you want to analyze. Without history, Harness uses built-in sample payloads. Go to Policy evaluations retention to learn how long evaluations are kept.


Run a blast radius analysis

You can run the analysis while you create a new policy, while you edit a policy before you save it, or on a policy that is already saved.

  1. In Harness, go to Account Settings, Organization Settings, or Project Settings, and select Policies. Create a policy, or open an existing one.

  2. Write or edit the Rego in the Studio tab. You do not have to save the policy or the change.

  3. Select the Blast Radius Analysis tab.

  4. Click Configure to set the scope, or keep the default scope. Go to Configure the analysis scope for the options.

  5. Click Calculate.

The Blast Radius Analysis tab in the policy editor, showing the current scope and the Calculate button.

Harness runs the policy as it currently appears in the editor against the selected evaluations and shows the results on the page.

Dry run evaluations are not stored

The evaluations that Harness runs for a blast radius analysis do not appear in the Evaluations tab. The analysis runs each time you click Calculate, and Harness does not keep the results. Payloads that you test in the Testing Terminal are not stored either.


Configure the analysis scope

The scope bar on the Blast Radius Analysis tab shows the organization, project, entity type, and action that Harness uses. Click Configure to open the Configure analysis scope panel, change the values, and click Apply.

The Configure analysis scope panel with Organization, Project, Entity type, and Action fields.

The panel has the following fields:

Field
Description

Organization

Limits the analysis to evaluations of entities in this organization. The default is All organizations at the account scope. At the organization and project scopes, Harness fixes the value to the current organization.

Project

Limits the analysis to evaluations of entities in this project. The default is All projects. At the project scope, Harness fixes the value to the current project. At the account scope, select an organization first to enable this field.

Entity type

Required. The type of entity to replay evaluations for, such as Pipeline. The list contains the entity types that policy sets support.

Action

The event to replay evaluations for. The default is All actions. The list contains the actions that apply to the selected entity type, such as On Run, On Save, and On Step Start for a pipeline.


Evaluation selection criteria

When you click Calculate, Harness looks at the previous evaluations that match the entity type and action you selected, and applies the following limits:

  • Time window: Harness considers evaluations from the last 30 days.

  • Entity limit: Harness replays up to 25 unique entities. For the Terraform Plan and Terraform State entity types, the limit is 10 unique entities. If an entity was evaluated multiple times, Harness uses only its most recent evaluation.

  • Payload size: The maximum payload size is 30 MB. Harness skips and rejects any payload larger than 30 MB.

For example, if only 10 unique pipelines were evaluated in the last 30 days, Harness replays the policy against those 10 pipelines.

If there are no previous evaluations for the entity type and action, Harness replays the policy against the built-in sample payloads for that entity type.

If you change the policy or the scope after you calculate, the page shows a warning that the results are out of date. Click Calculate again to re-evaluate.


Read the results

The results show two totals followed by a list of the entities that Harness evaluated:

  • Errors: The number of policy violations, which are the entities that fail the policy.

  • Passes: The number of compliant entities.

Each entry in the list shows whether the entity passes or fails, the entity name, and a badge that shows where the payload came from:

  • History: The payload comes from a previous evaluation in the selected scope.

  • Sample payload: There is no history for the entity type and action, so Harness uses a built-in sample payload.

Expand an entry to see the details:

  • For an entity that fails, Harness displays the failure message returned by the policy. For a History entry, it also shows a View evaluation link.

  • For an entity that passes, Harness shows that no deny rules matched the entity.

Results from past evaluations

The following example shows two entities that fail the policy. Both entries have the History badge and are expanded.

Blast Radius Analysis results showing two policy violations from past evaluations, each with a failure message and a View evaluation link.

The View evaluation link opens the previous evaluation that Harness replayed. Open it to see the payload that the policy ran against. The link opens the original evaluation, not the dry run.

Results from sample payloads

The following example shows an entity that Harness evaluated with a built-in sample payload because there was no history to replay.

Blast Radius Analysis results showing one policy violation evaluated with a sample payload.

Next steps

Last updated

Was this helpful?