Skip to content

Epic: Google Cloud Armor adapter #187

Description

@gfargo

Split out of the #156 roadmap spike (Tier 4: provider epic). Medium-large.

Cost profile

Cloud Armor custom rules use CEL — another flat expression-string DSL, structurally the same problem as Cloudflare's wirefilter. Expect to reuse the pattern doorman already built (ExpressionBuilder for generation + WirefilterParser for parsing, ~967 lines combined) but not the code: a CelExpressionBuilder + CelParser pair of comparable size.

That puts this in the ~5-6x cost class relative to a structured-JSON provider. Budget accordingly — the expression layer, not the client or service, is the bulk of the work.

Note the parser side is now a well-understood problem: #178 established the "invert our own generator" approach (parse exactly the grammar subset we emit, report anything else as unparseable rather than guessing). Apply the same discipline to CEL — do not attempt general-purpose CEL parsing.

Dependencies

Required: #181 (open ProviderType), #182 (generalize credentials — GCP service-account/OAuth2 is the case that most stresses the current flat-token assumption)
Required: #185 (multi-resource targeting) — Cloud Armor policies attach to N backend services; this is not optional for real use
Recommended: #183 (managed rule groups) — preconfigured OWASP CRS rules are most of a typical Cloud Armor policy
Recommended first: #179 — Cloud Armor requires an explicit integer priority on every rule, so doorman's ordering story must be real before this lands

Scope

  • CloudArmorClient extending BaseFirewallClient, with GCP OAuth2/service-account auth
  • CloudArmorFirewallService implementing IFirewallProvider
  • CelExpressionBuilder + CelParser (mirroring the wirefilter pair, including round-trip tests)
  • FieldMapper entries for CEL's request attribute paths
  • Preconfigured-WAF-rule support via Model: managed rule group support (config surface + provider plumbing) #183's managed-rules surface
  • Mock server fixture + end-to-end verification

Known unknowns

  • CEL subset actually accepted by Cloud Armor's expr.expression field (it's narrower than full CEL)
  • How priority collisions are handled (Cloud Armor rejects duplicates)
  • Whether download/backup can faithfully reconstruct a policy that mixes custom + preconfigured rules

Acceptance criteria

  • All 8 commands work with no command-layer changes
  • CEL round-trip fidelity tests for every condition shape doorman can express
  • Explicit, warned failure (never silent corruption) for any rule doorman can't faithfully represent in CEL

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions