> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/cloud-cost-management/3.0/concepts/asset-governance.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Asset Governance

What a policy, policy set, schedule, and policy run are in Asset Governance

Asset Governance is governance as code for cloud resources. Harness runs policies written in YAML, on Cloud Custodian, so the same standards apply across AWS, Azure, and GCP instead of manual checks.

A policy file is one YAML file. Inside that file, the `policies` list holds one or more policies. Each policy names a resource, filters it, and runs actions on the resources that match.

## What you will learn from this topic

* What a policy contains
* What separates a policy from a cost view rule or a Cost Category rule
* What a policy set is
* What a schedule is
* What a policy run is
* What Cloud Custodian versions Harness runs

## Policy

Governance policies are different from cost view rules and Cost Category rules.

A policy file is a YAML file that Harness runs on cloud infrastructure. The file contains one or more policies. Each policy includes a resource, filters, and actions. One policy file can include multiple policies.

These terms describe a policy:

* A policy is one entry in the policy file. It consists of filters and actions applied to one type of cloud resource.
* A resource is the cloud resource or service the policy runs against, such as Azure VMs, AKS, or Cosmos DB.
* A filter narrows the results by attributes you provide, such as tags, metadata, or another resource property. Only resources that match the filter are returned.
* Actions are operations on the filtered resources, such as stopping an Azure VM, deleting an Azure storage container, or sending an email.

For example, to move every EBS volume from gp2 to gp3, the policy finds the gp2 volumes and migrates them. Without the policy, each volume is checked and upgraded by hand.

![Diagram of a policy file containing three policies, each with Action, Filter, and Resource, next to the YAML for one policy](https://3362046280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLgkNK1xq1Uj6rzIm2kum%2Fuploads%2Fgit-blob-3025dbcbc1baf0acf4aaeb15ed8d0eed766bae00%2Fasset-governance-policy-file.png?alt=media)

Navigate to [Create a policy](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/create-a-policy.md) to write a policy and run it once. Navigate to the [Terraform registry](https://registry.terraform.io/providers/harness/harness/latest/docs/resources/governance_rule) to manage policies with Terraform.

## Policy set

A policy file can hold multiple policies. When you have many policy files, a policy set groups them. A schedule can target the policy set instead of each policy.

Navigate to [Policy sets](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/policy-sets.md) to create a policy set. Navigate to the [Terraform registry](https://registry.terraform.io/providers/harness/harness/latest/docs/resources/governance_rule_set) to manage policy sets with Terraform.

## Schedule

A schedule runs policies or policy sets against targets (accounts, projects, or subscriptions) on a cadence. The cadence is hourly, daily, or weekly, with the day, time, and time zone you set.

Each schedule can have up to 10,000 policy runs. The cap is `Policies × Accounts × Regions`. It replaces the earlier separate limits on policies, policy sets, accounts, and regions.

For example, a schedule can delete unattached disks every day at 2:00 AM, every hour during peak usage, or once a week for a less frequent cleanup.

Navigate to [Schedules](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/schedules.md) to create a schedule. Navigate to the [Terraform registry](https://registry.terraform.io/providers/harness/harness/latest/docs/resources/governance_rule_enforcement) to manage schedules with Terraform.

## Policy run

A policy run is the record of one execution. A run starts from **Live run** on the policy page or from a schedule. The policy run shows the cost impact of that execution and the last time the policy or policy set ran.

Harness reports three statuses:

* **Success**: The run finished with no errors.
* **Failed**: The run did not finish and has errors.
* **Partial success**: The run finished with no Harness errors, and Cloud Custodian wrote additional logs, or a multi-policy run succeeded for only some of the resources.

Navigate to [Policy runs](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/policy-runs.md) to read a policy run.

## Cloud Custodian versions

Asset Governance is built on [Cloud Custodian](https://cloudcustodian.io) and covers the cloud resources for [AWS](https://cloudcustodian.io/docs/aws/resources/index.html), [GCP](https://cloudcustodian.io/docs/gcp/resources/index.html), and [Azure](https://cloudcustodian.io/docs/azure/resources/index.html). The Cloud Custodian versions Harness runs are:

* c7n==0.9.44
* c7n\_azure==0.7.43
* c7n\_gcp==0.4.43

{% @harness-feedback/feedback %}
