gcloud compute org-security-policies rules update PRIORITY --security-policy=SECURITY_POLICY [--action=ACTION] [--cloud-armor] [--description=DESCRIPTION] [--dest-ip-ranges=[DEST_IP_RANGE,…]] [--direction=DIRECTION] [--[no-]enable-logging] [--layer4-configs=[LAYER4_CONFIG,…]] [--new-priority=NEW_PRIORITY] [--organization=ORGANIZATION] [--[no-]preview] [--target-resources=[TARGET_RESOURCES,…]] [--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]] [--expression=EXPRESSION | --src-ip-ranges=[SRC_IP_RANGE,…]] [GCLOUD_WIDE_FLAG …]
gcloud compute org-security-policies rules update is used to update
organization security policy rules.
10 in an
organization security policy with ID
123456789 to change the action to
allow and description to
new-example-rule, run:
gcloud compute org-security-policies rules update 10 --security-policy=123456789 --action=allow --description=new-example-rulePRIORITY--security-policy=SECURITY_POLICY--action=ACTIONACTION must be one of:
allowdenydeny-403deny-404deny-502goto-nextredirect--cloud-armor--description=DESCRIPTION--dest-ip-ranges=[DEST_IP_RANGE,…]--direction=DIRECTIONDIRECTION must be one of:
INGRESS, EGRESS.
--[no-]enable-logging--enable-logging to enable and
--no-enable-logging to disable.
--layer4-configs=[LAYER4_CONFIG,…]--new-priority=NEW_PRIORITY--organization=ORGANIZATION--[no-]preview--preview to
enable and --no-preview to disable.
--target-resources=[TARGET_RESOURCES,…]--target-service-accounts=[TARGET_SERVICE_ACCOUNTS,…]--expression=EXPRESSION--src-ip-ranges=[SRC_IP_RANGE,…]--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 org-security-policies rules updategcloud beta compute org-security-policies rules updategcloud preview compute org-security-policies rules 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.