Policy
A policy for container image binary authorization.
To get more information about Policy, see:
- API documentation
- How-to Guides
Create a Policy Resource
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);def Policy(resource_name, opts=None, admission_whitelist_patterns=None, cluster_admission_rules=None, default_admission_rule=None, description=None, global_policy_evaluation_mode=None, project=None, __props__=None);func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Policy resource accepts the following input properties:
- Default
Admission PolicyRule Default Admission Rule Args Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- Admission
Whitelist List<PolicyPatterns Admission Whitelist Pattern Args> A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- Cluster
Admission List<PolicyRules Cluster Admission Rule Args> Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- Description string
A descriptive comment.
- Global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Default
Admission PolicyRule Default Admission Rule Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- Admission
Whitelist []PolicyPatterns Admission Whitelist Pattern A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- Cluster
Admission []PolicyRules Cluster Admission Rule Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- Description string
A descriptive comment.
- Global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- default
Admission PolicyRule Default Admission Rule Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- admission
Whitelist PolicyPatterns Admission Whitelist Pattern[] A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- cluster
Admission PolicyRules Cluster Admission Rule[] Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- description string
A descriptive comment.
- global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- default_
admission_ Dict[Policyrule Default Admission Rule] Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- admission_
whitelist_ List[Policypatterns Admission Whitelist Pattern] A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- cluster_
admission_ List[Policyrules Cluster Admission Rule] Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- description str
A descriptive comment.
- global_
policy_ strevaluation_ mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
Look up an Existing Policy Resource
Get an existing Policy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PolicyState, opts?: CustomResourceOptions): Policystatic get(resource_name, id, opts=None, admission_whitelist_patterns=None, cluster_admission_rules=None, default_admission_rule=None, description=None, global_policy_evaluation_mode=None, project=None, __props__=None);func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Admission
Whitelist List<PolicyPatterns Admission Whitelist Pattern Args> A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- Cluster
Admission List<PolicyRules Cluster Admission Rule Args> Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- Default
Admission PolicyRule Default Admission Rule Args Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- Description string
A descriptive comment.
- Global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Admission
Whitelist []PolicyPatterns Admission Whitelist Pattern A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- Cluster
Admission []PolicyRules Cluster Admission Rule Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- Default
Admission PolicyRule Default Admission Rule Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- Description string
A descriptive comment.
- Global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- admission
Whitelist PolicyPatterns Admission Whitelist Pattern[] A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- cluster
Admission PolicyRules Cluster Admission Rule[] Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- default
Admission PolicyRule Default Admission Rule Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- description string
A descriptive comment.
- global
Policy stringEvaluation Mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- admission_
whitelist_ List[Policypatterns Admission Whitelist Pattern] A whitelist of image patterns to exclude from admission rules. If an image’s name matches a whitelist pattern, the image’s admission requests will always be permitted regardless of your admission rules. Structure is documented below.
- cluster_
admission_ List[Policyrules Cluster Admission Rule] Per-cluster admission rules. An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied. There can be at most one admission rule per cluster spec.
- default_
admission_ Dict[Policyrule Default Admission Rule] Default admission rule for a cluster without a per-cluster admission rule. Structure is documented below.
- description str
A descriptive comment.
- global_
policy_ strevaluation_ mode Controls the evaluation of a Google-maintained global admission policy for common system-level images. Images not covered by the global policy will be subject to the project admission policy.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Supporting Types
PolicyAdmissionWhitelistPattern
- Name
Pattern string An image name pattern to whitelist, in the form
registry/path/to/image. This supports a trailing * as a wildcard, but this is allowed only in text after the registry/ part.
- Name
Pattern string An image name pattern to whitelist, in the form
registry/path/to/image. This supports a trailing * as a wildcard, but this is allowed only in text after the registry/ part.
- name
Pattern string An image name pattern to whitelist, in the form
registry/path/to/image. This supports a trailing * as a wildcard, but this is allowed only in text after the registry/ part.
- name
Pattern str An image name pattern to whitelist, in the form
registry/path/to/image. This supports a trailing * as a wildcard, but this is allowed only in text after the registry/ part.
PolicyClusterAdmissionRule
- Cluster string
The identifier for this object. Format specified above.
- Enforcement
Mode string The action when a pod creation is denied by the admission rule.
- Evaluation
Mode string How this admission rule will be evaluated.
- Require
Attestations List<string>Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- Cluster string
The identifier for this object. Format specified above.
- Enforcement
Mode string The action when a pod creation is denied by the admission rule.
- Evaluation
Mode string How this admission rule will be evaluated.
- Require
Attestations []stringBies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- cluster string
The identifier for this object. Format specified above.
- enforcement
Mode string The action when a pod creation is denied by the admission rule.
- evaluation
Mode string How this admission rule will be evaluated.
- require
Attestations string[]Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- cluster str
The identifier for this object. Format specified above.
- enforcement
Mode str The action when a pod creation is denied by the admission rule.
- evaluation
Mode str How this admission rule will be evaluated.
- require
Attestations List[str]Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
PolicyDefaultAdmissionRule
- Enforcement
Mode string The action when a pod creation is denied by the admission rule.
- Evaluation
Mode string How this admission rule will be evaluated.
- Require
Attestations List<string>Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- Enforcement
Mode string The action when a pod creation is denied by the admission rule.
- Evaluation
Mode string How this admission rule will be evaluated.
- Require
Attestations []stringBies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- enforcement
Mode string The action when a pod creation is denied by the admission rule.
- evaluation
Mode string How this admission rule will be evaluated.
- require
Attestations string[]Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
- enforcement
Mode str The action when a pod creation is denied by the admission rule.
- evaluation
Mode str How this admission rule will be evaluated.
- require
Attestations List[str]Bies The resource names of the attestors that must attest to a container image. If the attestor is in a different project from the policy, it should be specified in the format
projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource. Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.