KoreShield

Management API

Reference for the KoreShield Management API

API Reference

This document provides a comprehensive reference for the KoreShield Management API (v1/management).

Base URL

Default: http://localhost:8000

Authentication

All management endpoints require authentication. Header: Authorization: Bearer <token>

Endpoints

Configuration

GET /v1/management/config

Retrieves the full system configuration.

  • Response: 200 OK (JSON)

PATCH /v1/management/config/security

Updates security settings.

  • Body: { "sensitivity": "high", "default_action": "block" }
  • Response: 200 OK

Statistics

GET /v1/management/stats

Retrieves real-time system statistics.

  • Response: 200 OK
    {
      "requests_total": 120,
      "requests_allowed": 110,
      "requests_blocked": 10,
      "attacks_detected": 5
    }

Audit Logs

GET /v1/management/logs

Retrieves paginated audit logs.

  • Query Params: limit (default 100), offset (default 0), level (optional)
  • Response: 200 OK
    {
      "logs": [ ... ],
      "total": 500,
      "limit": 100,
      "offset": 0
    }

Policies

GET /v1/management/policies

List all security policies.

  • Response: 200 OK (Array of Policy objects)

POST /v1/management/policies

Create a new policy.

  • Body: { "id": "sql_inject", "name": "SQL Injection", "roles": ["admin"] }
  • Response: 201 Created

DELETE /v1/management/policies/{policy_id}

Delete a policy.

  • Response: 200 OK

Chat Completion (Proxy)

POST /v1/chat/completions

OpenAI-compatible endpoint for proxying LLM requests.

  • Body: Standard OpenAI format (messages, model)
  • Protection: Subject to Rate Limiting, Sanitization, and Policy Enforcement.

On this page