Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/implementing-api-gateway-security-controls

implementing-api-gateway-security-controls

Verified

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.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md15.2 KB
references/api-reference.mdmarkdown1.6 KB
scripts/agent.pyscript6.4 KB

references/api-reference.md

View on GitHub
# API Reference: Implementing API Gateway Security Controls

## AWS API Gateway (boto3)

```python
import boto3
client = boto3.client("apigateway")
apis = client.get_rest_apis()["items"]
method = client.get_method(restApiId=api_id, resourceId=res_id, httpMethod="GET")
# Check: authorizationType, apiKeyRequired, requestValidatorId
stages = client.get_stages(restApiId=api_id)["item"]
# Check: accessLogSettings, methodSettings throttling
```

## Kong Admin API

```bash
# List services and their plugins
curl http://localhost:8001/services
curl http://localhost:8001/services/{id}/plugins

# Enable rate limiting
curl -X POST http://localhost:8001/services/{id}/plugins \
  -d "name=rate-limiting" -d "config.minute=100"

# Enable JWT auth
curl -X POST http://localhost:8001/services/{id}/plugins \
  -d "name=jwt"
```

## Security Controls Checklist

| Control | Gateway | Severity if Missing |
|---------|---------|---------------------|
| Authentication (JWT/OAuth) | All | CRITICAL |
| Rate Limiting | All | HIGH |
| Request Validation | All | MEDIUM |
| Access Logging | All | HIGH |
| TLS/mTLS | All | CRITICAL |
| CORS Policy | All | MEDIUM |
| IP Restriction | All | LOW |

## NGINX Gateway Security

```nginx
location /api/ {
    limit_req zone=api burst=20 nodelay;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://backend;
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options DENY;
}
```

### References

- AWS API Gateway: https://docs.aws.amazon.com/apigateway/
- Kong Gateway: https://docs.konghq.com/gateway/
- Azure APIM: https://learn.microsoft.com/en-us/azure/api-management/
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 192kUpdated Claude CodeCodexVerifiedInstall