[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B6YZKX0DZRT86WMPABHNJQ":3,"skill-same:01M7B6YZKX0DZRT86WMPABHNJQ":81},{"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":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":13,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M7B6YZKX0DZRT86WMPABHNJQ","implementing-api-gateway-security-controls",null,"Configures API gateways such as Kong, AWS API Gateway, Azure APIM, or Apigee as a centralized security enforcement point, covering authentication enforcement, rate limiting and throttling, request validation, IP allowlisting, TLS termination, and threat protection. Use when securing API traffic at the gateway layer, setting up gateway-level authentication and quota management, or centralizing API protection before requests reach backend services.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-api-gateway-security-controls\ndescription: 'Configures API gateways such as Kong, AWS API Gateway, Azure APIM,\n  or Apigee as a centralized security enforcement point, covering authentication\n  enforcement, rate limiting and throttling, request validation, IP allowlisting,\n  TLS termination, and threat protection. Use when securing API traffic at the gateway\n  layer, setting up gateway-level authentication and quota management, or centralizing\n  API protection before requests reach backend services.'\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- api-gateway\n- kong\n- aws-api-gateway\n- rate-limiting\n- waf\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1552.001\n- T1078.004\n- T1530\n---\n# Implementing API Gateway Security Controls\n\n## When to Use\n\n- Deploying a centralized authentication and authorization layer for microservice APIs\n- Implementing rate limiting, throttling, and quota management across all API endpoints\n- Configuring request\u002Fresponse validation against OpenAPI specifications at the gateway level\n- Setting up TLS termination, mutual TLS, and certificate management for API traffic\n- Integrating WAF rules with the API gateway to block injection, XSS, and known attack patterns\n\n**Do not use** as the sole security layer. API gateways provide defense in depth but backend services must also validate authorization and input.\n\n## Prerequisites\n\n- API gateway platform selected and deployed (Kong, AWS API Gateway, Azure APIM, or Apigee)\n- OpenAPI\u002FSwagger specifications for all backend APIs\n- TLS certificates for the gateway domain\n- Identity provider (IdP) configured for OAuth2\u002FOIDC (Okta, Auth0, Azure AD)\n- Monitoring and logging infrastructure (CloudWatch, Datadog, ELK)\n- Backend service endpoints registered and reachable from the gateway\n\n## Workflow\n\n### Step 1: Kong Gateway Security Configuration\n\n```yaml\n# kong.yml - Declarative Kong configuration with security plugins\n_format_version: \"3.0\"\n\nservices:\n  - name: user-service\n    url: http:\u002F\u002Fuser-service:8080\n    routes:\n      - name: user-api\n        paths:\n          - \u002Fapi\u002Fv1\u002Fusers\n        methods:\n          - GET\n          - POST\n          - PUT\n          - PATCH\n          - DELETE\n        strip_path: false\n\nplugins:\n  # 1. Authentication: JWT validation\n  - name: jwt\n    config:\n      uri_param_names:\n        - jwt\n      header_names:\n        - Authorization\n      claims_to_verify:\n        - exp\n      maximum_expiration: 3600  # Max 1 hour token TTL\n\n  # 2. Rate Limiting\n  - name: rate-limiting\n    config:\n      minute: 60\n      hour: 1000\n      policy: redis\n      redis_host: redis\n      redis_port: 6379\n      fault_tolerant: true\n      hide_client_headers: false\n      limit_by: credential  # Per-user, not per-IP\n\n  # 3. Request Size Limiting\n  - name: request-size-limiting\n    config:\n      allowed_payload_size: 1  # 1 MB max\n      size_unit: megabytes\n\n  # 4. IP Restriction (admin endpoints)\n  - name: ip-restriction\n    service: admin-service\n    config:\n      allow:\n        - 10.0.0.0\u002F8\n        - 172.16.0.0\u002F12\n\n  # 5. Bot Detection\n  - name: bot-detection\n    config:\n      deny:\n        - \"sqlmap\"\n        - \"nikto\"\n        - \"nmap\"\n        - \"masscan\"\n\n  # 6. CORS Configuration\n  - name: cors\n    config:\n      origins:\n        - \"https:\u002F\u002Fapp.example.com\"\n      methods:\n        - GET\n        - POST\n        - PUT\n        - PATCH\n        - DELETE\n      headers:\n        - Authorization\n        - Content-Type\n      credentials: true\n      max_age: 3600\n\n  # 7. Response Transformer - Remove sensitive headers\n  - name: response-transformer\n    config:\n      remove:\n        headers:\n          - X-Powered-By\n          - Server\n      add:\n        headers:\n          - \"X-Content-Type-Options: nosniff\"\n          - \"X-Frame-Options: DENY\"\n          - \"Strict-Transport-Security: max-age=31536000; includeSubDomains\"\n          - \"Content-Security-Policy: default-src 'none'\"\n```\n\n### Step 2: AWS API Gateway Security Configuration\n\n```python\nimport boto3\nimport json\n\napigw = boto3.client('apigatewayv2')\n\n# Create API with mutual TLS\napi_response = apigw.create_api(\n    Name='secure-api',\n    ProtocolType='HTTP',\n    DisableExecuteApiEndpoint=True,  # Force custom domain\n)\napi_id = api_response['ApiId']\n\n# Configure authorizer (JWT with Cognito)\nauthorizer = apigw.create_authorizer(\n    ApiId=api_id,\n    AuthorizerType='JWT',\n    IdentitySource='$request.header.Authorization',\n    Name='cognito-jwt-authorizer',\n    JwtConfiguration={\n        'Audience': ['your-app-client-id'],\n        'Issuer': 'https:\u002F\u002Fcognito-idp.us-east-1.amazonaws.com\u002Fus-east-1_xxxxx'\n    }\n)\n\n# Create route with authorizer\napigw.create_route(\n    ApiId=api_id,\n    RouteKey='GET \u002Fapi\u002Fv1\u002Fusers',\n    AuthorizerId=authorizer['AuthorizerId'],\n    AuthorizationType='JWT',\n)\n\n# Configure throttling\napigw.create_stage(\n    ApiId=api_id,\n    StageName='prod',\n    DefaultRouteSettings={\n        'ThrottlingBurstLimit': 100,\n        'ThrottlingRateLimit': 50.0,  # 50 requests per second\n    },\n    AccessLogSettings={\n        'DestinationArn': 'arn:aws:logs:us-east-1:123456789:log-group:api-access-logs',\n        'Format': json.dumps({\n            'requestId': '$context.requestId',\n            'ip': '$context.identity.sourceIp',\n            'caller': '$context.identity.caller',\n            'user': '$context.identity.user',\n            'requestTime': '$context.requestTime',\n            'httpMethod': '$context.httpMethod',\n            'resourcePath': '$context.resourcePath',\n            'status': '$context.status',\n            'protocol': '$context.protocol',\n            'responseLength': '$context.responseLength'\n        })\n    }\n)\n\n# WAF association\nwaf = boto3.client('wafv2')\nweb_acl = waf.create_web_acl(\n    Name='api-security-acl',\n    Scope='REGIONAL',\n    DefaultAction={'Allow': {}},\n    Rules=[\n        {\n            'Name': 'AWS-AWSManagedRulesSQLiRuleSet',\n            'Priority': 1,\n            'Statement': {\n                'ManagedRuleGroupStatement': {\n                    'VendorName': 'AWS',\n                    'Name': 'AWSManagedRulesSQLiRuleSet'\n                }\n            },\n            'OverrideAction': {'None': {}},\n            'VisibilityConfig': {\n                'SampledRequestsEnabled': True,\n                'CloudWatchMetricsEnabled': True,\n                'MetricName': 'SQLiRuleSet'\n            }\n        },\n        {\n            'Name': 'RateLimit',\n            'Priority': 2,\n            'Statement': {\n                'RateBasedStatement': {\n                    'Limit': 2000,\n                    'AggregateKeyType': 'IP'\n                }\n            },\n            'Action': {'Block': {}},\n            'VisibilityConfig': {\n                'SampledRequestsEnabled': True,\n                'CloudWatchMetricsEnabled': True,\n                'MetricName': 'RateLimitRule'\n            }\n        },\n    ],\n    VisibilityConfig={\n        'SampledRequestsEnabled': True,\n        'CloudWatchMetricsEnabled': True,\n        'MetricName': 'ApiSecurityACL'\n    }\n)\n```\n\n### Step 3: Request Validation with OpenAPI Schema\n\n```yaml\n# Kong OAS Validation Plugin configuration\nplugins:\n  - name: oas-validation\n    config:\n      api_spec: |\n        openapi: \"3.0.3\"\n        info:\n          title: Secure API\n          version: \"1.0\"\n        paths:\n          \u002Fapi\u002Fv1\u002Fusers:\n            post:\n              requestBody:\n                required: true\n                content:\n                  application\u002Fjson:\n                    schema:\n                      type: object\n                      required: [name, email]\n                      properties:\n                        name:\n                          type: string\n                          maxLength: 100\n                          pattern: \"^[a-zA-Z ]+$\"\n                        email:\n                          type: string\n                          format: email\n                          maxLength: 255\n                      additionalProperties: false  # Block mass assignment\n              responses:\n                '201':\n                  description: User created\n      validate_request_body: true\n      validate_request_header_params: true\n      validate_request_query_params: true\n      validate_request_uri_params: true\n      verbose_response: false  # Do not expose schema details in errors\n```\n\n### Step 4: Mutual TLS Configuration\n\n```bash\n# Generate CA and client certificates for mTLS\n# 1. Create CA\nopenssl genrsa -out ca.key 4096\nopenssl req -new -x509 -key ca.key -out ca.crt -days 365 \\\n    -subj \"\u002FCN=API Gateway CA\u002FO=Example Corp\"\n\n# 2. Create client certificate\nopenssl genrsa -out client.key 2048\nopenssl req -new -key client.key -out client.csr \\\n    -subj \"\u002FCN=api-client\u002FO=Example Corp\"\nopenssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key \\\n    -CAcreateserial -out client.crt -days 365\n\n# Kong mTLS configuration\n# Upload CA certificate to Kong\ncurl -X POST http:\u002F\u002Fkong-admin:8001\u002Fca_certificates \\\n    -F \"cert=@ca.crt\"\n\n# Enable mTLS plugin\ncurl -X POST http:\u002F\u002Fkong-admin:8001\u002Fservices\u002Fuser-service\u002Fplugins \\\n    --data \"name=mtls-auth\" \\\n    --data \"config.ca_certificates[]=$(cat ca_cert_id)\" \\\n    --data \"config.revocation_check_mode=SKIP\" \\\n    --data \"config.authenticated_group_by=CN\"\n```\n\n### Step 5: Logging and Monitoring Configuration\n\n```python\n# CloudWatch monitoring for API security events\nimport boto3\n\ncloudwatch = boto3.client('cloudwatch')\nlogs = boto3.client('logs')\n\n# Create metric filters for security events\nsecurity_filters = [\n    {\n        'name': 'UnauthorizedAccess',\n        'pattern': '{ $.status = 401 || $.status = 403 }',\n        'metric': 'UnauthorizedAccessCount'\n    },\n    {\n        'name': 'RateLimitHits',\n        'pattern': '{ $.status = 429 }',\n        'metric': 'RateLimitHitCount'\n    },\n    {\n        'name': 'ServerErrors',\n        'pattern': '{ $.status >= 500 }',\n        'metric': 'ServerErrorCount'\n    },\n    {\n        'name': 'LargeResponses',\n        'pattern': '{ $.responseLength > 1000000 }',\n        'metric': 'LargeResponseCount'\n    },\n]\n\nfor sf in security_filters:\n    logs.put_metric_filter(\n        logGroupName='api-access-logs',\n        filterName=sf['name'],\n        filterPattern=sf['pattern'],\n        metricTransformations=[{\n            'metricName': sf['metric'],\n            'metricNamespace': 'APISecurityMetrics',\n            'metricValue': '1',\n            'defaultValue': 0\n        }]\n    )\n\n# Create alarm for unusual 401\u002F403 spike\ncloudwatch.put_metric_alarm(\n    AlarmName='API-UnauthorizedAccessSpike',\n    MetricName='UnauthorizedAccessCount',\n    Namespace='APISecurityMetrics',\n    Statistic='Sum',\n    Period=300,  # 5 minutes\n    EvaluationPeriods=1,\n    Threshold=100,\n    ComparisonOperator='GreaterThanThreshold',\n    AlarmActions=['arn:aws:sns:us-east-1:123456789:security-alerts'],\n    AlarmDescription='More than 100 unauthorized access attempts in 5 minutes'\n)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **API Gateway** | Centralized entry point for all API traffic that enforces authentication, authorization, rate limiting, and request validation before routing to backend services |\n| **Rate Limiting** | Controlling the number of API requests per client within a time window to prevent abuse and ensure fair resource allocation |\n| **Request Validation** | Verifying that incoming API requests conform to the expected schema (data types, required fields, value ranges) before forwarding to backend services |\n| **Mutual TLS (mTLS)** | Two-way TLS authentication where both the client and server present certificates, providing strong identity verification for API-to-API communication |\n| **WAF Integration** | Web Application Firewall rules applied at the API gateway to block common attack patterns (SQLi, XSS, path traversal) |\n| **OAuth2\u002FOIDC** | Token-based authentication protocols where the gateway validates JWT tokens against an identity provider before allowing access |\n\n## Tools & Systems\n\n- **Kong Gateway**: Open-source API gateway with extensive plugin ecosystem for security, rate limiting, and authentication\n- **AWS API Gateway**: Managed API gateway service with built-in throttling, WAF integration, and Lambda authorizers\n- **Azure API Management**: Enterprise API gateway with policy-based security, developer portal, and Azure AD integration\n- **Apigee (Google Cloud)**: API management platform with threat protection, quota management, and API analytics\n- **Envoy Proxy**: High-performance proxy used as API gateway in service mesh architectures with extensive filter chain\n\n## Common Scenarios\n\n### Scenario: Securing a Microservice API with Kong Gateway\n\n**Context**: A company is migrating from a monolithic API to microservices. Each microservice has its own REST API. The security team needs to implement centralized authentication, rate limiting, and request validation without modifying each service.\n\n**Approach**:\n1. Deploy Kong Gateway as the single entry point, routing traffic to 8 backend microservices\n2. Configure JWT validation plugin to verify tokens against the company's Keycloak IdP\n3. Apply rate limiting: 60 requests\u002Fminute for regular users, 300\u002Fminute for premium users, identified by JWT claims\n4. Enable OAS validation plugin to reject requests that do not match the OpenAPI spec (blocks mass assignment and injection)\n5. Configure mTLS for service-to-service communication behind the gateway\n6. Set up response transformer to remove Server and X-Powered-By headers and add security headers\n7. Integrate with AWS WAF for SQL injection and XSS protection rules\n8. Configure access logging to CloudWatch with security metric filters and alerting\n\n**Pitfalls**:\n- Relying solely on the gateway for authorization when backend services also need to verify permissions\n- Not configuring rate limiting per authenticated user (per-IP only allows attackers to bypass with IP rotation)\n- Using verbose error responses from the gateway that reveal internal service architecture\n- Not testing the gateway configuration with security tools after deployment\n- Missing mutual TLS between the gateway and backend services, allowing direct backend access\n\n## Output Format\n\n```\n## API Gateway Security Configuration Report\n\n**Gateway**: Kong 3.5 (Kubernetes deployment)\n**Backend Services**: 8 microservices\n**Date**: 2024-12-15\n\n### Security Controls Implemented\n\n| Control | Plugin\u002FFeature | Configuration |\n|---------|---------------|---------------|\n| Authentication | JWT Plugin | Cognito IdP, 1-hour max TTL |\n| Rate Limiting | Rate Limiting Plugin | 60 req\u002Fmin (user), Redis-backed |\n| Request Validation | OAS Validation | Strict mode, no additional properties |\n| TLS | Kong TLS | TLS 1.3 only, HSTS enabled |\n| mTLS | mTLS Auth Plugin | Client cert required for admin APIs |\n| WAF | AWS WAF | SQLi, XSS, rate-based rules |\n| Headers | Response Transformer | Server header removed, security headers added |\n| Logging | HTTP Log Plugin | CloudWatch, security metric filters |\n\n### Verification Results\n\n- JWT validation: Expired\u002Finvalid tokens correctly rejected (tested 50 payloads)\n- Rate limiting: Enforced at 60 req\u002Fmin, 429 returned with Retry-After header\n- Request validation: Malformed requests rejected with 400 (tested 30 invalid payloads)\n- mTLS: Requests without client certificate rejected with 401\n- WAF: SQL injection payloads blocked (tested top 100 SQLi patterns)\n```\n","# Implementing API Gateway Security Controls\n\n## When to Use\n\n- Deploying a centralized authentication and authorization layer for microservice APIs\n- Implementing rate limiting, throttling, and quota management across all API endpoints\n- Configuring request\u002Fresponse validation against OpenAPI specifications at the gateway level\n- Setting up TLS termination, mutual TLS, and certificate management for API traffic\n- Integrating WAF rules with the API gateway to block injection, XSS, and known attack patterns\n\n**Do not use** as the sole security layer. API gateways provide defense in depth but backend services must also validate authorization and input.\n\n## Prerequisites\n\n- API gateway platform selected and deployed (Kong, AWS API Gateway, Azure APIM, or Apigee)\n- OpenAPI\u002FSwagger specifications for all backend APIs\n- TLS certificates for the gateway domain\n- Identity provider (IdP) configured for OAuth2\u002FOIDC (Okta, Auth0, Azure AD)\n- Monitoring and logging infrastructure (CloudWatch, Datadog, ELK)\n- Backend service endpoints registered and reachable from the gateway\n\n## Workflow\n\n### Step 1: Kong Gateway Security Configuration\n\n```yaml\n# kong.yml - Declarative Kong configuration with security plugins\n_format_version: \"3.0\"\n\nservices:\n  - name: user-service\n    url: http:\u002F\u002Fuser-service:8080\n    routes:\n      - name: user-api\n        paths:\n          - \u002Fapi\u002Fv1\u002Fusers\n        methods:\n          - GET\n          - POST\n          - PUT\n          - PATCH\n          - DELETE\n        strip_path: false\n\nplugins:\n  # 1. Authentication: JWT validation\n  - name: jwt\n    config:\n      uri_param_names:\n        - jwt\n      header_names:\n        - Authorization\n      claims_to_verify:\n        - exp\n      maximum_expiration: 3600  # Max 1 hour token TTL\n\n  # 2. Rate Limiting\n  - name: rate-limiting\n    config:\n      minute: 60\n      hour: 1000\n      policy: redis\n      redis_host: redis\n      redis_port: 6379\n      fault_tolerant: true\n      hide_client_headers: false\n      limit_by: credential  # Per-user, not per-IP\n\n  # 3. Request Size Limiting\n  - name: request-size-limiting\n    config:\n      allowed_payload_size: 1  # 1 MB max\n      size_unit: megabytes\n\n  # 4. IP Restriction (admin endpoints)\n  - name: ip-restriction\n    service: admin-service\n    config:\n      allow:\n        - 10.0.0.0\u002F8\n        - 172.16.0.0\u002F12\n\n  # 5. Bot Detection\n  - name: bot-detection\n    config:\n      deny:\n        - \"sqlmap\"\n        - \"nikto\"\n        - \"nmap\"\n        - \"masscan\"\n\n  # 6. CORS Configuration\n  - name: cors\n    config:\n      origins:\n        - \"https:\u002F\u002Fapp.example.com\"\n      methods:\n        - GET\n        - POST\n        - PUT\n        - PATCH\n        - DELETE\n      headers:\n        - Authorization\n        - Content-Type\n      credentials: true\n      max_age: 3600\n\n  # 7. Response Transformer - Remove sensitive headers\n  - name: response-transformer\n    config:\n      remove:\n        headers:\n          - X-Powered-By\n          - Server\n      add:\n        headers:\n          - \"X-Content-Type-Options: nosniff\"\n          - \"X-Frame-Options: DENY\"\n          - \"Strict-Transport-Security: max-age=31536000; includeSubDomains\"\n          - \"Content-Security-Policy: default-src 'none'\"\n```\n\n### Step 2: AWS API Gateway Security Configuration\n\n```python\nimport boto3\nimport json\n\napigw = boto3.client('apigatewayv2')\n\n# Create API with mutual TLS\napi_response = apigw.create_api(\n    Name='secure-api',\n    ProtocolType='HTTP',\n    DisableExecuteApiEndpoint=True,  # Force custom domain\n)\napi_id = api_response['ApiId']\n\n# Configure authorizer (JWT with Cognito)\nauthorizer = apigw.create_authorizer(\n    ApiId=api_id,\n    AuthorizerType='JWT',\n    IdentitySource='$request.header.Authorization',\n    Name='cognito-jwt-authorizer',\n    JwtConfiguration={\n        'Audience': ['your-app-client-id'],\n        'Issuer': 'https:\u002F\u002Fcognito-idp.us-east-1.amazonaws.com\u002Fus-east-1_xxxxx'\n    }\n)\n\n# Create route with authorizer\napigw.create_route(\n    ApiId=api_id,\n    RouteKey='GET \u002Fapi\u002Fv1\u002Fusers',\n    AuthorizerId=authorizer['AuthorizerId'],\n    AuthorizationType='JWT',\n)\n\n# Configure throttling\napigw.create_stage(\n    ApiId=api_id,\n    StageName='prod',\n    DefaultRouteSettings={\n        'ThrottlingBurstLimit': 100,\n        'ThrottlingRateLimit': 50.0,  # 50 requests per second\n    },\n    AccessLogSettings={\n        'DestinationArn': 'arn:aws:logs:us-east-1:123456789:log-group:api-access-logs',\n        'Format': json.dumps({\n            'requestId': '$context.requestId',\n            'ip': '$context.identity.sourceIp',\n            'caller': '$context.identity.caller',\n            'user': '$context.identity.user',\n            'requestTime': '$context.requestTime',\n            'httpMethod': '$context.httpMethod',\n            'resourcePath': '$context.resourcePath',\n            'status': '$context.status',\n            'protocol': '$context.protocol',\n            'responseLength': '$context.responseLength'\n        })\n    }\n)\n\n# WAF association\nwaf = boto3.client('wafv2')\nweb_acl = waf.create_web_acl(\n    Name='api-security-acl',\n    Scope='REGIONAL',\n    DefaultAction={'Allow': {}},\n    Rules=[\n        {\n            'Name': 'AWS-AWSManagedRulesSQLiRuleSet',\n            'Priority': 1,\n            'Statement': {\n                'ManagedRuleGroupStatement': {\n                    'VendorName': 'AWS',\n                    'Name': 'AWSManagedRulesSQLiRuleSet'\n                }\n            },\n            'OverrideAction': {'None': {}},\n            'VisibilityConfig': {\n                'SampledRequestsEnabled': True,\n                'CloudWatchMetricsEnabled': True,\n                'MetricName': 'SQLiRuleSet'\n            }\n        },\n        {\n            'Name': 'RateLimit',\n            'Priority': 2,\n            'Statement': {\n                'RateBasedStatement': {\n                    'Limit': 2000,\n                    'AggregateKeyType': 'IP'\n                }\n            },\n            'Action': {'Block': {}},\n            'VisibilityConfig': {\n                'SampledRequestsEnabled': True,\n                'CloudWatchMetricsEnabled': True,\n                'MetricName': 'RateLimitRule'\n            }\n        },\n    ],\n    VisibilityConfig={\n        'SampledRequestsEnabled': True,\n        'CloudWatchMetricsEnabled': True,\n        'MetricName': 'ApiSecurityACL'\n    }\n)\n```\n\n### Step 3: Request Validation with OpenAPI Schema\n\n```yaml\n# Kong OAS Validation Plugin configuration\nplugins:\n  - name: oas-validation\n    config:\n      api_spec: |\n        openapi: \"3.0.3\"\n        info:\n          title: Secure API\n          version: \"1.0\"\n        paths:\n          \u002Fapi\u002Fv1\u002Fusers:\n            post:\n              requestBody:\n                required: true\n                content:\n                  application\u002Fjson:\n                    schema:\n                      type: object\n                      required: [name, email]\n                      properties:\n                        name:\n                          type: string\n                          maxLength: 100\n                          pattern: \"^[a-zA-Z ]+$\"\n                        email:\n                          type: string\n                          format: email\n                          maxLength: 255\n                      additionalProperties: false  # Block mass assignment\n              responses:\n                '201':\n                  description: User created\n      validate_request_body: true\n      validate_request_header_params: true\n      validate_request_query_params: true\n      validate_request_uri_params: true\n      verbose_response: false  # Do not expose schema details in errors\n```\n\n### Step 4: Mutual TLS Configuration\n\n```bash\n# Generate CA and client certificates for mTLS\n# 1. Create CA\nopenssl genrsa -out ca.key 4096\nopenssl req -new -x509 -key ca.key -out ca.crt -days 365 \\\n    -subj \"\u002FCN=API Gateway CA\u002FO=Example Corp\"\n\n# 2. Create client certificate\nopenssl genrsa -out client.key 2048\nopenssl req -new -key client.key -out client.csr \\\n    -subj \"\u002FCN=api-client\u002FO=Example Corp\"\nopenssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key \\\n    -CAcreateserial -out client.crt -days 365\n\n# Kong mTLS configuration\n# Upload CA certificate to Kong\ncurl -X POST http:\u002F\u002Fkong-admin:8001\u002Fca_certificates \\\n    -F \"cert=@ca.crt\"\n\n# Enable mTLS plugin\ncurl -X POST http:\u002F\u002Fkong-admin:8001\u002Fservices\u002Fuser-service\u002Fplugins \\\n    --data \"name=mtls-auth\" \\\n    --data \"config.ca_certificates[]=$(cat ca_cert_id)\" \\\n    --data \"config.revocation_check_mode=SKIP\" \\\n    --data \"config.authenticated_group_by=CN\"\n```\n\n### Step 5: Logging and Monitoring Configuration\n\n```python\n# CloudWatch monitoring for API security events\nimport boto3\n\ncloudwatch = boto3.client('cloudwatch')\nlogs = boto3.client('logs')\n\n# Create metric filters for security events\nsecurity_filters = [\n    {\n        'name': 'UnauthorizedAccess',\n        'pattern': '{ $.status = 401 || $.status = 403 }',\n        'metric': 'UnauthorizedAccessCount'\n    },\n    {\n        'name': 'RateLimitHits',\n        'pattern': '{ $.status = 429 }',\n        'metric': 'RateLimitHitCount'\n    },\n    {\n        'name': 'ServerErrors',\n        'pattern': '{ $.status >= 500 }',\n        'metric': 'ServerErrorCount'\n    },\n    {\n        'name': 'LargeResponses',\n        'pattern': '{ $.responseLength > 1000000 }',\n        'metric': 'LargeResponseCount'\n    },\n]\n\nfor sf in security_filters:\n    logs.put_metric_filter(\n        logGroupName='api-access-logs',\n        filterName=sf['name'],\n        filterPattern=sf['pattern'],\n        metricTransformations=[{\n            'metricName': sf['metric'],\n            'metricNamespace': 'APISecurityMetrics',\n            'metricValue': '1',\n            'defaultValue': 0\n        }]\n    )\n\n# Create alarm for unusual 401\u002F403 spike\ncloudwatch.put_metric_alarm(\n    AlarmName='API-UnauthorizedAccessSpike',\n    MetricName='UnauthorizedAccessCount',\n    Namespace='APISecurityMetrics',\n    Statistic='Sum',\n    Period=300,  # 5 minutes\n    EvaluationPeriods=1,\n    Threshold=100,\n    ComparisonOperator='GreaterThanThreshold',\n    AlarmActions=['arn:aws:sns:us-east-1:123456789:security-alerts'],\n    AlarmDescription='More than 100 unauthorized access attempts in 5 minutes'\n)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **API Gateway** | Centralized entry point for all API traffic that enforces authentication, authorization, rate limiting, and request validation before routing to backend services |\n| **Rate Limiting** | Controlling the number of API requests per client within a time window to prevent abuse and ensure fair resource allocation |\n| **Request Validation** | Verifying that incoming API requests conform to the expected schema (data types, required fields, value ranges) before forwarding to backend services |\n| **Mutual TLS (mTLS)** | Two-way TLS authentication where both the client and server present certificates, providing strong identity verification for API-to-API communication |\n| **WAF Integration** | Web Application Firewall rules applied at the API gateway to block common attack patterns (SQLi, XSS, path traversal) |\n| **OAuth2\u002FOIDC** | Token-based authentication protocols where the gateway validates JWT tokens against an identity provider before allowing access |\n\n## Tools & Systems\n\n- **Kong Gateway**: Open-source API gateway with extensive plugin ecosystem for security, rate limiting, and authentication\n- **AWS API Gateway**: Managed API gateway service with built-in throttling, WAF integration, and Lambda authorizers\n- **Azure API Management**: Enterprise API gateway with policy-based security, developer portal, and Azure AD integration\n- **Apigee (Google Cloud)**: API management platform with threat protection, quota management, and API analytics\n- **Envoy Proxy**: High-performance proxy used as API gateway in service mesh architectures with extensive filter chain\n\n## Common Scenarios\n\n### Scenario: Securing a Microservice API with Kong Gateway\n\n**Context**: A company is migrating from a monolithic API to microservices. Each microservice has its own REST API. The security team needs to implement centralized authentication, rate limiting, and request validation without modifying each service.\n\n**Approach**:\n1. Deploy Kong Gateway as the single entry point, routing traffic to 8 backend microservices\n2. Configure JWT validation plugin to verify tokens against the company's Keycloak IdP\n3. Apply rate limiting: 60 requests\u002Fminute for regular users, 300\u002Fminute for premium users, identified by JWT claims\n4. Enable OAS validation plugin to reject requests that do not match the OpenAPI spec (blocks mass assignment and injection)\n5. Configure mTLS for service-to-service communication behind the gateway\n6. Set up response transformer to remove Server and X-Powered-By headers and add security headers\n7. Integrate with AWS WAF for SQL injection and XSS protection rules\n8. Configure access logging to CloudWatch with security metric filters and alerting\n\n**Pitfalls**:\n- Relying solely on the gateway for authorization when backend services also need to verify permissions\n- Not configuring rate limiting per authenticated user (per-IP only allows attackers to bypass with IP rotation)\n- Using verbose error responses from the gateway that reveal internal service architecture\n- Not testing the gateway configuration with security tools after deployment\n- Missing mutual TLS between the gateway and backend services, allowing direct backend access\n\n## Output Format\n\n```\n## API Gateway Security Configuration Report\n\n**Gateway**: Kong 3.5 (Kubernetes deployment)\n**Backend Services**: 8 microservices\n**Date**: 2024-12-15\n\n### Security Controls Implemented\n\n| Control | Plugin\u002FFeature | Configuration |\n|---------|---------------|---------------|\n| Authentication | JWT Plugin | Cognito IdP, 1-hour max TTL |\n| Rate Limiting | Rate Limiting Plugin | 60 req\u002Fmin (user), Redis-backed |\n| Request Validation | OAS Validation | Strict mode, no additional properties |\n| TLS | Kong TLS | TLS 1.3 only, HSTS enabled |\n| mTLS | mTLS Auth Plugin | Client cert required for admin APIs |\n| WAF | AWS WAF | SQLi, XSS, rate-based rules |\n| Headers | Response Transformer | Server header removed, security headers added |\n| Logging | HTTP Log Plugin | CloudWatch, security metric filters |\n\n### Verification Results\n\n- JWT validation: Expired\u002Finvalid tokens correctly rejected (tested 50 payloads)\n- Rate limiting: Enforced at 60 req\u002Fmin, 429 returned with Retry-After header\n- Request validation: Malformed requests rejected with 400 (tested 30 invalid payloads)\n- mTLS: Requests without client certificate rejected with 401\n- WAF: SQL injection payloads blocked (tested top 100 SQLi patterns)\n```\n",{"name":5,"tags":24,"author":31,"domain":32,"license":14,"version":33,"nist_csf":34,"subdomain":25,"description":7,"mitre_attack":39},[25,26,27,28,29,30],"api-security","api-gateway","kong","aws-api-gateway","rate-limiting","waf","mahipal","cybersecurity","1.0.0",[35,36,37,38],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01",[40,41,42,43,44],"T1190","T1059.007","T1552.001","T1078.004","T1530","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-api-gateway-security-controls",{"tool":57,"command":58},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-api-gateway-security-controls",{"tool":60,"command":61},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-api-gateway-security-controls","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls\u002FSKILL.md",true,[65,69,75],{"path":66,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fapi-reference.md","REFERENCE","参考文档",1638,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls\u002Freferences\u002Fapi-reference.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fagent.py","SCRIPT","脚本",6527,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-api-gateway-security-controls\u002Fscripts\u002Fagent.py",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]