Merge pull request #947 from GoogleCloudPlatform/jccb/fast-org-policy-factory
Use org policy factory for resman stage
This commit is contained in:
commit
f912369072
|
@ -182,17 +182,18 @@ Due to its simplicity, this stage lends itself easily to customizations: adding
|
||||||
|---|---|:---:|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|:---:|
|
||||||
| [automation](variables.tf#L20) | Automation resources created by the bootstrap stage. | <code title="object({ outputs_bucket = string project_id = string project_number = string federated_identity_pool = string federated_identity_providers = map(object({ issuer = string issuer_uri = string name = string principal_tpl = string principalset_tpl = string })) })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
| [automation](variables.tf#L20) | Automation resources created by the bootstrap stage. | <code title="object({ outputs_bucket = string project_id = string project_number = string federated_identity_pool = string federated_identity_providers = map(object({ issuer = string issuer_uri = string name = string principal_tpl = string principalset_tpl = string })) })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
||||||
| [billing_account](variables.tf#L38) | Billing account id and organization id ('nnnnnnnn' or null). | <code title="object({ id = string organization_id = number })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
| [billing_account](variables.tf#L38) | Billing account id and organization id ('nnnnnnnn' or null). | <code title="object({ id = string organization_id = number })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
||||||
| [organization](variables.tf#L191) | Organization details. | <code title="object({ domain = string id = number customer_id = string })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
| [organization](variables.tf#L197) | Organization details. | <code title="object({ domain = string id = number customer_id = string })">object({…})</code> | ✓ | | <code>00-bootstrap</code> |
|
||||||
| [prefix](variables.tf#L215) | Prefix used for resources that need unique names. Use 9 characters or less. | <code>string</code> | ✓ | | <code>00-bootstrap</code> |
|
| [prefix](variables.tf#L221) | Prefix used for resources that need unique names. Use 9 characters or less. | <code>string</code> | ✓ | | <code>00-bootstrap</code> |
|
||||||
| [cicd_repositories](variables.tf#L47) | CI/CD repository configuration. Identity providers reference keys in the `automation.federated_identity_providers` variable. Set to null to disable, or set individual repositories to null if not needed. | <code title="object({ data_platform_dev = object({ branch = string identity_provider = string name = string type = string }) data_platform_prod = object({ branch = string identity_provider = string name = string type = string }) gke_dev = object({ branch = string identity_provider = string name = string type = string }) gke_prod = object({ branch = string identity_provider = string name = string type = string }) networking = object({ branch = string identity_provider = string name = string type = string }) project_factory_dev = object({ branch = string identity_provider = string name = string type = string }) project_factory_prod = object({ branch = string identity_provider = string name = string type = string }) security = object({ branch = string identity_provider = string name = string type = string }) })">object({…})</code> | | <code>null</code> | |
|
| [cicd_repositories](variables.tf#L47) | CI/CD repository configuration. Identity providers reference keys in the `automation.federated_identity_providers` variable. Set to null to disable, or set individual repositories to null if not needed. | <code title="object({ data_platform_dev = object({ branch = string identity_provider = string name = string type = string }) data_platform_prod = object({ branch = string identity_provider = string name = string type = string }) gke_dev = object({ branch = string identity_provider = string name = string type = string }) gke_prod = object({ branch = string identity_provider = string name = string type = string }) networking = object({ branch = string identity_provider = string name = string type = string }) project_factory_dev = object({ branch = string identity_provider = string name = string type = string }) project_factory_prod = object({ branch = string identity_provider = string name = string type = string }) security = object({ branch = string identity_provider = string name = string type = string }) })">object({…})</code> | | <code>null</code> | |
|
||||||
| [custom_roles](variables.tf#L129) | Custom roles defined at the org level, in key => id format. | <code title="object({ service_project_network_admin = string })">object({…})</code> | | <code>null</code> | <code>00-bootstrap</code> |
|
| [custom_roles](variables.tf#L129) | Custom roles defined at the org level, in key => id format. | <code title="object({ service_project_network_admin = string })">object({…})</code> | | <code>null</code> | <code>00-bootstrap</code> |
|
||||||
| [fast_features](variables.tf#L138) | Selective control for top-level FAST features. | <code title="object({ data_platform = bool gke = bool project_factory = bool sandbox = bool teams = bool })">object({…})</code> | | <code title="{ data_platform = true gke = true project_factory = true sandbox = true teams = true }">{…}</code> | <code>00-bootstrap</code> |
|
| [data_dir](variables.tf#L138) | Relative path for the folder storing configuration data. | <code>string</code> | | <code>"data"</code> | |
|
||||||
| [groups](variables.tf#L158) | Group names to grant organization-level permissions. | <code>map(string)</code> | | <code title="{ gcp-billing-admins = "gcp-billing-admins", gcp-devops = "gcp-devops", gcp-network-admins = "gcp-network-admins" gcp-organization-admins = "gcp-organization-admins" gcp-security-admins = "gcp-security-admins" gcp-support = "gcp-support" }">{…}</code> | <code>00-bootstrap</code> |
|
| [fast_features](variables.tf#L144) | Selective control for top-level FAST features. | <code title="object({ data_platform = bool gke = bool project_factory = bool sandbox = bool teams = bool })">object({…})</code> | | <code title="{ data_platform = true gke = true project_factory = true sandbox = true teams = true }">{…}</code> | <code>00-bootstrap</code> |
|
||||||
| [locations](variables.tf#L173) | Optional locations for GCS, BigQuery, and logging buckets created here. | <code title="object({ bq = string gcs = string logging = string pubsub = list(string) })">object({…})</code> | | <code title="{ bq = "EU" gcs = "EU" logging = "global" pubsub = [] }">{…}</code> | <code>00-bootstrap</code> |
|
| [groups](variables.tf#L164) | Group names to grant organization-level permissions. | <code>map(string)</code> | | <code title="{ gcp-billing-admins = "gcp-billing-admins", gcp-devops = "gcp-devops", gcp-network-admins = "gcp-network-admins" gcp-organization-admins = "gcp-organization-admins" gcp-security-admins = "gcp-security-admins" gcp-support = "gcp-support" }">{…}</code> | <code>00-bootstrap</code> |
|
||||||
| [organization_policy_configs](variables.tf#L201) | Organization policies customization. | <code title="object({ allowed_policy_member_domains = list(string) })">object({…})</code> | | <code>null</code> | |
|
| [locations](variables.tf#L179) | Optional locations for GCS, BigQuery, and logging buckets created here. | <code title="object({ bq = string gcs = string logging = string pubsub = list(string) })">object({…})</code> | | <code title="{ bq = "EU" gcs = "EU" logging = "global" pubsub = [] }">{…}</code> | <code>00-bootstrap</code> |
|
||||||
| [outputs_location](variables.tf#L209) | Enable writing provider, tfvars and CI/CD workflow files to local filesystem. Leave null to disable | <code>string</code> | | <code>null</code> | |
|
| [organization_policy_configs](variables.tf#L207) | Organization policies customization. | <code title="object({ allowed_policy_member_domains = list(string) })">object({…})</code> | | <code>null</code> | |
|
||||||
| [tag_names](variables.tf#L226) | Customized names for resource management tags. | <code title="object({ context = string environment = string })">object({…})</code> | | <code title="{ context = "context" environment = "environment" }">{…}</code> | |
|
| [outputs_location](variables.tf#L215) | Enable writing provider, tfvars and CI/CD workflow files to local filesystem. Leave null to disable | <code>string</code> | | <code>null</code> | |
|
||||||
| [team_folders](variables.tf#L243) | Team folders to be created. Format is described in a code comment. | <code title="map(object({ descriptive_name = string group_iam = map(list(string)) impersonation_groups = list(string) }))">map(object({…}))</code> | | <code>null</code> | |
|
| [tag_names](variables.tf#L232) | Customized names for resource management tags. | <code title="object({ context = string environment = string })">object({…})</code> | | <code title="{ context = "context" environment = "environment" }">{…}</code> | |
|
||||||
|
| [team_folders](variables.tf#L249) | Team folders to be created. Format is described in a code comment. | <code title="map(object({ descriptive_name = string group_iam = map(list(string)) impersonation_groups = list(string) }))">map(object({…}))</code> | | <code>null</code> | |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
# skip boilerplate check
|
||||||
|
#
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
|
|
||||||
|
compute.disableGuestAttributesAccess:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
compute.requireOsLogin:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
compute.restrictLoadBalancerCreationForTypes:
|
||||||
|
allow:
|
||||||
|
values:
|
||||||
|
- in:INTERNAL
|
||||||
|
|
||||||
|
compute.skipDefaultNetworkCreation:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
compute.vmExternalIpAccess:
|
||||||
|
deny:
|
||||||
|
all: true
|
||||||
|
|
||||||
|
|
||||||
|
# compute.disableInternetNetworkEndpointGroup:
|
||||||
|
# enforce: true
|
||||||
|
|
||||||
|
# compute.disableNestedVirtualization:
|
||||||
|
# enforce: true
|
||||||
|
|
||||||
|
# compute.disableSerialPortAccess:
|
||||||
|
# enforce: true
|
||||||
|
|
||||||
|
# compute.restrictCloudNATUsage:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictDedicatedInterconnectUsage:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictPartnerInterconnectUsage:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictProtocolForwardingCreationForTypes:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictSharedVpcHostProjects:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictSharedVpcSubnetworks:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictVpcPeering:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictVpnPeerIPs:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
||||||
|
|
||||||
|
# compute.restrictXpnProjectLienRemoval:
|
||||||
|
# enforce: true
|
||||||
|
|
||||||
|
# compute.setNewProjectDefaultToZonalDNSOnly:
|
||||||
|
# enforce: true
|
||||||
|
|
||||||
|
# compute.vmCanIpForward:
|
||||||
|
# deny:
|
||||||
|
# all: true
|
|
@ -0,0 +1,12 @@
|
||||||
|
# skip boilerplate check
|
||||||
|
#
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
|
|
||||||
|
iam.automaticIamGrantsForDefaultServiceAccounts:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
iam.disableServiceAccountKeyCreation:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
iam.disableServiceAccountKeyUpload:
|
||||||
|
enforce: true
|
|
@ -0,0 +1,26 @@
|
||||||
|
# skip boilerplate check
|
||||||
|
#
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
|
|
||||||
|
run.allowedIngress:
|
||||||
|
allow:
|
||||||
|
values:
|
||||||
|
- is:internal
|
||||||
|
|
||||||
|
# run.allowedVPCEgress:
|
||||||
|
# allow:
|
||||||
|
# values:
|
||||||
|
# - is:private-ranges-only
|
||||||
|
|
||||||
|
# cloudfunctions.allowedIngressSettings:
|
||||||
|
# allow:
|
||||||
|
# values:
|
||||||
|
# - is:ALLOW_INTERNAL_ONLY
|
||||||
|
|
||||||
|
# cloudfunctions.allowedVpcConnectorEgressSettings:
|
||||||
|
# allow:
|
||||||
|
# values:
|
||||||
|
# - is:PRIVATE_RANGES_ONLY
|
||||||
|
|
||||||
|
# cloudfunctions.requireVPCConnector:
|
||||||
|
# enforce: true
|
|
@ -0,0 +1,9 @@
|
||||||
|
# skip boilerplate check
|
||||||
|
#
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
|
|
||||||
|
sql.restrictAuthorizedNetworks:
|
||||||
|
enforce: true
|
||||||
|
|
||||||
|
sql.restrictPublicIp:
|
||||||
|
enforce: true
|
|
@ -0,0 +1,6 @@
|
||||||
|
# skip boilerplate check
|
||||||
|
#
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
|
|
||||||
|
storage.uniformBucketLevelAccess:
|
||||||
|
enforce: true
|
|
@ -66,44 +66,12 @@ module "organization" {
|
||||||
)
|
)
|
||||||
} : {}
|
} : {}
|
||||||
)
|
)
|
||||||
# sample subset of useful organization policies, edit to suit requirements
|
|
||||||
|
|
||||||
|
# sample subset of useful organization policies, edit to suit requirements
|
||||||
org_policies = {
|
org_policies = {
|
||||||
"compute.disableGuestAttributesAccess" = { enforce = true }
|
"iam.allowedPolicyMemberDomains" = { allow = { values = local.all_drs_domains } }
|
||||||
"compute.requireOsLogin" = { enforce = true }
|
|
||||||
"compute.restrictLoadBalancerCreationForTypes" = { allow = { values = ["in:INTERNAL"] } }
|
#"gcp.resourceLocations" = {
|
||||||
"compute.skipDefaultNetworkCreation" = { enforce = true }
|
|
||||||
"compute.vmExternalIpAccess" = { deny = { all = true } }
|
|
||||||
"iam.allowedPolicyMemberDomains" = { allow = { values = local.all_drs_domains } }
|
|
||||||
"iam.automaticIamGrantsForDefaultServiceAccounts" = { enforce = true }
|
|
||||||
"iam.disableServiceAccountKeyCreation" = { enforce = true }
|
|
||||||
"iam.disableServiceAccountKeyUpload" = { enforce = true }
|
|
||||||
"run.allowedIngress" = { allow = { values = ["is:internal"] } }
|
|
||||||
"sql.restrictAuthorizedNetworks" = { enforce = true }
|
|
||||||
"sql.restrictPublicIp" = { enforce = true }
|
|
||||||
"storage.uniformBucketLevelAccess" = { enforce = true }
|
|
||||||
# "cloudfunctions.allowedIngressSettings" = {
|
|
||||||
# allow = { values = ["is:ALLOW_INTERNAL_ONLY"] }
|
|
||||||
# }
|
|
||||||
# "cloudfunctions.allowedVpcConnectorEgressSettings" = {
|
|
||||||
# allow = { values = ["is:PRIVATE_RANGES_ONLY"] }
|
|
||||||
# }
|
|
||||||
# "cloudfunctions.requireVPCConnector" = { enforce = true }
|
|
||||||
# "compute.disableInternetNetworkEndpointGroup" = { enforce = true }
|
|
||||||
# "compute.disableNestedVirtualization" = { enforce = true }
|
|
||||||
# "compute.disableSerialPortAccess" = { enforce = true }
|
|
||||||
# "compute.restrictCloudNATUsage" = { deny = { all = true }}
|
|
||||||
# "compute.restrictDedicatedInterconnectUsage" = { deny = { all = true }}
|
|
||||||
# "compute.restrictPartnerInterconnectUsage" = { deny = { all = true }}
|
|
||||||
# "compute.restrictProtocolForwardingCreationForTypes" = { deny = { all = true }}
|
|
||||||
# "compute.restrictSharedVpcHostProjects" = { deny = { all = true }}
|
|
||||||
# "compute.restrictSharedVpcSubnetworks" = { deny = { all = true }}
|
|
||||||
# "compute.restrictVpcPeering" = { deny = { all = true }}
|
|
||||||
# "compute.restrictVpnPeerIPs" = { deny = { all = true }}
|
|
||||||
# "compute.restrictXpnProjectLienRemoval" = { enforce = true }
|
|
||||||
# "compute.setNewProjectDefaultToZonalDNSOnly" = { enforce = true }
|
|
||||||
# "compute.vmCanIpForward" = { deny = { all = true }}
|
|
||||||
# "gcp.resourceLocations" = {
|
|
||||||
# allow = { values = local.allowed_regions }
|
# allow = { values = local.allowed_regions }
|
||||||
# }
|
# }
|
||||||
# "iam.workloadIdentityPoolProviders" = {
|
# "iam.workloadIdentityPoolProviders" = {
|
||||||
|
@ -114,8 +82,9 @@ module "organization" {
|
||||||
# ]
|
# ]
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
# "run.allowedVPCEgress" = { allow = { values = ["is:private-ranges-only"] } }
|
|
||||||
}
|
}
|
||||||
|
org_policies_data_path = "${var.data_dir}/org-policies"
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
(var.tag_names.context) = {
|
(var.tag_names.context) = {
|
||||||
description = "Resource management context."
|
description = "Resource management context."
|
||||||
|
|
|
@ -135,6 +135,12 @@ variable "custom_roles" {
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "data_dir" {
|
||||||
|
description = "Relative path for the folder storing configuration data."
|
||||||
|
type = string
|
||||||
|
default = "data"
|
||||||
|
}
|
||||||
|
|
||||||
variable "fast_features" {
|
variable "fast_features" {
|
||||||
# tfdoc:variable:source 00-bootstrap
|
# tfdoc:variable:source 00-bootstrap
|
||||||
description = "Selective control for top-level FAST features."
|
description = "Selective control for top-level FAST features."
|
||||||
|
|
Loading…
Reference in New Issue