[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E4CEQHTVRNPEYK1AZBDF1X":3,"skill-same:01M7E4CEQHTVRNPEYK1AZBDF1X":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M7E4CEQHTVRNPEYK1AZBDF1X","implementing-cloud-waf-rules",null,"Deploys and tunes Web Application Firewall rules on AWS WAF, Azure WAF, and Cloudflare, covering managed rule sets, custom business-logic rules, rate limiting, bot management, and false-positive reduction. Use when deploying new apps behind a cloud WAF, when pentests reveal injection\u002FXSS flaws, when facing bot or credential-stuffing traffic, or when compliance (e.g. PCI-DSS) mandates a WAF.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-cloud-waf-rules\ndescription: 'Deploys and tunes Web Application Firewall rules on AWS WAF, Azure WAF,\n  and Cloudflare, covering managed rule sets, custom business-logic rules, rate limiting,\n  bot management, and false-positive reduction. Use when deploying new apps behind\n  a cloud WAF, when pentests reveal injection\u002FXSS flaws, when facing bot or credential-stuffing\n  traffic, or when compliance (e.g. PCI-DSS) mandates a WAF.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-waf\n- aws-waf\n- azure-waf\n- cloudflare-waf\n- owasp-protection\n- rate-limiting\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1078.004\n- T1530\n- T1537\n- T1580\n- T0816\n---\n\n# Implementing Cloud WAF Rules\n\n## When to Use\n\n- When deploying new web applications or APIs behind cloud load balancers requiring OWASP protection\n- When application penetration testing reveals SQL injection, XSS, or other injection vulnerabilities\n- When experiencing brute force, credential stuffing, or bot attacks against authentication endpoints\n- When compliance requirements mandate a WAF for PCI-DSS or similar standards\n- When tuning WAF rules to reduce false positives blocking legitimate application traffic\n\n**Do not use** for network-level DDoS protection (use AWS Shield or Azure DDoS Protection), for API authentication design (see managing-cloud-identity-with-okta), or for application code-level security fixes (WAF is a compensating control, not a replacement for secure code).\n\n## Prerequisites\n\n- AWS ALB\u002FCloudFront, Azure Application Gateway, or Cloudflare configured as the application entry point\n- Application traffic logs for baseline analysis before WAF deployment\n- Test environment for validating WAF rules before production enforcement\n- Understanding of application request patterns to minimize false positives\n\n## Workflow\n\n### Step 1: Deploy Managed Rule Sets\n\nEnable cloud provider managed rule sets that cover OWASP Top 10 vulnerabilities. Start in Count (detection) mode before switching to Block (prevention) mode.\n\n```bash\n# AWS WAF: Create Web ACL with AWS Managed Rules\naws wafv2 create-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --default-action '{\"Allow\": {}}' \\\n  --visibility-config '{\n    \"SampledRequestsEnabled\": true,\n    \"CloudWatchMetricsEnabled\": true,\n    \"MetricName\": \"production-waf\"\n  }' \\\n  --rules '[\n    {\n      \"Name\": \"AWSManagedRulesCommonRuleSet\",\n      \"Priority\": 1,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesCommonRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"CommonRuleSet\"\n      }\n    },\n    {\n      \"Name\": \"AWSManagedRulesSQLiRuleSet\",\n      \"Priority\": 2,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesSQLiRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"SQLiRuleSet\"\n      }\n    },\n    {\n      \"Name\": \"AWSManagedRulesKnownBadInputsRuleSet\",\n      \"Priority\": 3,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesKnownBadInputsRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"KnownBadInputs\"\n      }\n    }\n  ]'\n```\n\n### Step 2: Create Custom Rate Limiting Rules\n\nDeploy rate-based rules to protect login endpoints against brute force and credential stuffing attacks.\n\n```bash\n# Rate limiting rule for login endpoint (100 requests per 5 minutes per IP)\naws wafv2 update-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --id \u003Cweb-acl-id> \\\n  --lock-token \u003Clock-token> \\\n  --default-action '{\"Allow\": {}}' \\\n  --rules '[\n    {\n      \"Name\": \"RateLimitLogin\",\n      \"Priority\": 0,\n      \"Statement\": {\n        \"RateBasedStatement\": {\n          \"Limit\": 100,\n          \"AggregateKeyType\": \"IP\",\n          \"ScopeDownStatement\": {\n            \"ByteMatchStatement\": {\n              \"FieldToMatch\": {\"UriPath\": {}},\n              \"PositionalConstraint\": \"STARTS_WITH\",\n              \"SearchString\": \"\u002Fapi\u002Fauth\u002Flogin\",\n              \"TextTransformations\": [{\"Priority\": 0, \"Type\": \"LOWERCASE\"}]\n            }\n          }\n        }\n      },\n      \"Action\": {\"Block\": {\"CustomResponse\": {\"ResponseCode\": 429}}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"RateLimitLogin\"\n      }\n    }\n  ]'\n```\n\n### Step 3: Configure Geo-Blocking and IP Reputation\n\nBlock traffic from countries where the application has no legitimate users and leverage IP reputation lists to block known malicious sources.\n\n```bash\n# AWS WAF: Geo-blocking rule\n# Block countries not in the allowed list\naws wafv2 create-ip-set \\\n  --name blocked-ips \\\n  --scope REGIONAL \\\n  --ip-address-version IPV4 \\\n  --addresses \"198.51.100.0\u002F24\" \"203.0.113.0\u002F24\"\n\n# Add Amazon IP Reputation rule\n# AWSManagedRulesAmazonIpReputationList blocks IPs flagged by AWS threat intelligence\n```\n\n### Step 4: Tune Rules to Reduce False Positives\n\nAnalyze WAF logs in Count mode to identify legitimate requests being flagged. Create rule exceptions for specific URI paths or request patterns.\n\n```bash\n# Enable WAF logging to S3\naws wafv2 put-logging-configuration \\\n  --logging-configuration '{\n    \"ResourceArn\": \"arn:aws:wafv2:us-east-1:123456789012:regional\u002Fwebacl\u002Fproduction-waf\u002Fid\",\n    \"LogDestinationConfigs\": [\"arn:aws:s3:::waf-logs-bucket\"],\n    \"RedactedFields\": [{\"SingleHeader\": {\"Name\": \"authorization\"}}]\n  }'\n\n# Query WAF logs with Athena to find false positives\n# Find rules triggered most frequently for legitimate traffic\ncat \u003C\u003C 'EOF' > waf-analysis.sql\nSELECT\n  terminatingRuleId,\n  httpRequest.uri,\n  httpRequest.httpMethod,\n  COUNT(*) as block_count\nFROM waf_logs\nWHERE action = 'BLOCK'\n  AND timestamp > date_add('day', -7, now())\nGROUP BY terminatingRuleId, httpRequest.uri, httpRequest.httpMethod\nORDER BY block_count DESC\nLIMIT 20\nEOF\n```\n\n```bash\n# Exclude specific rule from managed rule set that causes false positives\n# Example: Exclude SizeRestrictions_BODY for file upload endpoint\naws wafv2 update-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --id \u003Cweb-acl-id> \\\n  --lock-token \u003Clock-token> \\\n  --rules '[{\n    \"Name\": \"AWSManagedRulesCommonRuleSet\",\n    \"Priority\": 1,\n    \"Statement\": {\n      \"ManagedRuleGroupStatement\": {\n        \"VendorName\": \"AWS\",\n        \"Name\": \"AWSManagedRulesCommonRuleSet\",\n        \"ExcludedRules\": [{\"Name\": \"SizeRestrictions_BODY\"}]\n      }\n    },\n    \"OverrideAction\": {\"None\": {}},\n    \"VisibilityConfig\": {\n      \"SampledRequestsEnabled\": true,\n      \"CloudWatchMetricsEnabled\": true,\n      \"MetricName\": \"CommonRuleSet\"\n    }\n  }]'\n```\n\n### Step 5: Switch to Block Mode After Validation\n\nAfter 7-14 days of Count mode with acceptable false positive rates, switch managed rules to Block mode for active protection.\n\n```bash\n# Change OverrideAction from Count to None (use rule group's default Block action)\n# Update each managed rule group from {\"Count\": {}} to {\"None\": {}}\n# Monitor CloudWatch metrics for sudden changes in blocked request volume\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Web ACL | Web Access Control List defining the set of rules evaluated against every HTTP request to a protected resource |\n| Managed Rule Group | Pre-configured rule set maintained by the cloud provider or third-party vendor covering common attack patterns |\n| Rate-Based Rule | WAF rule that tracks request rates per IP address and blocks IPs exceeding the threshold within a time window |\n| Count Mode | WAF action that logs matching requests without blocking them, used for rule validation before enforcement |\n| Rule Priority | Numerical ordering determining which rules are evaluated first; lower numbers have higher priority |\n| Custom Response | WAF capability to return specific HTTP status codes and headers when blocking requests |\n| Scope-Down Statement | Condition that narrows a rate-based rule to specific URI paths, methods, or headers |\n| False Positive | Legitimate request incorrectly blocked by a WAF rule, requiring rule tuning or exclusion |\n\n## Tools & Systems\n\n- **AWS WAF**: Cloud-native WAF integrated with ALB, CloudFront, API Gateway, and AppSync\n- **Azure WAF**: Web application firewall on Application Gateway or Front Door with OWASP CRS rule sets\n- **AWS Firewall Manager**: Centralized WAF policy management across multiple AWS accounts in an Organization\n- **WAF Security Automations**: AWS solution that deploys Lambda-based automated WAF rule updates based on log analysis\n- **CloudWatch Metrics**: Monitoring dashboard for tracking WAF rule match rates, block counts, and allowed requests\n\n## Common Scenarios\n\n### Scenario: Credential Stuffing Attack Against Authentication API\n\n**Context**: An e-commerce application experiences 50,000 login attempts per hour from a botnet using stolen credential lists. The attacker rotates source IPs every few minutes to evade simple IP-based blocking.\n\n**Approach**:\n1. Deploy rate-based rules limiting login endpoint requests to 10 per 5 minutes per IP\n2. Enable AWS WAF Bot Control managed rule group to detect automated request patterns beyond IP rotation\n3. Add a custom rule requiring valid CAPTCHA tokens for login requests exceeding 5 failures\n4. Implement IP reputation blocking using AWSManagedRulesAmazonIpReputationList\n5. Create a custom rule matching on User-Agent patterns common to credential stuffing tools\n6. Monitor blocked request metrics and adjust thresholds based on legitimate traffic patterns\n\n**Pitfalls**: Setting rate limits too aggressively blocks legitimate users behind shared NAT IPs. Blocking by User-Agent alone is easily bypassed by rotating agent strings.\n\n## Output Format\n\n```text\nCloud WAF Configuration Report\n================================\nWeb ACL: production-waf\nScope: Regional (us-east-1)\nProtected Resources: ALB (arn:aws:elasticloadbalancing:...)\nReport Date: 2025-02-23\n\nRULE CONFIGURATION:\n  [P0] RateLimitLogin          - BLOCK (100 req\u002F5min\u002FIP)\n  [P1] AWSManagedRulesCommon   - BLOCK (1 exclusion: SizeRestrictions_BODY)\n  [P2] AWSManagedRulesSQLi     - BLOCK\n  [P3] AWSManagedRulesKnownBad - BLOCK\n  [P4] AWSManagedRulesBotControl - COUNT (evaluation phase)\n  [P5] GeoBlockRule            - BLOCK (12 countries blocked)\n\nTRAFFIC ANALYSIS (Last 7 Days):\n  Total Requests:    2,847,293\n  Allowed:           2,791,456 (98.0%)\n  Blocked:              51,234 (1.8%)\n  Counted:               4,603 (0.2%)\n\nTOP BLOCKED RULES:\n  RateLimitLogin:              23,456 blocks (45.8%)\n  SQLi Detection:               8,234 blocks (16.1%)\n  CommonRuleSet (XSS):          7,891 blocks (15.4%)\n  GeoBlockRule:                 6,543 blocks (12.8%)\n  KnownBadInputs:              5,110 blocks (10.0%)\n\nFALSE POSITIVE ANALYSIS:\n  Reported False Positives: 3\n  Confirmed False Positives: 1 (SizeRestrictions_BODY for \u002Fapi\u002Fupload)\n  Action Taken: Rule exclusion applied\n```\n","# Implementing Cloud WAF Rules\n\n## When to Use\n\n- When deploying new web applications or APIs behind cloud load balancers requiring OWASP protection\n- When application penetration testing reveals SQL injection, XSS, or other injection vulnerabilities\n- When experiencing brute force, credential stuffing, or bot attacks against authentication endpoints\n- When compliance requirements mandate a WAF for PCI-DSS or similar standards\n- When tuning WAF rules to reduce false positives blocking legitimate application traffic\n\n**Do not use** for network-level DDoS protection (use AWS Shield or Azure DDoS Protection), for API authentication design (see managing-cloud-identity-with-okta), or for application code-level security fixes (WAF is a compensating control, not a replacement for secure code).\n\n## Prerequisites\n\n- AWS ALB\u002FCloudFront, Azure Application Gateway, or Cloudflare configured as the application entry point\n- Application traffic logs for baseline analysis before WAF deployment\n- Test environment for validating WAF rules before production enforcement\n- Understanding of application request patterns to minimize false positives\n\n## Workflow\n\n### Step 1: Deploy Managed Rule Sets\n\nEnable cloud provider managed rule sets that cover OWASP Top 10 vulnerabilities. Start in Count (detection) mode before switching to Block (prevention) mode.\n\n```bash\n# AWS WAF: Create Web ACL with AWS Managed Rules\naws wafv2 create-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --default-action '{\"Allow\": {}}' \\\n  --visibility-config '{\n    \"SampledRequestsEnabled\": true,\n    \"CloudWatchMetricsEnabled\": true,\n    \"MetricName\": \"production-waf\"\n  }' \\\n  --rules '[\n    {\n      \"Name\": \"AWSManagedRulesCommonRuleSet\",\n      \"Priority\": 1,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesCommonRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"CommonRuleSet\"\n      }\n    },\n    {\n      \"Name\": \"AWSManagedRulesSQLiRuleSet\",\n      \"Priority\": 2,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesSQLiRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"SQLiRuleSet\"\n      }\n    },\n    {\n      \"Name\": \"AWSManagedRulesKnownBadInputsRuleSet\",\n      \"Priority\": 3,\n      \"Statement\": {\n        \"ManagedRuleGroupStatement\": {\n          \"VendorName\": \"AWS\",\n          \"Name\": \"AWSManagedRulesKnownBadInputsRuleSet\"\n        }\n      },\n      \"OverrideAction\": {\"Count\": {}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"KnownBadInputs\"\n      }\n    }\n  ]'\n```\n\n### Step 2: Create Custom Rate Limiting Rules\n\nDeploy rate-based rules to protect login endpoints against brute force and credential stuffing attacks.\n\n```bash\n# Rate limiting rule for login endpoint (100 requests per 5 minutes per IP)\naws wafv2 update-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --id \u003Cweb-acl-id> \\\n  --lock-token \u003Clock-token> \\\n  --default-action '{\"Allow\": {}}' \\\n  --rules '[\n    {\n      \"Name\": \"RateLimitLogin\",\n      \"Priority\": 0,\n      \"Statement\": {\n        \"RateBasedStatement\": {\n          \"Limit\": 100,\n          \"AggregateKeyType\": \"IP\",\n          \"ScopeDownStatement\": {\n            \"ByteMatchStatement\": {\n              \"FieldToMatch\": {\"UriPath\": {}},\n              \"PositionalConstraint\": \"STARTS_WITH\",\n              \"SearchString\": \"\u002Fapi\u002Fauth\u002Flogin\",\n              \"TextTransformations\": [{\"Priority\": 0, \"Type\": \"LOWERCASE\"}]\n            }\n          }\n        }\n      },\n      \"Action\": {\"Block\": {\"CustomResponse\": {\"ResponseCode\": 429}}},\n      \"VisibilityConfig\": {\n        \"SampledRequestsEnabled\": true,\n        \"CloudWatchMetricsEnabled\": true,\n        \"MetricName\": \"RateLimitLogin\"\n      }\n    }\n  ]'\n```\n\n### Step 3: Configure Geo-Blocking and IP Reputation\n\nBlock traffic from countries where the application has no legitimate users and leverage IP reputation lists to block known malicious sources.\n\n```bash\n# AWS WAF: Geo-blocking rule\n# Block countries not in the allowed list\naws wafv2 create-ip-set \\\n  --name blocked-ips \\\n  --scope REGIONAL \\\n  --ip-address-version IPV4 \\\n  --addresses \"198.51.100.0\u002F24\" \"203.0.113.0\u002F24\"\n\n# Add Amazon IP Reputation rule\n# AWSManagedRulesAmazonIpReputationList blocks IPs flagged by AWS threat intelligence\n```\n\n### Step 4: Tune Rules to Reduce False Positives\n\nAnalyze WAF logs in Count mode to identify legitimate requests being flagged. Create rule exceptions for specific URI paths or request patterns.\n\n```bash\n# Enable WAF logging to S3\naws wafv2 put-logging-configuration \\\n  --logging-configuration '{\n    \"ResourceArn\": \"arn:aws:wafv2:us-east-1:123456789012:regional\u002Fwebacl\u002Fproduction-waf\u002Fid\",\n    \"LogDestinationConfigs\": [\"arn:aws:s3:::waf-logs-bucket\"],\n    \"RedactedFields\": [{\"SingleHeader\": {\"Name\": \"authorization\"}}]\n  }'\n\n# Query WAF logs with Athena to find false positives\n# Find rules triggered most frequently for legitimate traffic\ncat \u003C\u003C 'EOF' > waf-analysis.sql\nSELECT\n  terminatingRuleId,\n  httpRequest.uri,\n  httpRequest.httpMethod,\n  COUNT(*) as block_count\nFROM waf_logs\nWHERE action = 'BLOCK'\n  AND timestamp > date_add('day', -7, now())\nGROUP BY terminatingRuleId, httpRequest.uri, httpRequest.httpMethod\nORDER BY block_count DESC\nLIMIT 20\nEOF\n```\n\n```bash\n# Exclude specific rule from managed rule set that causes false positives\n# Example: Exclude SizeRestrictions_BODY for file upload endpoint\naws wafv2 update-web-acl \\\n  --name production-waf \\\n  --scope REGIONAL \\\n  --id \u003Cweb-acl-id> \\\n  --lock-token \u003Clock-token> \\\n  --rules '[{\n    \"Name\": \"AWSManagedRulesCommonRuleSet\",\n    \"Priority\": 1,\n    \"Statement\": {\n      \"ManagedRuleGroupStatement\": {\n        \"VendorName\": \"AWS\",\n        \"Name\": \"AWSManagedRulesCommonRuleSet\",\n        \"ExcludedRules\": [{\"Name\": \"SizeRestrictions_BODY\"}]\n      }\n    },\n    \"OverrideAction\": {\"None\": {}},\n    \"VisibilityConfig\": {\n      \"SampledRequestsEnabled\": true,\n      \"CloudWatchMetricsEnabled\": true,\n      \"MetricName\": \"CommonRuleSet\"\n    }\n  }]'\n```\n\n### Step 5: Switch to Block Mode After Validation\n\nAfter 7-14 days of Count mode with acceptable false positive rates, switch managed rules to Block mode for active protection.\n\n```bash\n# Change OverrideAction from Count to None (use rule group's default Block action)\n# Update each managed rule group from {\"Count\": {}} to {\"None\": {}}\n# Monitor CloudWatch metrics for sudden changes in blocked request volume\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Web ACL | Web Access Control List defining the set of rules evaluated against every HTTP request to a protected resource |\n| Managed Rule Group | Pre-configured rule set maintained by the cloud provider or third-party vendor covering common attack patterns |\n| Rate-Based Rule | WAF rule that tracks request rates per IP address and blocks IPs exceeding the threshold within a time window |\n| Count Mode | WAF action that logs matching requests without blocking them, used for rule validation before enforcement |\n| Rule Priority | Numerical ordering determining which rules are evaluated first; lower numbers have higher priority |\n| Custom Response | WAF capability to return specific HTTP status codes and headers when blocking requests |\n| Scope-Down Statement | Condition that narrows a rate-based rule to specific URI paths, methods, or headers |\n| False Positive | Legitimate request incorrectly blocked by a WAF rule, requiring rule tuning or exclusion |\n\n## Tools & Systems\n\n- **AWS WAF**: Cloud-native WAF integrated with ALB, CloudFront, API Gateway, and AppSync\n- **Azure WAF**: Web application firewall on Application Gateway or Front Door with OWASP CRS rule sets\n- **AWS Firewall Manager**: Centralized WAF policy management across multiple AWS accounts in an Organization\n- **WAF Security Automations**: AWS solution that deploys Lambda-based automated WAF rule updates based on log analysis\n- **CloudWatch Metrics**: Monitoring dashboard for tracking WAF rule match rates, block counts, and allowed requests\n\n## Common Scenarios\n\n### Scenario: Credential Stuffing Attack Against Authentication API\n\n**Context**: An e-commerce application experiences 50,000 login attempts per hour from a botnet using stolen credential lists. The attacker rotates source IPs every few minutes to evade simple IP-based blocking.\n\n**Approach**:\n1. Deploy rate-based rules limiting login endpoint requests to 10 per 5 minutes per IP\n2. Enable AWS WAF Bot Control managed rule group to detect automated request patterns beyond IP rotation\n3. Add a custom rule requiring valid CAPTCHA tokens for login requests exceeding 5 failures\n4. Implement IP reputation blocking using AWSManagedRulesAmazonIpReputationList\n5. Create a custom rule matching on User-Agent patterns common to credential stuffing tools\n6. Monitor blocked request metrics and adjust thresholds based on legitimate traffic patterns\n\n**Pitfalls**: Setting rate limits too aggressively blocks legitimate users behind shared NAT IPs. Blocking by User-Agent alone is easily bypassed by rotating agent strings.\n\n## Output Format\n\n```text\nCloud WAF Configuration Report\n================================\nWeb ACL: production-waf\nScope: Regional (us-east-1)\nProtected Resources: ALB (arn:aws:elasticloadbalancing:...)\nReport Date: 2025-02-23\n\nRULE CONFIGURATION:\n  [P0] RateLimitLogin          - BLOCK (100 req\u002F5min\u002FIP)\n  [P1] AWSManagedRulesCommon   - BLOCK (1 exclusion: SizeRestrictions_BODY)\n  [P2] AWSManagedRulesSQLi     - BLOCK\n  [P3] AWSManagedRulesKnownBad - BLOCK\n  [P4] AWSManagedRulesBotControl - COUNT (evaluation phase)\n  [P5] GeoBlockRule            - BLOCK (12 countries blocked)\n\nTRAFFIC ANALYSIS (Last 7 Days):\n  Total Requests:    2,847,293\n  Allowed:           2,791,456 (98.0%)\n  Blocked:              51,234 (1.8%)\n  Counted:               4,603 (0.2%)\n\nTOP BLOCKED RULES:\n  RateLimitLogin:              23,456 blocks (45.8%)\n  SQLi Detection:               8,234 blocks (16.1%)\n  CommonRuleSet (XSS):          7,891 blocks (15.4%)\n  GeoBlockRule:                 6,543 blocks (12.8%)\n  KnownBadInputs:              5,110 blocks (10.0%)\n\nFALSE POSITIVE ANALYSIS:\n  Reported False Positives: 3\n  Confirmed False Positives: 1 (SizeRestrictions_BODY for \u002Fapi\u002Fupload)\n  Action Taken: Rule exclusion applied\n```\n",{"name":5,"tags":25,"author":32,"domain":33,"license":15,"version":34,"nist_csf":35,"subdomain":40,"description":41,"mitre_attack":42},[26,27,28,29,30,31],"cloud-waf","aws-waf","azure-waf","cloudflare-waf","owasp-protection","rate-limiting","mahipal","cybersecurity","1.0.0",[36,37,38,39],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","cloud-security","Deploys and tunes Web Application Firewall rules on AWS WAF, Azure WAF, and Cloudflare, covering managed rule sets, custom business-logic rules, rate limiting, bot management, and false-positive reduction. Use when deploying new apps behind a cloud WAF, when pentests reveal injection\u002FXSS flaws, when facing bot or credential-stuffing traffic, or when compliance (e.g. PCI-DSS) mandates a WAF.\n",[43,44,45,46,47],"T1078.004","T1530","T1537","T1580","T0816","main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","collections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-waf-rules",{"tool":62,"command":63},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-waf-rules",{"tool":65,"command":66},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-waf-rules","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FSKILL.md",true,[70,74,80],{"path":71,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fapi-reference.md","REFERENCE","参考文档",2347,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002Freferences\u002Fapi-reference.md",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fagent.py","SCRIPT","脚本",8429,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002Fscripts\u002Fagent.py",[87,95,103,111,119,126],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":20},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":99,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":20},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":20},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":130,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":20},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]