"Not a Pentest" Trust-Anker: API Gateway Security schützt deine Endpoints. Keine Angriffswerkzeuge.
Moltbot AI Security · API Gateway
Moltbot API Gateway Security
Zentralisierte API-Absicherung für Moltbot — Authentication, Rate Limiting, Request Validation und Threat Detection als Gateway-Layer.
Was ist ein API Gateway? Einfach erklärt
Stell dir ein API Gateway wie einen Türsteher vor ein Club. Alle Anfragen gehen zuerst durch den Türsteher, der prüft: hast du eine gültige ID? Bist du auf der Gästeliste? Darfst du so oft rein wie du willst? Nur wenn alles stimmt, kommst du rein. Das Gateway übernimmt diese Sicherheitsprüfungen für alle deine APIs an einem zentralen Ort.
↓ Springe zu Kong Konfiguration, API Key Management und Ressourcen
🚪 Kong Gateway Konfiguration
# Kong declarative config (deck) für Moltbot
_format_version: "3.0"
services:
- name: moltbot-api
url: http://moltbot:3000
routes:
- name: moltbot-api-route
paths: [/api/v1]
strip_path: true
plugins:
# 1. JWT Authentication
- name: jwt
service: moltbot-api
config:
secret_is_base64: false
claims_to_verify: [exp, nbf]
# 2. Rate Limiting (pro Consumer)
- name: rate-limiting
service: moltbot-api
config:
second: 10
minute: 100
hour: 1000
policy: redis
redis_host: redis
redis_port: 6379
hide_client_headers: false
# 3. IP Restriction
- name: ip-restriction
service: moltbot-api
config:
deny: [0.0.0.0/0] # Alles blockieren außer Whitelist
allow: [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16]
# 4. Request Size Limiting
- name: request-size-limiting
service: moltbot-api
config:
allowed_payload_size: 1 # 1 MB max
size_unit: megabytes
# 5. CORS
- name: cors
service: moltbot-api
config:
origins: [https://clawking.click]
methods: [GET, POST, PUT, DELETE]
headers: [Authorization, Content-Type]
credentials: true🔑 API Key Management
// moltbot/lib/api-key-manager.ts
import crypto from 'crypto';
import { db } from './db';
export async function generateApiKey(customerId: string, name: string, permissions: string[]) {
const rawKey = crypto.randomBytes(32).toString('hex');
const keyHash = crypto.createHash('sha256').update(rawKey).digest('hex');
const prefix = rawKey.substring(0, 8);
await db.query(
'INSERT INTO api_keys (customer_id, name, key_hash, prefix, permissions, created_at) VALUES ($1, $2, $3, $4, $5, NOW())',
[customerId, name, keyHash, prefix, JSON.stringify(permissions)]
);
// Nur einmal zurückgeben (danach nur Hash gespeichert)
return { key: 'moltbot_' + rawKey, prefix, permissions };
}
export async function validateApiKey(rawKey: string) {
const keyHash = crypto.createHash('sha256').update(rawKey.replace('moltbot_', '')).digest('hex');
const result = await db.query(
'SELECT * FROM api_keys WHERE key_hash = $1 AND revoked_at IS NULL',
[keyHash]
);
return result.rows[0] ?? null;
}Weiterführende Ressourcen
CG
ClawKing Security Team
✓ VerifiedSecurity Research & Engineering · API Gateway Specialists
📅 Veröffentlicht: 28.04.2026🔄 Zuletzt geprüft: 28.04.2026
Dieser Guide basiert auf praktischer Erfahrung mit API Gateway Security in Produktionsumgebungen. Die beschriebenen Konfigurationen sind in echten Deployments erprobt und kontinuierlich verbessert worden.
🔒 Verifiziert von ClawKing Security Team·Alle Informationen fact-checked und peer-reviewed