Configures managed rate limiting on cloud gateways: AWS WAFv2 rate-based rules, Google Cloud Armor policies, and Cloudflare rate limiting via API.
Agentic Workflow: Read -> Reason -> Act (api-rate-aws-waf)
You are Api Rate Aws Waf (security) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — security context for api-rate-aws-waf
- Domain: Configures managed rate limiting on cloud gateways: AWS WAFv2 rate-based rules, Google Cloud Armor policies, and Cloudflare rate limiting via API.
- aws-waf: Create rate-based WAF rules and ACLs —
aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action A
- cloudflare-rate: Manage Cloudflare rate limiting rules —
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits
- Check
knowledge and prerequisites: redis, node.js, python
2. Reason — think for api-rate-aws-waf
- For
aws-waf: Create rate-based WAF rules and ACLs — decide which checks to run
- For
cloudflare-rate: Manage Cloudflare rate limiting rules — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-rate-aws-waf tools
- Tools:
Glob, Grep, Read, Aws, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-rate-aws-waf:9aefe271
API Rate v3 - Cloud Gateways
Managed rate limiting at the edge.
What This Skill Does
- Applies rate-based blocking before traffic reaches the API
- Scales limits with provider infrastructure
- Centralizes visibility in provider metrics
When to Use
- Global DDoS and flood protection
- Per-IP throttling at the network edge
- Reducing origin load from abusive clients
Real Commands
aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-1
Rate Rule JSON
{
"Name": "block-floods",
"Priority": 1,
"Statement": {
"RateBasedStatement": { "Limit": 2000, "AggregateKeyType": "IP" }
},
"Action": { "Block": {} },
"VisibilityConfig": { "SampledRequestsEnabled": true, "CloudWatchMetricsEnabled": true, "MetricName": "block-floods" }
}
Testing
- Send bursts over the threshold and confirm 403/blocked
- Verify sampled requests appear in provider metrics
- Test allowlisted IPs bypass the rule
Best Practices
- Start in Count mode to observe, then enable Block
- Combine IP rate limits with session/header keys
- Keep provider limits above app-level limits
Capabilities
aws-waf
Create rate-based WAF rules and ACLs
Parameters:
rate-limit (integer): Requests per 5-minute window per IP
evaluation-window (string): Window size for the rate calculation
action (string): Block, Allow, or Count on breach
Commands:
aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-1
aws wafv2 list-web-acls --scope REGIONAL --region us-east-1 | jq '.WebACLs[].Name'
aws wafv2 get-web-acl --name api-rate-acl --scope REGIONAL --id $ACL_ID --region us-east-1 | jq '.WebACL.Rules[0].Statement'
aws wafv2 update-web-acl --name api-rate-acl --scope REGIONAL --id $ACL_ID --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-1
Examples:
- RateBasedStatement with Limit 2000 blocks floods per IP
- wafv2 list-web-acls enumerates managed rate ACLs
- Sampled requests surface in CloudWatch metrics
cloudflare-rate
Manage Cloudflare rate limiting rules
Commands:
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits" -H "Authorization: Bearer $CF_TOKEN" -H 'Content-Type: application/json' -d '{"threshold":100,"period":60,"match":{"request":{"url":"api.example.com/*"}},"action":{"mode":"block","timeout":300}}'
curl -s "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits" -H "Authorization: Bearer $CF_TOKEN" | jq '.result[0].threshold'
gcloud compute security-policies create api-armor --description "API rate limits" --project my-proj
gcloud compute security-policies rules create 1000 --security-policy api-armor --action deny-403 --rate-limit-threshold-count 200 --rate-limit-threshold-interval-sec 60 --project my-proj
Examples:
References
1---2name: "api-rate-aws-waf"3description: "Configures managed rate limiting on cloud gateways: AWS WAFv2 rate-based rules, Google Cloud Armor policies, and Cloudflare rate limiting via API. Use when working with aws waf, cloudflare rate or when the user mentions aws waf, cloudflare rate."4license: "MIT"5compatibility: "Requires redis, node.js, python, nginx, express-rate-limit. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-rate-aws-waf8 author: Kdesk9 version: 2.0.010 category: security11allowed-tools: "Glob Grep Read Bash(aws:*) Bash(curl:*) Bash(gcloud:*)"12---1314Configures managed rate limiting on cloud gateways: AWS WAFv2 rate-based rules, Google Cloud Armor policies, and Cloudflare rate limiting via API.1516## Agentic Workflow: Read -> Reason -> Act (api-rate-aws-waf)1718You are **Api Rate Aws Waf** (security) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — security context for `api-rate-aws-waf`21- Domain: Configures managed rate limiting on cloud gateways: AWS WAFv2 rate-based rules, Google Cloud Armor policies, and Cloudflare rate limiting via API.22- **aws-waf**: Create rate-based WAF rules and ACLs — `aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action A`23- **cloudflare-rate**: Manage Cloudflare rate limiting rules — `curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits`24- Check `knowledge` and `prerequisites: redis, node.js, python`2526### 2. Reason — think for `api-rate-aws-waf`27- For `aws-waf`: Create rate-based WAF rules and ACLs — decide which checks to run28- For `cloudflare-rate`: Manage Cloudflare rate limiting rules — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-rate-aws-waf` tools32- Tools: `Glob`, `Grep`, `Read`, `Aws`, `Bash` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-rate-aws-waf:9aefe271`3536# API Rate v3 - Cloud Gateways3738Managed rate limiting at the edge.3940## What This Skill Does41- Applies rate-based blocking before traffic reaches the API42- Scales limits with provider infrastructure43- Centralizes visibility in provider metrics4445## When to Use46- Global DDoS and flood protection47- Per-IP throttling at the network edge48- Reducing origin load from abusive clients4950## Real Commands5152```bash53aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-154```5556## Rate Rule JSON5758```json59{60 "Name": "block-floods",61 "Priority": 1,62 "Statement": {63 "RateBasedStatement": { "Limit": 2000, "AggregateKeyType": "IP" }64 },65 "Action": { "Block": {} },66 "VisibilityConfig": { "SampledRequestsEnabled": true, "CloudWatchMetricsEnabled": true, "MetricName": "block-floods" }67}68```6970## Testing71- Send bursts over the threshold and confirm 403/blocked72- Verify sampled requests appear in provider metrics73- Test allowlisted IPs bypass the rule7475## Best Practices76- Start in Count mode to observe, then enable Block77- Combine IP rate limits with session/header keys78- Keep provider limits above app-level limits7980## Capabilities8182### aws-waf83Create rate-based WAF rules and ACLs8485**Parameters:**86- `rate-limit` (integer): Requests per 5-minute window per IP87- `evaluation-window` (string): Window size for the rate calculation88- `action` (string): Block, Allow, or Count on breach8990**Commands:**91- `aws wafv2 create-web-acl --name api-rate-acl --scope REGIONAL --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-1`92- `aws wafv2 list-web-acls --scope REGIONAL --region us-east-1 | jq '.WebACLs[].Name'`93- `aws wafv2 get-web-acl --name api-rate-acl --scope REGIONAL --id $ACL_ID --region us-east-1 | jq '.WebACL.Rules[0].Statement'`94- `aws wafv2 update-web-acl --name api-rate-acl --scope REGIONAL --id $ACL_ID --default-action Allow={} --rules file://rate-rule.json --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=api-rate-acl --region us-east-1`9596**Examples:**97- RateBasedStatement with Limit 2000 blocks floods per IP98- wafv2 list-web-acls enumerates managed rate ACLs99- Sampled requests surface in CloudWatch metrics100101### cloudflare-rate102Manage Cloudflare rate limiting rules103104**Commands:**105- `curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits" -H "Authorization: Bearer $CF_TOKEN" -H 'Content-Type: application/json' -d '{"threshold":100,"period":60,"match":{"request":{"url":"api.example.com/*"}},"action":{"mode":"block","timeout":300}}'`106- `curl -s "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rate_limits" -H "Authorization: Bearer $CF_TOKEN" | jq '.result[0].threshold'`107- `gcloud compute security-policies create api-armor --description "API rate limits" --project my-proj`108- `gcloud compute security-policies rules create 1000 --security-policy api-armor --action deny-403 --rate-limit-threshold-count 200 --rate-limit-threshold-interval-sec 60 --project my-proj`109110**Examples:**111- -cli --help112- -api --help113114## References115- [AWS WAF Rate-based Rules](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-rate-based.html)116- [Cloudflare Rate Limiting API](https://developers.cloudflare.com/api/resources/rate_limits/)