Create a new asset policy that automatically takes action on assets matching defined conditions. Supported actions: alert (send notifications), delete (remove assets), set_label (add labels), and remove_label (remove labels).
policy_type determines which fields are required:| Policy Type | Required Fields |
|---|---|
alert (default) | alerting_config_ids |
delete | — |
set_label | labels |
remove_label | labels |
policies object use AND logic — all conditions must match for the policy to apply.Scope: Set apply_to_existing to true to apply the policy to existing matching assets immediately. When false (default), the policy only acts on newly discovered assets.Display name for the policy. Auto-generated if not provided.
Type of action to perform when policy matches assets
alert, delete, set_label, remove_label List of alerting configuration IDs (required when policy_type is 'alert')
List of labels to apply/remove (required when policy_type is 'set_label' or 'remove_label')
Optional list of enumeration IDs to scope this policy to specific enumerations
When true, the policy action is applied to existing assets that match the conditions in addition to future assets. When false (default), the policy only applies to newly discovered assets.