Skip to main content

AWS API Gateway

This plugin collects read-only metadata for AWS API Gateway custom domain names, evaluates CCF Rego policy bundles against each domain, and emits evidence back through the CCF agent.

This page is for operators who run the plugin-aws-apigateway plugin with the CCF Agent, and for developers who write policies for it. It documents v0.1.2 and is generated from the plugin's README at v0.1.2.

How it works​

How it fits in CCF​

The CCF agent starts this binary through HashiCorp go-plugin (runner protocol v2), passes configuration and policy paths over gRPC, and receives generated evidence through the runner callback. This repository does not call the CCF API directly.

During Init, the plugin registers the apigateway-domain subject template (identified by account_id, region and domain_name) and the subject and risk templates discovered from the supplied policy bundles.

Configuration​

KeyRequiredDescription
regionsyesComma-separated list of AWS regions to scan. Empty entries are ignored.
policy_labelsnoJSON object of extra labels added to every evidence, e.g. {"team":"platform"}.

AWS credentials come from the default AWS SDK credential chain. The account ID is read with sts:GetCallerIdentity in the first configured region.

Any agent-supplied policy_data is passed through to Rego as data.*, on top of the bundle's own data.json (agent-supplied keys win).

Evidence collected​

Data collected​

For every custom domain name returned by the API Gateway GetDomainNames API (all pages) in each configured region, the plugin builds this policy input:

FieldSource
regionthe region scanned
account_idthe caller's AWS account
domain_namethe custom domain name
security_policythe domain's TLS security policy
certificate_arnthe regional certificate ARN, or the edge-optimized one when there is no regional certificate (omitted when neither is set)
endpoint_typethe first endpoint type (e.g. REGIONAL, EDGE)
statusthe domain name status
tagsthe domain's tags

Each evidence carries the labels provider=aws, type=apigateway-domain, domain_name, region and account_id, plus any policy_labels.

Policy input​

One document per API Gateway custom domain name, in each configured region. The plugin builds it from GetDomainNames, and a policy reads it as input.

FieldTypeDescription
regionstringAWS region the domain is defined in.
account_idstringAWS account ID the plugin is running against.
domain_namestringThe custom domain name.
security_policystringThe domain's TLS security policy, for example TLS_1_2 or TLS_1_0.
certificate_arnstringARN of the certificate on the domain: the regional certificate when there is one, otherwise the edge-optimized one. Omitted when the domain has none.
endpoint_typestringFirst endpoint type of the domain: EDGE, REGIONAL or PRIVATE. Empty when none is set.
statusstringDomain name status, for example AVAILABLE, UPDATING or PENDING.
tagsobject (string to string)The domain's tags. An empty object when it has none.

An example input:

{
"region": "eu-west-1",
"account_id": "111122223333",
"domain_name": "api.example.com",
"security_policy": "TLS_1_2",
"certificate_arn": "arn:aws:acm:eu-west-1:111122223333:certificate/3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"endpoint_type": "REGIONAL",
"status": "AVAILABLE",
"tags": {
"Environment": "production"
}
}

Subject templates​

The subject templates this plugin registers. Each example is built from sample data.

apigateway-domain​

An API Gateway custom domain. The plugin registers it as a component subject and attaches it to the evidence of every domain it evaluates. Title: API Gateway Domain {{ .domain_name }}.

Identity keyDescription
account_idAWS account ID.
regionAWS region.
domain_nameAPI Gateway custom domain name.

Example:

{
"name": "apigateway-domain",
"type": "component",
"title": "API Gateway Domain api.example.com",
"description": "AWS API Gateway custom domain api.example.com in 111122223333/eu-west-1.",
"purpose": "Represents an AWS API Gateway custom domain evaluated for TLS compliance posture.",
"identityLabels": {
"account_id": "111122223333",
"region": "eu-west-1",
"domain_name": "api.example.com"
}
}

Policies​

The policy bundles that work with this plugin, at their newest releases. The controls are the ones the bundle's policies list in their metadata.

BundleLatest versionControls coveredCompatible plugin lines
plugin-aws-apigateway-policiesv0.1.1CC6.7latest

Default policy bundle mapping​

RepositoryPrimary input
plugin-aws-apigateway-policiesone API Gateway custom domain per evaluation