[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GY9J4EE8KAXFR73BQ29T3Z":3,"skill-same:01M6GY9J4EE8KAXFR73BQ29T3Z":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M6GY9J4EE8KAXFR73BQ29T3Z","implementing-cloud-waf-rules",null,"This skill covers deploying and tuning Web Application Firewall rules on AWS WAF, Azure WAF, and Cloudflare to protect cloud-hosted applications against OWASP Top 10 attacks. It details configuring managed rule sets, creating custom rules for business logic protection, implementing rate limiting, deploying bot management, and reducing false positives through rule tuning and logging analysis.","micsapp\u002Fmicstec-skills","micsapp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F82411001?v=4","01M6GWCFQ6D3PV8EHNY62NN5VW","01M6GWCFVE1PA5HG0DKC7AMFJ3",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"Rules","cloud","waf","implementing cloud waf rules","firewall","top","attacks","false","bot management","analysis","tuning","aws-waf","bot","owasp","cloud-security","logging","cloudflare","owasp top 10","cybersecurity","security","2026-11-10 10:12:30",false,"---\nname: implementing-cloud-waf-rules\ndescription: >\n  This skill covers deploying and tuning Web Application Firewall rules on AWS WAF,\n  Azure WAF, and Cloudflare to protect cloud-hosted applications against OWASP Top 10\n  attacks. It details configuring managed rule sets, creating custom rules for business\n  logic protection, implementing rate limiting, deploying bot management, and reducing\n  false positives through rule tuning and logging analysis.\ndomain: cybersecurity\nsubdomain: cloud-security\ntags: [cloud-waf, aws-waf, azure-waf, cloudflare-waf, owasp-protection, rate-limiting]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\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":43,"author":49,"domain":36,"license":14,"version":50,"subdomain":32,"description":51},[44,29,45,46,47,48],"cloud-waf","azure-waf","cloudflare-waf","owasp-protection","rate-limiting","mahipal","1.0.0","This skill covers deploying and tuning Web Application Firewall rules on AWS WAF, Azure WAF, and Cloudflare to protect cloud-hosted applications against OWASP Top 10 attacks. It details configuring managed rule sets, creating custom rules for business logic protection, implementing rate limiting, deploying bot management, and reducing false positives through rule tuning and logging analysis.\n","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules",0,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills","https:\u002F\u002Fgithub.com\u002Fmicsapp","2026-03-20 11:24:18",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add micsapp\u002Fmicstec-skills --skill implementing-cloud-waf-rules",{"tool":65,"command":66},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill implementing-cloud-waf-rules",{"tool":68,"command":69},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill implementing-cloud-waf-rules","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FSKILL.md",true,[73,78,84],{"path":74,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002FLICENSE",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",2347,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",8429,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-waf-rules\u002Fscripts\u002Fagent.py",[91,119,141,160,176,201],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":38},"01M6HBTJ02FXBFG9NYEHHYAP52","azure-apim-architecture","Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.","MIT","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fazure-apim-architecture\u002FSKILL.md",[],[99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118],"architecture","azure","azure apim architecture","component","authentication","gateway","topology","Optimization","network","api","team","environment","multi-environment","workspaces","instances","selection","strategies","azure api management","mode","for",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":38},"01M6HBT7J4H082JEEA670B3EQ9","apiops-deployment","Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep\u002FTerraform), CI\u002FCD pipelines (GitHub Actions\u002FAzure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapiops-deployment\u002FSKILL.md",[],[126,127,128,129,100,130,131,132,133,134,135,136,108,109,115,137,138,116,139,140],"deployment","apiops deployment","workflows","azure devops","infrastructure","code","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":38},"01M6HBT2HEA23THNE9E00GYQBE","apim-policy-authoring","Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request\u002Fresponse processing logic.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapim-policy-authoring\u002FSKILL.md",[],[148,149,150,37,100,103,108,109,151,152,153,154,155,156,157,116,158,159,140,118],"policy","authoring","apim policy authoring","access","use","ready","api security","Access Control","error","processing","cors configuration","production-ready",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":38},"01M6HBSY65SB29J9WE9KYD0K6T","api-security-review","Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapi-security-review\u002FSKILL.md",[],[167,37,168,108,154,169,100,126,170,171,31,172,109,173,116,174,175,23,117,118],"review","security review","api security review","benchmark","verification","owasp-api","alignment","azure security","reviews",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":38},"01M6HBSRW4PDFE6K4F8JYPZQ05","jira-cli","Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fjira-cli\u002FSKILL.md",[],[183,184,185,128,186,187,188,189,108,190,191,192,193,194,195,196,197,198,199,200],"cli","jira","jira cli","init","tasks","create","issues","common","work","command","edit","list","view","project","project work","token","line","sprints",{"skillNo":202,"name":203,"nameZh":6,"description":204,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":205,"categories":206,"keywords":207,"publishedAt":38},"01M6HBSNS3JHMW603G47TWE31H","calculator","Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fcalculator\u002FSKILL.md",[],[203,208,209,210,211,212,213,152,214,215],"npm","js","calculate","node","math","user","compute","errors"]