# AdmissionRule

- [JSON representation](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/AdmissionRule#SCHEMA_REPRESENTATION)

An `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/AdmissionRule` specifies either that all container images used in a pod creation request must be attested to by one or more `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/Attestor`, that all pod creations will be allowed, or that all pod creations will be denied.

Images matching an `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/AdmissionWhitelistPattern` are exempted from admission rules and will never block a pod creation.

| JSON representation |
|---|
| ``` { "evaluationMode": enum (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/EvaluationMode`), "requireAttestationsBy": [ string ], "enforcementMode": enum (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/EnforcementMode`) } ``` |

| Fields ||
|---|---|
| `evaluationMode` | ``enum (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/EvaluationMode`)`` Required. How this admission rule will be evaluated. |
| `requireAttestationsBy[]` | `string` Optional. The resource names of the attestors that must attest to a container image, 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 evaluationMode field specifies REQUIRE_ATTESTATION, otherwise it must be empty. |
| `enforcementMode` | ``enum (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/Shared.Types/EnforcementMode`)`` Required. The action when a pod creation is denied by the admission rule. |