[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-12-21 UTC。"],[],[],null,["# Managing secure-by-default organization resources\n\nIf you are a new customer, Google Cloud automatically provisions an\norganization resource for your domain in the following scenarios:\n\n- A user from your domain logs in for the first time.\n- A user creates a billing account that does not have an associated organization resource.\n\nThis organization resource's default configuration, characterized by unrestricted\naccess, can make the infrastructure susceptible to security breaches. For\nexample, default service account key creation is a critical vulnerability\nexposing systems to potential breaches.\n\nWith the secure-by-default organization policy enforcements, insecure\npostures are addressed with a bundle of organization policies that are enforced\nat the time of creation of an organization resource. Examples of these enforcements\ninclude disabling service account key creation and disabling service account key upload.\n\nWhen an existing user creates an organization, the security posture for the\nnew organization resource might be different from the existing organization resources.\nSecure-by-default organization policies are enforced for all organizations\ncreated on or after May 3, 2024. Some organizations created between February 2024\nand April 2024 might also have these default policy enforcements set. To view organization\npolicies applied to your organization, see\n[Viewing organization policies](/resource-manager/docs/organization-policy/creating-managing-policies#viewing_organization_policies).\n\nAs an administrator, following are the scenarios where these organization policy\nenforcements are applied automatically:\n\n- **Google Workspace or Cloud Identity account**: When you have a Google Workspace or Cloud Identity account, an organization resource is created that is associated with your domain. The secure-by-default organization policies are enforced automatically on the organization resource.\n- **Billing account creation**: If the billing account you create is not associated with an organization resource, then an organization resource is automatically created. The secure-by-default organization policies are enforced on the organization resource. This scenario works on both the Google Cloud console and gcloud CLI.\n\nRequired permissions\n--------------------\n\nThe Identity and Access Management role\n[`roles/orgpolicy.policyAdmin`](/iam/docs/understanding-roles#organization-policy-roles) enables\nan administrator to manage organization policies. You must be an organization\npolicy administrator to change or override organization policies.\nTo grant the role, run the following command: \n\n gcloud organizations add-iam-policy-binding \u003cvar translate=\"no\"\u003eORGANIZATION\u003c/var\u003e --member=\u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e --role=\u003cvar translate=\"no\"\u003eROLE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eORGANIZATION\u003c/var\u003e: Unique identifier of your organization.\n- \u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e: The principal to add the binding for. This should be of the form `user|group|serviceAccount:email` or `domain:domain`. For example, `user:222larabrown@gmail.com`.\n- \u003cvar translate=\"no\"\u003eROLE\u003c/var\u003e: Role to grant to the principal. Use the complete path of a predefined role. In this case, it should be `roles/orgpolicy.policyAdmin`.\n\nOrganization policies enforced on organization resources\n--------------------------------------------------------\n\nThe following table lists the organization policy constraints that are\nautomatically enforced when you create an organization resource.\n\n| **Note:** For some organizations created after August 15, 2024, the `constraints/compute.restrictProtocolForwardingCreationForTypes` organization policy constraint might already be applied.\n\nManage enforcement of organization policies\n-------------------------------------------\n\nYou can manage the enforcement of organization policies in the following ways:\n\n### List organization policies\n\nTo check whether the secure-by-default organization policies are enforced on your organization,\nuse the following command: \n\n gcloud resource-manager org-policies list --organization=\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e with the unique identifier of your organization.\n\n### Disable organization policies\n\nTo disable or delete an organization policy, run the following command: \n\n gcloud org-policies delete \u003cvar translate=\"no\"\u003eCONSTRAINT_NAME\u003c/var\u003e --organization=\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCONSTRAINT_NAME\u003c/var\u003e is the name of the organization policy constraint you want to delete. An example is `iam.allowedPolicyMemberDomains`.\n- \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e is the unique identifier of your organization.\n\n### Add or update values for an organization policy\n\nTo add or update values for an organization policy, you need to store the values in a YAML file.\nAn example of what the contents of this file can look like: \n\n {\n \"name\": \"organizations/ORG_ID/policies/\u003cvar translate=\"no\"\u003eCONSTRAINT_NAME\u003c/var\u003e\",\n \"spec\": {\n \"rules\": [\n {\n \"values\": {\n \"allowedValues\": [\"VALUE_A\"]\n }\n }\n ]\n }\n }\n\nTo add or update these values listed in the YAML file, run the following command: \n\n gcloud org-policies set-policy \u003cvar translate=\"no\"\u003ePOLICY_FILE\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003ePOLICY_FILE\u003c/var\u003e with the path to the YAML file that contains the\nvalues of the organization policy."]]