action anchore_update_policy { label: "Update policy" description: "Update/replace and existing policy" provider: anchore method: PUT path: "/policies/{policyId}" encoding: json input: { type: "object" properties: { active: { type: "boolean" } created_at: { type: "string" format: "date-time" } last_updated: { type: "string" format: "date-time" } policyId: { type: "string" } policy_source: { type: "string" description: "Source location of where the policy bundle originated" } policybundle: { type: "object" description: "A bundle containing a set of policies, whitelists, and rules for mapping them to specific images" required: ["id", "mappings", "policies", "version"] properties: { blacklisted_images: { type: "array" description: "List of mapping rules that define which images should always result in a STOP/FAIL policy result regardless of policy content or presence in whitelisted_images" items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } registry: { type: "string" } repository: { type: "string" } } } } comment: { type: "string" description: "Description of the bundle, human readable" } id: { type: "string" description: "Id of the bundle" } mappings: { type: "array" description: "Mapping rules for defining which policy and whitelist(s) to apply to an image based on a match of the image tag or id. Evaluated in order." items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } policy_id: { type: "string" description: "Optional single policy to evalute, if set will override any value in policy_ids, for backwards compatibility. Generally, policy_ids should be used even with a array of length 1." } policy_ids: { type: "array" description: "List of policyIds to evaluate in order, to completion" items: { type: "string" description: "PolicyId to evaluate" } } registry: { type: "string" } repository: { type: "string" } whitelist_ids: { type: "array" items: { type: "string" } } } } } name: { type: "string" description: "Human readable name for the bundle" } policies: { type: "array" description: "Policies which define the go/stop/warn status of an image using rule matches on image properties" items: { type: "object" required: ["id", "version"] properties: { comment: { type: "string" } id: { type: "string" } name: { type: "string" } rules: { type: "array" items: { type: "object" description: "A rule that defines and decision value if the match is found true for a given image." required: ["gate", "trigger", "action"] properties: { action: { enum: ["GO", "STOP", "WARN"] type: "object" } gate: { type: "string" } id: { type: "string" } params: { type: "array" items: { type: "object" required: ["name", "value"] properties: { name: { type: "string" } value: { type: "string" } } } } trigger: { type: "string" } } } } version: { type: "string" } } } } version: { type: "string" description: "Version id for this bundle format" } whitelisted_images: { type: "array" description: "List of mapping rules that define which images should always be passed (unless also on the blacklist), regardless of policy result." items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } registry: { type: "string" } repository: { type: "string" } } } } whitelists: { type: "array" description: "Whitelists which define which policy matches to disregard explicitly in the final policy decision" items: { type: "object" description: "A collection of whitelist items to match a policy evaluation against." required: ["id", "version"] properties: { comment: { type: "string" } id: { type: "string" } items: { type: "array" items: { type: "object" description: "Identifies a specific gate and trigger match from a policy against an image and indicates it should be ignored in final policy decisions" required: ["gate", "trigger_id"] properties: { expires_on: { type: "string" format: "date-time" } gate: { type: "string" } id: { type: "string" } trigger_id: { type: "string" } } } } name: { type: "string" } version: { type: "string" } } } } } } userId: { type: "string" description: "UserId of the user that owns the bundle" } "x-anchore-account": { type: "string" } } required: ["policyId"] additionalProperties: false } output: { type: "array" description: "List of PolicyBundleRecord objects" items: { type: "object" description: "A policy bundle plus some metadata" properties: { active: { type: "boolean" description: "True if the bundle is currently defined to be used automatically" } created_at: { type: "string" format: "date-time" } last_updated: { type: "string" format: "date-time" } policyId: { type: "string" description: "The bundle's identifier" } policy_source: { type: "string" description: "Source location of where the policy bundle originated" } policybundle: { type: "object" description: "A bundle containing a set of policies, whitelists, and rules for mapping them to specific images" required: ["id", "version", "policies", "mappings"] properties: { blacklisted_images: { type: "array" description: "List of mapping rules that define which images should always result in a STOP/FAIL policy result regardless of policy content or presence in whitelisted_images" items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } registry: { type: "string" } repository: { type: "string" } } } } comment: { type: "string" description: "Description of the bundle, human readable" } id: { type: "string" description: "Id of the bundle" } mappings: { type: "array" description: "Mapping rules for defining which policy and whitelist(s) to apply to an image based on a match of the image tag or id. Evaluated in order." items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } policy_id: { type: "string" description: "Optional single policy to evalute, if set will override any value in policy_ids, for backwards compatibility. Generally, policy_ids should be used even with a array of length 1." } policy_ids: { type: "array" description: "List of policyIds to evaluate in order, to completion" items: { type: "string" description: "PolicyId to evaluate" } } registry: { type: "string" } repository: { type: "string" } whitelist_ids: { type: "array" items: { type: "string" } } } } } name: { type: "string" description: "Human readable name for the bundle" } policies: { type: "array" description: "Policies which define the go/stop/warn status of an image using rule matches on image properties" items: { type: "object" required: ["id", "version"] properties: { comment: { type: "string" } id: { type: "string" } name: { type: "string" } rules: { type: "array" items: { type: "object" description: "A rule that defines and decision value if the match is found true for a given image." required: ["gate", "trigger", "action"] properties: { action: { enum: ["GO", "STOP", "WARN"] type: "object" } gate: { type: "string" } id: { type: "string" } params: { type: "array" items: { type: "object" required: ["name", "value"] properties: { name: { type: "string" } value: { type: "string" } } } } trigger: { type: "string" } } } } version: { type: "string" } } } } version: { type: "string" description: "Version id for this bundle format" } whitelisted_images: { type: "array" description: "List of mapping rules that define which images should always be passed (unless also on the blacklist), regardless of policy result." items: { type: "object" required: ["name", "registry", "repository", "image"] properties: { id: { type: "string" } image: { type: "object" description: "A reference to an image" required: ["type", "value"] properties: { type: { enum: ["tag", "digest", "id"] type: "object" } value: { type: "string" } } } name: { type: "string" } registry: { type: "string" } repository: { type: "string" } } } } whitelists: { type: "array" description: "Whitelists which define which policy matches to disregard explicitly in the final policy decision" items: { type: "object" description: "A collection of whitelist items to match a policy evaluation against." required: ["id", "version"] properties: { comment: { type: "string" } id: { type: "string" } items: { type: "array" items: { type: "object" description: "Identifies a specific gate and trigger match from a policy against an image and indicates it should be ignored in final policy decisions" required: ["gate", "trigger_id"] properties: { expires_on: { type: "string" format: "date-time" } gate: { type: "string" } id: { type: "string" } trigger_id: { type: "string" } } } } name: { type: "string" } version: { type: "string" } } } } } } userId: { type: "string" description: "UserId of the user that owns the bundle" } } } } }