mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-21 01:36:46 +00:00
add api for access log events
This commit is contained in:
@@ -2699,6 +2699,75 @@ components:
|
||||
- page_size
|
||||
- total_records
|
||||
- total_pages
|
||||
ProxyAccessLog:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: "Unique identifier for the access log entry"
|
||||
example: "ch8i4ug6lnn4g9hqv7m0"
|
||||
proxy_id:
|
||||
type: string
|
||||
description: "ID of the reverse proxy that handled the request"
|
||||
example: "ch8i4ug6lnn4g9hqv7m0"
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "Timestamp when the request was made"
|
||||
example: "2024-01-31T15:30:00Z"
|
||||
method:
|
||||
type: string
|
||||
description: "HTTP method of the request"
|
||||
example: "GET"
|
||||
host:
|
||||
type: string
|
||||
description: "Host header of the request"
|
||||
example: "example.com"
|
||||
path:
|
||||
type: string
|
||||
description: "Path of the request"
|
||||
example: "/api/users"
|
||||
duration_ms:
|
||||
type: integer
|
||||
description: "Duration of the request in milliseconds"
|
||||
example: 150
|
||||
status_code:
|
||||
type: integer
|
||||
description: "HTTP status code returned"
|
||||
example: 200
|
||||
source_ip:
|
||||
type: string
|
||||
description: "Source IP address of the request"
|
||||
example: "192.168.1.100"
|
||||
reason:
|
||||
type: string
|
||||
description: "Reason for the request result (e.g., authentication failure)"
|
||||
example: "Authentication failed"
|
||||
user_id:
|
||||
type: string
|
||||
description: "ID of the authenticated user, if applicable"
|
||||
example: "user-123"
|
||||
auth_method_used:
|
||||
type: string
|
||||
description: "Authentication method used (e.g., password, pin, oidc)"
|
||||
example: "oidc"
|
||||
country_code:
|
||||
type: string
|
||||
description: "Country code from geolocation"
|
||||
example: "US"
|
||||
city_name:
|
||||
type: string
|
||||
description: "City name from geolocation"
|
||||
example: "San Francisco"
|
||||
required:
|
||||
- id
|
||||
- proxy_id
|
||||
- timestamp
|
||||
- method
|
||||
- host
|
||||
- path
|
||||
- duration_ms
|
||||
- status_code
|
||||
IdentityProviderType:
|
||||
type: string
|
||||
description: Type of identity provider
|
||||
@@ -6197,6 +6266,26 @@ paths:
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/events/proxy:
|
||||
get:
|
||||
summary: List all Reverse Proxy Access Logs
|
||||
description: Returns a list of all reverse proxy access log entries
|
||||
tags: [ Events ]
|
||||
responses:
|
||||
"200":
|
||||
description: List of reverse proxy access logs
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/ProxyAccessLog"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/posture-checks:
|
||||
get:
|
||||
summary: List all Posture Checks
|
||||
|
||||
@@ -1892,6 +1892,51 @@ type ProcessCheck struct {
|
||||
Processes []Process `json:"processes"`
|
||||
}
|
||||
|
||||
// ProxyAccessLog defines model for ProxyAccessLog.
|
||||
type ProxyAccessLog struct {
|
||||
// AuthMethodUsed Authentication method used (e.g., password, pin, oidc)
|
||||
AuthMethodUsed *string `json:"auth_method_used,omitempty"`
|
||||
|
||||
// CityName City name from geolocation
|
||||
CityName *string `json:"city_name,omitempty"`
|
||||
|
||||
// CountryCode Country code from geolocation
|
||||
CountryCode *string `json:"country_code,omitempty"`
|
||||
|
||||
// DurationMs Duration of the request in milliseconds
|
||||
DurationMs int `json:"duration_ms"`
|
||||
|
||||
// Host Host header of the request
|
||||
Host string `json:"host"`
|
||||
|
||||
// Id Unique identifier for the access log entry
|
||||
Id string `json:"id"`
|
||||
|
||||
// Method HTTP method of the request
|
||||
Method string `json:"method"`
|
||||
|
||||
// Path Path of the request
|
||||
Path string `json:"path"`
|
||||
|
||||
// ProxyId ID of the reverse proxy that handled the request
|
||||
ProxyId string `json:"proxy_id"`
|
||||
|
||||
// Reason Reason for the request result (e.g., authentication failure)
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
|
||||
// SourceIp Source IP address of the request
|
||||
SourceIp *string `json:"source_ip,omitempty"`
|
||||
|
||||
// StatusCode HTTP status code returned
|
||||
StatusCode int `json:"status_code"`
|
||||
|
||||
// Timestamp Timestamp when the request was made
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
|
||||
// UserId ID of the authenticated user, if applicable
|
||||
UserId *string `json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
// Resource defines model for Resource.
|
||||
type Resource struct {
|
||||
// Id ID of the resource
|
||||
@@ -2665,14 +2710,14 @@ type PostApiPostureChecksJSONRequestBody = PostureCheckUpdate
|
||||
// PutApiPostureChecksPostureCheckIdJSONRequestBody defines body for PutApiPostureChecksPostureCheckId for application/json ContentType.
|
||||
type PutApiPostureChecksPostureCheckIdJSONRequestBody = PostureCheckUpdate
|
||||
|
||||
// PostApiReverseProxyJSONRequestBody defines body for PostApiReverseProxy for application/json ContentType.
|
||||
type PostApiReverseProxyJSONRequestBody = ReverseProxyRequest
|
||||
// PostApiReverseProxiesJSONRequestBody defines body for PostApiReverseProxies for application/json ContentType.
|
||||
type PostApiReverseProxiesJSONRequestBody = ReverseProxyRequest
|
||||
|
||||
// PostApiReverseProxyDomainsJSONRequestBody defines body for PostApiReverseProxyDomains for application/json ContentType.
|
||||
type PostApiReverseProxyDomainsJSONRequestBody = ReverseProxyDomainRequest
|
||||
// PostApiReverseProxiesDomainsJSONRequestBody defines body for PostApiReverseProxiesDomains for application/json ContentType.
|
||||
type PostApiReverseProxiesDomainsJSONRequestBody = ReverseProxyDomainRequest
|
||||
|
||||
// PutApiReverseProxyProxyIdJSONRequestBody defines body for PutApiReverseProxyProxyId for application/json ContentType.
|
||||
type PutApiReverseProxyProxyIdJSONRequestBody = ReverseProxyRequest
|
||||
// PutApiReverseProxiesProxyIdJSONRequestBody defines body for PutApiReverseProxiesProxyId for application/json ContentType.
|
||||
type PutApiReverseProxiesProxyIdJSONRequestBody = ReverseProxyRequest
|
||||
|
||||
// PostApiRoutesJSONRequestBody defines body for PostApiRoutes for application/json ContentType.
|
||||
type PostApiRoutesJSONRequestBody = RouteRequest
|
||||
|
||||
Reference in New Issue
Block a user