Skip to content

Lint Rules

The GCP lexicon ships lint rules that run during chant lint and post-synth checks that validate the serialized YAML after chant build.

Lint rules analyze your TypeScript source code before build.

RuleDescription
WGC001Hardcoded project ID in resource constructors
WGC002Hardcoded region in resource constructors
WGC003Public IAM member (allUsers/allAuthenticatedUsers)

Post-synth checks run against the serialized YAML after build.

RuleDescription
WGC101Missing encryption on StorageBucket or SQLInstance
WGC102Public IAM member detected in output
WGC104Missing uniform bucket-level access
WGC105Cloud SQL with public 0.0.0.0/0 in authorizedNetworks
WGC109ComputeFirewall allowing all sources (0.0.0.0/0)
WGC110KMS CryptoKey without rotation period
RuleDescription
WGC103Missing project annotation (uses namespace default)
WGC106Missing deletion policy annotation
WGC107StorageBucket without versioning
WGC108SQLInstance without backup configuration
WGC201Missing managed-by label
WGC202GKE cluster without workload identity
WGC203GKE node pool with overly broad cloud-platform OAuth scope
WGC204ComputeInstance without shielded VM config
RuleDescription
WGC301No IAMAuditConfig resource in output
WGC302No Service (API enablement) resource in output
WGC303No VPC Service Controls perimeter
Terminal window
# Lint your chant project
chant lint
# Build (also runs post-synth checks)
chant build

To suppress a rule on a specific line:

// chant-disable-next-line WGC001
const bucket = new StorageBucket({ metadata: { annotations: { "cnrm.cloud.google.com/project-id": "my-project" } } });