mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-29 04:54:57 +02:00
Fix some bugs and refactor the API server
This commit is contained in:
@@ -0,0 +1,508 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"contact": {}
|
||||
},
|
||||
"paths": {
|
||||
"/api/osmp/delete/{wsname}": {
|
||||
"delete": {
|
||||
"description": "Delete a workspace and all its associated files",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"workspaces"
|
||||
],
|
||||
"summary": "Delete a workspace",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Workspace name",
|
||||
"name": "wsname",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Workspace successfully deleted",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Workspace doesn't exist",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/osmp/execute": {
|
||||
"post": {
|
||||
"description": "Execute a new scan with specified configuration",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"scans"
|
||||
],
|
||||
"summary": "Start a new scan",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Scan configuration",
|
||||
"name": "taskData",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.TaskData"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Scan started successfully",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string"
|
||||
},
|
||||
"input": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid JSON payload",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/osmp/flows": {
|
||||
"get": {
|
||||
"description": "Get all available workflow configurations and their modules",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"workflows"
|
||||
],
|
||||
"summary": "List available workflows",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of workflows with their details",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Error when no workflow is found",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/osmp/ps": {
|
||||
"get": {
|
||||
"description": "Get all currently running Osmedeus processes",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"processes"
|
||||
],
|
||||
"summary": "List running processes",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of all running processes",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/osmp/scans": {
|
||||
"get": {
|
||||
"description": "Get all running and completed scan processes",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"scans"
|
||||
],
|
||||
"summary": "List all scan processes",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of all scan processes",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/osmp/workspace/{wsname}": {
|
||||
"get": {
|
||||
"description": "Get detailed information about a specific workspace including reports",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"workspaces"
|
||||
],
|
||||
"summary": "Get workspace details",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Workspace name",
|
||||
"name": "wsname",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "workspace details and reports",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/login": {
|
||||
"post": {
|
||||
"description": "Authenticate user and return JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"authentication"
|
||||
],
|
||||
"summary": "User login",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "status=success, message=Successfully login, token=JWT_TOKEN",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/health": {
|
||||
"get": {
|
||||
"description": "Get server health status and version information",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"summary": "Check server health status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
},
|
||||
"503": {
|
||||
"description": "Service Unavailable",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/ping": {
|
||||
"get": {
|
||||
"description": "Simple ping endpoint to verify server is responding",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"system"
|
||||
],
|
||||
"summary": "Check server connectivity",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
},
|
||||
"503": {
|
||||
"description": "Service Unavailable",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/workspaces": {
|
||||
"get": {
|
||||
"description": "Get all available workspaces",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"workspaces"
|
||||
],
|
||||
"summary": "Get all workspaces",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/server.ResponseHTTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"server.ResponseHTTP": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"server.TaskData": {
|
||||
"description": "Configuration for executing a new scan",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"as_file": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"chunk": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"command": {
|
||||
"type": "string"
|
||||
},
|
||||
"concurrency": {
|
||||
"type": "integer",
|
||||
"example": 5
|
||||
},
|
||||
"debug": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"distributed": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"module": {
|
||||
"type": "string",
|
||||
"example": "subdomain"
|
||||
},
|
||||
"params": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"example": [
|
||||
"[\"-deep\"",
|
||||
" \"-aggressive\"]"
|
||||
]
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"example": "secret123"
|
||||
},
|
||||
"target": {
|
||||
"type": "string",
|
||||
"example": "example.com"
|
||||
},
|
||||
"targets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"targets_file": {
|
||||
"type": "string",
|
||||
"example": "/path/to/targets.txt"
|
||||
},
|
||||
"test": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"threads": {
|
||||
"type": "integer",
|
||||
"example": 10
|
||||
},
|
||||
"timeout": {
|
||||
"type": "string",
|
||||
"example": "1h"
|
||||
},
|
||||
"wildcard": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"workflow": {
|
||||
"type": "string",
|
||||
"example": "general"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string",
|
||||
"example": "my-project"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user