Skip to content

Commit 204224e

Browse files
committed
tighten and document path regex
1 parent 467cdde commit 204224e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

infra/gcp/terraform/modules/oci-proxy/cloud-armor.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ resource "google_compute_security_policy" "cloud-armor" {
6969
priority = "1"
7070
match {
7171
expr {
72-
expression = "!request.path.matches('(?:^/$)|(?:^/privacy$)|(?:^/v2/)')"
72+
# allow:
73+
# our homepage info redirect: /
74+
# our privacy info redirect: /privacy
75+
# OCI ping: /v2
76+
# OCI pull / list calls: /v2/<name>/(blobs|manifests|tags)/<reference>
77+
# https://github.com/opencontainers/distribution-spec/blob/main/spec.md#endpoints
78+
# NOTE: AR doesn't support referrers API
79+
expression = "!request.path.matches('(?:^/?$)|(?:^/privacy$)|(?:^/v2/?$)|(?:^/v2/.+/(:?blobs|manifests|tags)/.+$)')"
7380
}
7481
}
7582
}

0 commit comments

Comments
 (0)