Complete rewrite and re-architecture Osmedeus Engine in v5

This commit is contained in:
j3ssie
2026-01-18 19:32:24 +08:00
commit 7a2c5a5dc9
743 changed files with 99767 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+739
View File
@@ -0,0 +1,739 @@
{
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"description": "Modern Orchestration Engine for Security - REST API for managing security automation workflows, scans, and distributed task execution.",
"title": "Osmedeus API",
"termsOfService": "https://docs.osmedeus.org/terms/",
"contact": {
"name": "Osmedeus Support",
"url": "https://github.com/j3ssie/osmedeus",
"email": "support@osmedeus.org"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "5.0.0"
},
"host": "localhost:8002",
"basePath": "/",
"paths": {
"/": {
"get": {
"description": "Get server version and info",
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "Server info",
"responses": {
"200": {
"description": "Server information",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/osm/api/login": {
"post": {
"description": "Authenticate user and get JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User login",
"parameters": [
{
"description": "Login credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pkg_server_handlers.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/new-scan": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Execute a workflow against a target",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Scans"
],
"summary": "Create a new scan",
"parameters": [
{
"description": "Scan configuration",
"name": "scan",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pkg_server_handlers.CreateScanRequest"
}
}
],
"responses": {
"202": {
"description": "Scan started",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Workflow not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/tasks": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all running and completed tasks",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "List all tasks",
"responses": {
"200": {
"description": "List of running and completed tasks",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to list tasks",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Submit a new task to the distributed worker queue",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Submit a new task",
"parameters": [
{
"description": "Task configuration",
"name": "task",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pkg_server_handlers.SubmitTaskRequest"
}
}
],
"responses": {
"202": {
"description": "Task submitted",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to submit task",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/tasks/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details for a specific task by ID",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Get task details",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Task details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Task not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workers": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all registered workers in the distributed pool",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "List all workers",
"responses": {
"200": {
"description": "List of workers",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to list workers",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workers/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details for a specific worker by ID",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Get worker details",
"parameters": [
{
"type": "string",
"description": "Worker ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Worker details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Worker not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get worker",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available workflows with details",
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "List all workflows",
"responses": {
"200": {
"description": "List of workflows",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to load workflows",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows/{name}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information about a specific workflow. Use show_yaml=true to get raw YAML content.",
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "Get workflow details",
"parameters": [
{
"type": "string",
"description": "Workflow name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Return raw YAML content instead of JSON",
"name": "show_yaml",
"in": "query"
}
],
"responses": {
"200": {
"description": "Workflow details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Workflow not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workspaces": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all scan workspaces",
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "List all workspaces",
"responses": {
"200": {
"description": "List of workspaces",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to read workspaces",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/upload-file": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Upload a file containing a list of inputs (targets, URLs, etc.) for later use in scans",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Files"
],
"summary": "Upload input file",
"parameters": [
{
"type": "file",
"description": "Input file to upload",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "File uploaded with path",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflow-upload": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Upload a raw YAML workflow file and save it to the workflows directory",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "Upload workflow file",
"parameters": [
{
"type": "file",
"description": "Workflow YAML file",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"201": {
"description": "Workflow uploaded",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request or YAML",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshot-download/{workspace_name}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Compress a workspace folder into a zip file and download it",
"produces": [
"application/zip"
],
"tags": [
"Snapshots"
],
"summary": "Download workspace snapshot",
"parameters": [
{
"type": "string",
"description": "Workspace name",
"name": "workspace_name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Zip file download",
"schema": {
"type": "file"
}
},
"404": {
"description": "Workspace not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to create snapshot",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/health": {
"get": {
"description": "Check if the server is running",
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Health check",
"responses": {
"200": {
"description": "status: ok",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/health/ready": {
"get": {
"description": "Check if the server is ready to accept requests",
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Readiness check",
"responses": {
"200": {
"description": "status: ready",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"pkg_server_handlers.CreateScanRequest": {
"type": "object",
"properties": {
"concurrency": {
"description": "Number of concurrent scans (default: 1)",
"type": "integer",
"default": 1
},
"flow": {
"description": "Flow workflow name",
"type": "string"
},
"module": {
"description": "Module workflow name",
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"target": {
"description": "Single target to scan",
"type": "string"
},
"targets": {
"description": "Array of targets to scan",
"type": "array",
"items": {
"type": "string"
}
},
"target_file": {
"description": "Path to file containing targets (one per line)",
"type": "string"
}
}
},
"pkg_server_handlers.LoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"pkg_server_handlers.SubmitTaskRequest": {
"type": "object",
"properties": {
"params": {
"type": "object",
"additionalProperties": true
},
"target": {
"type": "string"
},
"workflow_kind": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "JWT Bearer token authentication. Format: \"Bearer {token}\"",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
+487
View File
@@ -0,0 +1,487 @@
basePath: /
definitions:
pkg_server_handlers.CreateScanRequest:
properties:
concurrency:
default: 1
description: Number of concurrent scans (default: 1)
type: integer
flow:
description: Flow workflow name
type: string
module:
description: Module workflow name
type: string
params:
additionalProperties:
type: string
type: object
target:
description: Single target to scan
type: string
targets:
description: Array of targets to scan
items:
type: string
type: array
target_file:
description: Path to file containing targets (one per line)
type: string
type: object
pkg_server_handlers.LoginRequest:
properties:
password:
type: string
username:
type: string
type: object
pkg_server_handlers.SubmitTaskRequest:
properties:
params:
additionalProperties: true
type: object
target:
type: string
workflow_kind:
type: string
workflow_name:
type: string
type: object
host: localhost:8002
info:
contact:
email: support@osmedeus.org
name: Osmedeus Support
url: https://github.com/j3ssie/osmedeus
description: Modern Orchestration Engine for Security - REST API for managing security
automation workflows, scans, and distributed task execution.
license:
name: MIT
url: https://opensource.org/licenses/MIT
termsOfService: https://docs.osmedeus.org/terms/
title: Osmedeus API
version: 5.0.0
paths:
/:
get:
description: Get server version and info
produces:
- application/json
responses:
"200":
description: Server information
schema:
additionalProperties:
type: string
type: object
summary: Server info
tags:
- Info
/osm/api/login:
post:
consumes:
- application/json
description: Authenticate user and get JWT token
parameters:
- description: Login credentials
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/pkg_server_handlers.LoginRequest'
produces:
- application/json
responses:
"200":
description: JWT token
schema:
additionalProperties:
type: string
type: object
"400":
description: Invalid request
schema:
additionalProperties: true
type: object
"401":
description: Invalid credentials
schema:
additionalProperties: true
type: object
summary: User login
tags:
- Auth
/osm/api/new-scan:
post:
consumes:
- application/json
description: Execute a workflow against a target
parameters:
- description: Scan configuration
in: body
name: scan
required: true
schema:
$ref: '#/definitions/pkg_server_handlers.CreateScanRequest'
produces:
- application/json
responses:
"202":
description: Scan started
schema:
additionalProperties: true
type: object
"400":
description: Invalid request
schema:
additionalProperties: true
type: object
"404":
description: Workflow not found
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Create a new scan
tags:
- Scans
/osm/api/upload-file:
post:
consumes:
- multipart/form-data
description: Upload a file containing a list of inputs (targets, URLs, etc.)
for later use in scans
parameters:
- description: Input file to upload
in: formData
name: file
required: true
type: file
produces:
- application/json
responses:
"200":
description: File uploaded with path
schema:
additionalProperties: true
type: object
"400":
description: Invalid request
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Upload input file
tags:
- Files
/osm/api/workflow-upload:
post:
consumes:
- multipart/form-data
description: Upload a raw YAML workflow file and save it to the workflows directory
parameters:
- description: Workflow YAML file
in: formData
name: file
required: true
type: file
produces:
- application/json
responses:
"201":
description: Workflow uploaded
schema:
additionalProperties: true
type: object
"400":
description: Invalid request or YAML
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Upload workflow file
tags:
- Workflows
/osm/api/tasks:
get:
description: Get a list of all running and completed tasks
produces:
- application/json
responses:
"200":
description: List of running and completed tasks
schema:
additionalProperties: true
type: object
"500":
description: Failed to list tasks
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: List all tasks
tags:
- Distributed
post:
consumes:
- application/json
description: Submit a new task to the distributed worker queue
parameters:
- description: Task configuration
in: body
name: task
required: true
schema:
$ref: '#/definitions/pkg_server_handlers.SubmitTaskRequest'
produces:
- application/json
responses:
"202":
description: Task submitted
schema:
additionalProperties: true
type: object
"400":
description: Invalid request
schema:
additionalProperties: true
type: object
"500":
description: Failed to submit task
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Submit a new task
tags:
- Distributed
/osm/api/tasks/{id}:
get:
description: Get details for a specific task by ID
parameters:
- description: Task ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Task details
schema:
additionalProperties: true
type: object
"404":
description: Task not found
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Get task details
tags:
- Distributed
/osm/api/workers:
get:
description: Get a list of all registered workers in the distributed pool
produces:
- application/json
responses:
"200":
description: List of workers
schema:
additionalProperties: true
type: object
"500":
description: Failed to list workers
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: List all workers
tags:
- Distributed
/osm/api/workers/{id}:
get:
description: Get details for a specific worker by ID
parameters:
- description: Worker ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Worker details
schema:
additionalProperties: true
type: object
"404":
description: Worker not found
schema:
additionalProperties: true
type: object
"500":
description: Failed to get worker
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Get worker details
tags:
- Distributed
/osm/api/workflows:
get:
description: Get a list of all available workflows with details
produces:
- application/json
responses:
"200":
description: List of workflows
schema:
additionalProperties: true
type: object
"500":
description: Failed to load workflows
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: List all workflows
tags:
- Workflows
/osm/api/workflows/{name}:
get:
description: Get detailed information about a specific workflow. Use show_yaml=true
to get raw YAML content.
parameters:
- description: Workflow name
in: path
name: name
required: true
type: string
- description: Return raw YAML content instead of JSON
in: query
name: show_yaml
type: boolean
produces:
- application/json
responses:
"200":
description: Workflow details
schema:
additionalProperties: true
type: object
"404":
description: Workflow not found
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Get workflow details
tags:
- Workflows
/osm/api/workspaces:
get:
description: Get a list of all scan workspaces
produces:
- application/json
responses:
"200":
description: List of workspaces
schema:
additionalProperties: true
type: object
"500":
description: Failed to read workspaces
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: List all workspaces
tags:
- Workspaces
/osm/api/snapshot-download/{workspace_name}:
get:
description: Compress a workspace folder into a zip file and download it
parameters:
- description: Workspace name
in: path
name: workspace_name
required: true
type: string
produces:
- application/zip
responses:
"200":
description: Zip file download
schema:
type: file
"404":
description: Workspace not found
schema:
additionalProperties: true
type: object
"500":
description: Failed to create snapshot
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: Download workspace snapshot
tags:
- Snapshots
/health:
get:
description: Check if the server is running
produces:
- application/json
responses:
"200":
description: 'status: ok'
schema:
additionalProperties:
type: string
type: object
summary: Health check
tags:
- Health
/health/ready:
get:
description: Check if the server is ready to accept requests
produces:
- application/json
responses:
"200":
description: 'status: ready'
schema:
additionalProperties:
type: string
type: object
summary: Readiness check
tags:
- Health
schemes:
- http
- https
securityDefinitions:
BearerAuth:
description: 'JWT Bearer token authentication. Format: "Bearer {token}"'
in: header
name: Authorization
type: apiKey
swagger: "2.0"
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff