我创建了一个云盔甲安全策略,但它没有默认规则。我很困惑,因为文档与此相矛盾。
https://cloud.google.com/compute/docs/reference/rest/beta/securityPolicies
属于此策略的规则列表。必须始终存在默认规则(优先级为 2147483647 并匹配“*”的规则)。如果在创建安全策略时没有提供任何规则,则会添加一个带有“允许”操作的默认规则。
$ gcloud beta compute security-policies describe healthcheck
---
creationTimestamp: ''
description: ''
fingerprint: ...
id: '.....'
kind: compute#securityPolicy
labelFingerprint: .....
name: healthcheck
rules:
- action: deny(404)
description: Block requests to /health
kind: compute#securityPolicyRule
match:
expr:
expression: request.path.matches('/health')
preview: false
priority: 1000
selfLink: https://www.googleapis.com/compute/....
根据我的测试,默认行为似乎是Allow
. 这个默认规则是隐藏的还是我遗漏了什么?
该规则是使用 Terraform 创建的,但我认为这并不重要。