gcloud compute security-policies update NAME [--description=DESCRIPTION] [--enable-layer7-ddos-defense] [--json-custom-content-types=[CONTENT_TYPE,…]] [--json-parsing=JSON_PARSING] [--layer7-ddos-defense-rule-visibility=VISIBILITY_TYPE] [--log-level=LOG_LEVEL] [--network-ddos-protection=NETWORK_DDOS_PROTECTION] [--recaptcha-redirect-site-key=RECAPTCHA_REDIRECT_SITE_KEY] [--user-ip-request-headers=[USER_IP_REQUEST_HEADER,…]] [--global | --region=REGION] [GCLOUD_WIDE_FLAG …]
gcloud compute security-policies update is used to update security
policies.
gcloud compute security-policies update SECURITY_POLICY --description='new description'NAME--description=DESCRIPTION--enable-layer7-ddos-defense--json-custom-content-types=[CONTENT_TYPE,…]--json-parsing=STANDARD. When
configuring a Content-Type header value, only the type/subtype needs to be
specified, and the parameters should be excluded.
--json-parsing=JSON_PARSINGJSON_PARSING must be one of: DISABLED,
STANDARD, STANDARD_WITH_GRAPHQL.
--layer7-ddos-defense-rule-visibility=VISIBILITY_TYPEVISIBILITY_TYPE must be one of: STANDARD,
PREMIUM.
--log-level=LOG_LEVELLOG_LEVEL must be one of: NORMAL,
VERBOSE.
--network-ddos-protection=NETWORK_DDOS_PROTECTIONNETWORK_DDOS_PROTECTION must be one of:
STANDARD, ADVANCED, ADVANCED_PREVIEW.
--recaptcha-redirect-site-key=RECAPTCHA_REDIRECT_SITE_KEYredirect action and the
google-recaptcha redirect type under the
security policy.
--user-ip-request-headers=[USER_IP_REQUEST_HEADER,…]--global--region=REGIONcompute/region property value for this command invocation.
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha compute security-policies updategcloud beta compute security-policies updategcloud preview compute security-policies update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.