A policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy.
Gets the policy for this project. Returns a default policy if the project does not have one.
HTTP request
GET https://binaryauthorization.googleapis.com/v1beta1/{name=projects/*/policy}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-30 UTC."],[[["\u003cp\u003eThis webpage outlines the process for retrieving a project's Binary Authorization policy, which dictates the attestors required for container image deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request to retrieve the policy is a \u003ccode\u003eGET\u003c/code\u003e request to the specified URL, using gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003ename\u003c/code\u003e parameter in the path, formatted as \u003ccode\u003eprojects/*/policy\u003c/code\u003e, to identify the target policy, and requires the \u003ccode\u003ebinaryauthorization.policy.get\u003c/code\u003e IAM permission.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be empty, and a successful response will contain the project's policy in a \u003ccode\u003ePolicy\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e to be set for the request.\u003c/p\u003e\n"]]],[],null,["# Method: projects.getPolicy\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nA [policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy) specifies the [attestors](/binary-authorization/docs/reference/rest/Shared.Types/Attestor) that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy.\n\nGets the [policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy) for this project. Returns a default [policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy) if the project does not have one.\n\n### HTTP request\n\n`GET https://binaryauthorization.googleapis.com/v1beta1/{name=projects/*/policy}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/)."]]