mirror of
https://github.com/owasp-amass/amass.git
synced 2026-10-12 02:20:44 +00:00
846 lines
29 KiB
Go
846 lines
29 KiB
Go
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"termsOfService": "https://owasp.org/www-project-amass/",
|
|
"contact": {
|
|
"name": "OWASP Amass Project",
|
|
"url": "https://github.com/owasp-amass/amass"
|
|
},
|
|
"license": {
|
|
"name": "Apache 2.0",
|
|
"url": "https://www.apache.org/licenses/LICENSE-2.0"
|
|
},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/health": {
|
|
"get": {
|
|
"description": "Returns a simple health indicator that the Amass Engine API is running.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"system"
|
|
],
|
|
"summary": "Health check",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.HealthCheckResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions": {
|
|
"post": {
|
|
"description": "Creates a new Amass engine session using the provided configuration JSON.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Create a new engine session",
|
|
"parameters": [
|
|
{
|
|
"description": "Engine configuration",
|
|
"name": "config",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_owasp-amass_amass_v5_config.Config"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.CreateSessionResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid JSON or invalid configuration",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Failed to create session",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/list": {
|
|
"get": {
|
|
"description": "Returns the session tokens for all currently active sessions.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "List active sessions",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ListSessionsResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Zero sessions found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}": {
|
|
"delete": {
|
|
"description": "Cancels an active session. Returns no content on success.",
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Terminate a session",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content"
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}/assets/{asset_type}": {
|
|
"post": {
|
|
"description": "Submits a single OAM asset to the session. The asset type is provided in the URL path; the request body is a raw OAM JSON object without a 'type' field.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"assets"
|
|
],
|
|
"summary": "Add a single asset (typed by path)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Asset type (e.g., autonomous_system, fqdn, ipaddress, netblock, location, organization)",
|
|
"name": "asset_type",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Raw OAM JSON object (without 'type')",
|
|
"name": "asset",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.AddAssetResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token, invalid JSON, or invalid asset object",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Failed to submit the asset",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}/assets/{asset_type}:bulk": {
|
|
"post": {
|
|
"description": "Submits multiple OAM assets to the session in one request. The asset type is provided in the URL path. Each item in 'items' is a raw OAM JSON object without a 'type' field.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"assets"
|
|
],
|
|
"summary": "Add assets in bulk (typed by path)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Asset type (e.g., autonomous_system, fqdn, ipaddress, netblock, location, organization)",
|
|
"name": "asset_type",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Bulk add request payload",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.BulkAddAssetsRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.BulkAddAssetsResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token, invalid JSON, empty items, or no valid items",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"413": {
|
|
"description": "Too many items in bulk request",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server failure (response includes ingested/stored/failed)",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.BulkAddAssetsResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}/scope/{asset_type}": {
|
|
"get": {
|
|
"description": "Returns the scoped assets for the given session and asset type as an array of raw OAM JSON objects.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"scope"
|
|
],
|
|
"summary": "Get session scope for an asset type",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Asset type (e.g., autonomoussystem, fqdn, ipaddress, netblock, location, organization)",
|
|
"name": "asset_type",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Response contains a 'data' array of raw OAM JSON",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ScopeResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found or scope not found for asset type",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}/stats": {
|
|
"get": {
|
|
"description": "Returns the current runtime statistics for a session.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Get session statistics",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.SessionStatsResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sessions/{session_token}/ws/logs": {
|
|
"get": {
|
|
"description": "Upgrades the HTTP connection to a WebSocket and streams session log lines as UTF-8 text frames.\nThe server sends periodic ping frames (~30s) and expects pong responses; idle connections may be closed.",
|
|
"tags": [
|
|
"sessions"
|
|
],
|
|
"summary": "Stream session logs (WebSocket)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Session token (UUID)",
|
|
"name": "session_token",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"101": {
|
|
"description": "Switching Protocols (WebSocket upgrade)",
|
|
"headers": {
|
|
"Connection": {
|
|
"type": "string",
|
|
"description": "Upgrade"
|
|
},
|
|
"Upgrade": {
|
|
"type": "string",
|
|
"description": "websocket"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid session token",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Session not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/v1.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"config.Credentials": {
|
|
"type": "object",
|
|
"properties": {
|
|
"apikey": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"secret": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.DataSource": {
|
|
"type": "object",
|
|
"properties": {
|
|
"creds": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/config.Credentials"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"ttl": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"config.DataSourceConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"datasources": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/config.DataSource"
|
|
}
|
|
},
|
|
"global_options": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"config.Database": {
|
|
"type": "object",
|
|
"properties": {
|
|
"db_name": {
|
|
"description": "Name of the database",
|
|
"type": "string"
|
|
},
|
|
"host": {
|
|
"description": "Host of the database",
|
|
"type": "string"
|
|
},
|
|
"options": {
|
|
"description": "Extra options used while connecting to the database",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Password for authentication",
|
|
"type": "string"
|
|
},
|
|
"port": {
|
|
"description": "Port of the database",
|
|
"type": "string"
|
|
},
|
|
"primary": {
|
|
"description": "Whether this database is the primary store",
|
|
"type": "boolean"
|
|
},
|
|
"system": {
|
|
"description": "Database system type (Postgres, MySQL, etc.)",
|
|
"type": "string"
|
|
},
|
|
"url": {
|
|
"description": "Full URI to the database",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username for authentication",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"config.Scope": {
|
|
"type": "object",
|
|
"properties": {
|
|
"asns": {
|
|
"description": "ASNs specified as in scope",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"blacklist": {
|
|
"description": "A blacklist of subdomain names that will not be investigated",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cidrs": {
|
|
"description": "CIDR IPNET",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/net.IPNet"
|
|
}
|
|
},
|
|
"domains": {
|
|
"description": "The root domain names that the enumeration will target",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"ips": {
|
|
"description": "IP Net.IP",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
}
|
|
},
|
|
"ports": {
|
|
"description": "The ports checked for certificates",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"config.Transformation": {
|
|
"type": "object",
|
|
"properties": {
|
|
"confidence": {
|
|
"type": "integer"
|
|
},
|
|
"exclude": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"priority": {
|
|
"type": "integer"
|
|
},
|
|
"ttl": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_owasp-amass_amass_v5_config.Config": {
|
|
"type": "object",
|
|
"properties": {
|
|
"active": {
|
|
"description": "Determines if zone transfers will be attempted",
|
|
"type": "boolean"
|
|
},
|
|
"alt_worldlist": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"alterations": {
|
|
"description": "Will discovered subdomain name alterations be generated?",
|
|
"type": "boolean"
|
|
},
|
|
"brute_force": {
|
|
"description": "Will the enumeration including brute forcing techniques",
|
|
"type": "boolean"
|
|
},
|
|
"database": {
|
|
"description": "The graph databases used by the system / enumerations",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/config.Database"
|
|
}
|
|
},
|
|
"datasource_config": {
|
|
"description": "The data source configurations",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/config.DataSourceConfig"
|
|
}
|
|
]
|
|
},
|
|
"resolvers": {
|
|
"description": "Resolver settings",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"rigid_boundaries": {
|
|
"description": "Determines rigidness of the enumeration",
|
|
"type": "boolean"
|
|
},
|
|
"scope": {
|
|
"description": "Scope struct that contains ASN, CIDR, Domain, IP, and ports in scope",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/config.Scope"
|
|
}
|
|
]
|
|
},
|
|
"seed": {
|
|
"description": "Seed struct that contains the provided names and CIDRs",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/config.Scope"
|
|
}
|
|
]
|
|
},
|
|
"transformations": {
|
|
"description": "The Transformations map will contain incoming assets, and what handlers should be called.",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/config.Transformation"
|
|
}
|
|
},
|
|
"trusted_resolvers": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"wordlist": {
|
|
"description": "The list of words to use when generating names",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"net.IPNet": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ip": {
|
|
"description": "network number",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
"mask": {
|
|
"description": "network mask",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"v1.AddAssetResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"entityID": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"v1.BulkAddAssetsRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"v1.BulkAddAssetsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"failed": {
|
|
"type": "integer"
|
|
},
|
|
"ingested": {
|
|
"type": "integer"
|
|
},
|
|
"stored": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"v1.CreateSessionResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sessionToken": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"v1.ErrorResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer"
|
|
},
|
|
"details": {
|
|
"type": "string"
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"v1.HealthCheckResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"result": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"v1.ListSessionsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sessionTokens": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"v1.ScopeResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"v1.SessionStatsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"workItemsCompleted": {
|
|
"type": "integer"
|
|
},
|
|
"workItemsTotal": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"description": "System endpoints (health, etc.)",
|
|
"name": "system"
|
|
},
|
|
{
|
|
"description": "Create, list, inspect, and terminate engine sessions.",
|
|
"name": "sessions"
|
|
},
|
|
{
|
|
"description": "Read-only access to the scoped assets loaded into a session.",
|
|
"name": "scope"
|
|
},
|
|
{
|
|
"description": "Submit typed OAM assets to a session (single or bulk).",
|
|
"name": "assets"
|
|
},
|
|
{
|
|
"description": "WebSocket endpoints (e.g., session log streaming).",
|
|
"name": "ws"
|
|
}
|
|
]
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "",
|
|
BasePath: "/api/v1",
|
|
Schemes: []string{},
|
|
Title: "Amass Engine API (v1)",
|
|
Description: "HTTP API for managing Amass Engine sessions and submitting Open Asset Model (OAM) assets.\nCreate a session with an engine config, query session stats/scope, and ingest typed OAM assets (single or bulk).\nIncludes a WebSocket endpoint for streaming session logs.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|