Documentation
¶
Index ¶
- Constants
- Variables
- type AdminResponse
- type AsideLeftMetadata
- type AuditLogJSON
- type AuditLogTemplateData
- type CarveData
- type CarveJSON
- type CarveProgress
- type CarveTarget
- type CarvesDetailsTemplateData
- type CarvesRunTemplateData
- type CarvesTableTemplateData
- type ConfTemplateData
- type ConfigurationRequest
- type CreationTimes
- type DashboardTemplateData
- type DistributedCarvesActionRequest
- type DistributedQueryActionRequest
- type DistributedQueryRequest
- type EnrollRequest
- type EnrollTemplateData
- type EnvironmentsRequest
- type EnvironmentsTemplateData
- type ExpirationRequest
- type GenericTableTemplateData
- type HandlersAdmin
- func (h *HandlersAdmin) AuditLogsGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesDetailsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesDownloadHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesListGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesRunGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) CarvesRunPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) ConfGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) ConfPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) DashboardGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EditProfileGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EditProfilePOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnrollDownloadHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnrollGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnrollPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnvironmentHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnvsGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) EnvsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) ErrorHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) ExpirationPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) FaviconHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) ForbiddenHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) HealthHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) IntervalsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONAuditLogHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONCarvesHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONDownloadQueryLogsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONEnvironmentPagingHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONLogsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONNodeSearchHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONQueryHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONQueryJSON(q queries.DistributedQuery, env string) QueryJSON
- func (h *HandlersAdmin) JSONQueryLogsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONSavedJSON(q queries.SavedQuery) SavedJSON
- func (h *HandlersAdmin) JSONStatsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) JSONTagsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) LoginHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) LoginPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) LogoutPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) NewTemplateFiles(base string, layoutFilename string) *TemplateFiles
- func (h *HandlersAdmin) NodeActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) NodeHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) PermissionsGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) PermissionsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) QueryListGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) QueryLogsHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) QueryRunGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) QueryRunPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) RootHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) SavedQueriesGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) SavedQueriesPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) SettingsGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) SettingsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) TagNodesPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) TagsGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) TagsPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) TemplateMetadata(ctx sessions.ContextValue, metadata types.BuildMetadata, admin bool) TemplateMetadata
- func (h *HandlersAdmin) TokensGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) TokensPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) UsersGETHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) UsersPOSTHandler(w http.ResponseWriter, r *http.Request)
- func (h *HandlersAdmin) UsersTokensGETHandler(w http.ResponseWriter, r *http.Request)
- type HandlersOption
- func WithAdminConfig(config *config.JSONConfigurationService) HandlersOption
- func WithAuditLog(auditLog *auditlog.AuditLogManager) HandlersOption
- func WithCache(rds *cache.RedisManager) HandlersOption
- func WithCarves(carves *carves.Carves) HandlersOption
- func WithCarvesFolder(carves string) HandlersOption
- func WithDB(db *gorm.DB) HandlersOption
- func WithDBLogger(dbfile string, config *backend.JSONConfigurationDB) HandlersOption
- func WithDebugHTTP(cfg *config.DebugHTTPConfiguration) HandlersOption
- func WithEnvs(envs *environments.EnvManager) HandlersOption
- func WithMetadata(metadata types.BuildMetadata) HandlersOption
- func WithNodes(nodes *nodes.NodeManager) HandlersOption
- func WithOsqueryTables(tables []types.OsqueryTable) HandlersOption
- func WithOsqueryValues(values config.OsqueryConfiguration) HandlersOption
- func WithQueries(queries *queries.Queries) HandlersOption
- func WithSessions(sessions *sessions.SessionManager) HandlersOption
- func WithSettings(settings *settings.Settings) HandlersOption
- func WithStaticLocation(offline bool) HandlersOption
- func WithTags(tags *tags.TagManager) HandlersOption
- func WithTemplates(templates string) HandlersOption
- func WithUsers(users *users.UserManager) HandlersOption
- type IntervalsRequest
- type LogJSON
- type LoginRequest
- type LoginTemplateData
- type LogoutRequest
- type NodeJSON
- type NodeMultiActionRequest
- type NodeTemplateData
- type PaginatedNodes
- type PermissionsRequest
- type ProfileRequest
- type ProfileTemplateData
- type QueryData
- type QueryJSON
- type QueryLogJSON
- type QueryLogsTemplateData
- type QueryProgress
- type QueryRunTemplateData
- type QueryTableTemplateData
- type QueryTarget
- type QueryTargetNode
- type ReturnedAudit
- type ReturnedCarves
- type ReturnedLogs
- type ReturnedNodes
- type ReturnedQueries
- type ReturnedQueryLogs
- type ReturnedSaved
- type SavedJSON
- type SavedQueriesTemplateData
- type SavedQueryRequest
- type Select2Response
- type Select2Result
- type SettingsRequest
- type SettingsTemplateData
- type TableTemplateData
- type TagNodesRequest
- type TagsRequest
- type TagsTemplateData
- type TemplateFiles
- type TemplateMetadata
- type TokenJSON
- type TokenRequest
- type TokenResponse
- type TokensTemplateData
- type UsersRequest
- type UsersTemplateData
Constants ¶
const ( QueryLink string = "/query/{{ENV}}/logs/{{NAME}}" StatusLink string = "#status-logs" ResultsLink string = "#result-logs" )
const (
// DefaultNodeSearchLimit is the default maximum number of results for node search
DefaultNodeSearchLimit = 50
)
Variables ¶
var ( CarvesTargets = map[string]bool{ "all": true, "active": true, "completed": true, } )
Define targets to be used
Define log types to be used
Define targets to be used
var ( QueryTargets = map[string]bool{ queries.TargetAll: true, queries.TargetActive: true, queries.TargetCompleted: true, queries.TargetSaved: true, queries.TargetExpired: true, } )
Define targets to be used
var ( StatsTargets = map[string]bool{ "environment": true, "platform": true, } )
Define targets to be used
Functions ¶
This section is empty.
Types ¶
type AdminResponse ¶
type AdminResponse struct {
Message string `json:"message"`
}
AdminResponse to be returned to requests
type AsideLeftMetadata ¶
type AsideLeftMetadata struct {
EnvUUID string
EnvName string
ActiveNode bool
InactiveNode bool
NodeUUID string
Query bool
QueryName string
Carve bool
CarveName string
OsqueryValues config.OsqueryConfiguration
}
AsideLeftMetadata to pass metadata to the aside left menu
type AuditLogJSON ¶ added in v0.4.8
type AuditLogJSON struct {
Service string `json:"service"`
Username string `json:"username"`
Line string `json:"line"`
SourceIP string `json:"sourceip"`
LogType string `json:"logtype"`
Severity string `json:"severity"`
Env string `json:"environment"`
When CreationTimes `json:"when"`
}
AuditLogJSON to be used to populate JSON data for audit logs
type AuditLogTemplateData ¶ added in v0.4.8
type AuditLogTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
AuditLogTemplateData for passing data to the audit log template
type CarveJSON ¶
type CarveJSON struct {
Checkbox string `json:"checkbox"`
Name string `json:"name"`
Creator string `json:"creator"`
Path CarveData `json:"path"`
Created CreationTimes `json:"created"`
Status string `json:"status"`
Progress CarveProgress `json:"progress"`
Targets []CarveTarget `json:"targets"`
}
CarveJSON to be used to populate JSON data for a carve
type CarveProgress ¶
CarveProgress to be used to show progress for a carve
type CarveTarget ¶
CarveTarget to be returned with the JSON data for a carve
type CarvesDetailsTemplateData ¶
type CarvesDetailsTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Query queries.DistributedQuery
QueryTargets []CarveTarget
Carves []carves.CarvedFile
CarveBlocks map[string][]carves.CarvedBlock
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
CarvesDetailsTemplateData for passing data to the carves details
type CarvesRunTemplateData ¶
type CarvesRunTemplateData QueryRunTemplateData
CarvesRunTemplateData for passing data to the carves run template
type CarvesTableTemplateData ¶
type CarvesTableTemplateData GenericTableTemplateData
CarvesTableTemplateData for passing data to the carves template
type ConfTemplateData ¶
type ConfTemplateData struct {
Title string
Environment environments.TLSEnvironment
Environments []environments.TLSEnvironment
Platforms []string
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
ConfTemplateData for passing data to the conf template
type ConfigurationRequest ¶
type ConfigurationRequest struct {
CSRFToken string `json:"csrftoken"`
ConfigurationB64 string `json:"configuration"`
OptionsB64 string `json:"options"`
ScheduleB64 string `json:"schedule"`
PacksB64 string `json:"packs"`
DecoratorsB64 string `json:"decorators"`
ATCB64 string `json:"atc"`
}
ConfigurationRequest to receive changes to configuration
type CreationTimes ¶
CreationTimes to hold creation times
type DashboardTemplateData ¶
type DashboardTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
CurrentUser users.AdminUser
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
DashboardTemplateData for passing data to the dashboard template
type DistributedCarvesActionRequest ¶
type DistributedCarvesActionRequest struct {
CSRFToken string `json:"csrftoken"`
IDs []string `json:"ids"`
Action string `json:"action"`
}
DistributedCarvesActionRequest to receive carves requests
type DistributedQueryActionRequest ¶
type DistributedQueryActionRequest struct {
CSRFToken string `json:"csrftoken"`
Names []string `json:"names"`
Action string `json:"action"`
}
DistributedQueryActionRequest to receive query requests
type DistributedQueryRequest ¶
type DistributedQueryRequest struct {
CSRFToken string `json:"csrftoken"`
Environments []string `json:"environment_list"`
Platforms []string `json:"platform_list"`
UUIDs []string `json:"uuid_list"`
Hosts []string `json:"host_list"`
Tags []string `json:"tag_list"`
Save bool `json:"save"`
Name string `json:"name"`
Query string `json:"query"`
Path string `json:"path"`
ExpHours int `json:"exp_hours"`
}
DistributedQueryRequest to receive query requests
type EnrollRequest ¶
type EnrollRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
CertificateB64 string `json:"certificate"`
PackageURL string `json:"packageurl"`
}
EnrollRequest to receive changes to enroll certificates
type EnrollTemplateData ¶
type EnrollTemplateData struct {
Title string
OnelinerExpiration bool
EnrollExpiry string
EnrollExpired bool
DisplayPackages bool
DebPackage string
DebPackageURL string
RpmPackage string
RpmPackageURL string
MsiPackage string
MsiPackageURL string
PkgPackage string
PkgPackageURL string
RemoveExpiry string
RemoveExpired bool
QuickAddShell string
QuickRemoveShell string
QuickAddPowershell string
QuickRemovePowershell string
Secret string
Flags string
Certificate string
Environments []environments.TLSEnvironment
Platforms []string
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
EnrollTemplateData for passing data to the conf template
type EnvironmentsRequest ¶
type EnvironmentsRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
UUID string `json:"uuid"`
Name string `json:"name"`
Hostname string `json:"hostname"`
Type string `json:"type"`
Icon string `json:"icon"`
DebugHTTP bool `json:"debughttp"`
}
EnvironmentsRequest to receive changes to environments
type EnvironmentsTemplateData ¶
type EnvironmentsTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
EnvironmentsTemplateData for passing data to the environments template
type ExpirationRequest ¶
type ExpirationRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
Type string `json:"type"`
}
ExpirationRequest to receive expiration changes to enroll/remove nodes
type GenericTableTemplateData ¶
type GenericTableTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Target string
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
GenericTableTemplateData for passing data to a table template
type HandlersAdmin ¶
type HandlersAdmin struct {
DB *gorm.DB
Users *users.UserManager
Tags *tags.TagManager
Envs *environments.EnvManager
Nodes *nodes.NodeManager
Queries *queries.Queries
Carves *carves.Carves
Settings *settings.Settings
RedisCache *cache.RedisManager
Sessions *sessions.SessionManager
ServiceMetadata types.BuildMetadata
OsqueryValues config.OsqueryConfiguration
TemplatesFolder string
StaticLocation string
CarvesFolder string
OsqueryTables []types.OsqueryTable
AdminConfig *config.JSONConfigurationService
AuditLog *auditlog.AuditLogManager
DBLogger *logging.LoggerDB
DebugHTTP *zerolog.Logger
DebugHTTPConfig *config.DebugHTTPConfiguration
}
HandlersAdmin to keep all handlers for TLS
func CreateHandlersAdmin ¶
func CreateHandlersAdmin(opts ...HandlersOption) *HandlersAdmin
CreateHandlersAdmin to initialize the Admin handlers struct
func (*HandlersAdmin) AuditLogsGETHandler ¶ added in v0.4.8
func (h *HandlersAdmin) AuditLogsGETHandler(w http.ResponseWriter, r *http.Request)
AuditLogsGETHandler for GET requests for /audit-logs
func (*HandlersAdmin) CarvesActionsPOSTHandler ¶
func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
CarvesActionsPOSTHandler - Handler for POST requests to carves
func (*HandlersAdmin) CarvesDetailsHandler ¶
func (h *HandlersAdmin) CarvesDetailsHandler(w http.ResponseWriter, r *http.Request)
CarvesDetailsHandler for GET requests to see carves details by name
func (*HandlersAdmin) CarvesDownloadHandler ¶
func (h *HandlersAdmin) CarvesDownloadHandler(w http.ResponseWriter, r *http.Request)
CarvesDownloadHandler for GET requests to download carves
func (*HandlersAdmin) CarvesListGETHandler ¶
func (h *HandlersAdmin) CarvesListGETHandler(w http.ResponseWriter, r *http.Request)
CarvesListGETHandler for GET requests to carves
func (*HandlersAdmin) CarvesRunGETHandler ¶
func (h *HandlersAdmin) CarvesRunGETHandler(w http.ResponseWriter, r *http.Request)
CarvesRunGETHandler for GET requests to run file carves
func (*HandlersAdmin) CarvesRunPOSTHandler ¶
func (h *HandlersAdmin) CarvesRunPOSTHandler(w http.ResponseWriter, r *http.Request)
CarvesRunPOSTHandler for POST requests to run file carves
func (*HandlersAdmin) ConfGETHandler ¶
func (h *HandlersAdmin) ConfGETHandler(w http.ResponseWriter, r *http.Request)
ConfGETHandler for GET requests for /conf
func (*HandlersAdmin) ConfPOSTHandler ¶
func (h *HandlersAdmin) ConfPOSTHandler(w http.ResponseWriter, r *http.Request)
ConfPOSTHandler for POST requests for saving configuration
func (*HandlersAdmin) DashboardGETHandler ¶
func (h *HandlersAdmin) DashboardGETHandler(w http.ResponseWriter, r *http.Request)
DashboardGETHandler for dashboard page
func (*HandlersAdmin) EditProfileGETHandler ¶
func (h *HandlersAdmin) EditProfileGETHandler(w http.ResponseWriter, r *http.Request)
EditProfileGETHandler for user profile edit
func (*HandlersAdmin) EditProfilePOSTHandler ¶
func (h *HandlersAdmin) EditProfilePOSTHandler(w http.ResponseWriter, r *http.Request)
EditProfilePOSTHandler for POST requests to edit profile
func (*HandlersAdmin) EnrollDownloadHandler ¶
func (h *HandlersAdmin) EnrollDownloadHandler(w http.ResponseWriter, r *http.Request)
EnrollGETHandler for GET requests for /enroll
func (*HandlersAdmin) EnrollGETHandler ¶
func (h *HandlersAdmin) EnrollGETHandler(w http.ResponseWriter, r *http.Request)
EnrollGETHandler for GET requests for /enroll
func (*HandlersAdmin) EnrollPOSTHandler ¶
func (h *HandlersAdmin) EnrollPOSTHandler(w http.ResponseWriter, r *http.Request)
EnrollPOSTHandler for POST requests enroll data
func (*HandlersAdmin) EnvironmentHandler ¶
func (h *HandlersAdmin) EnvironmentHandler(w http.ResponseWriter, r *http.Request)
EnvironmentHandler for environment view of the table
func (*HandlersAdmin) EnvsGETHandler ¶
func (h *HandlersAdmin) EnvsGETHandler(w http.ResponseWriter, r *http.Request)
EnvsGETHandler for GET requests for /env
func (*HandlersAdmin) EnvsPOSTHandler ¶
func (h *HandlersAdmin) EnvsPOSTHandler(w http.ResponseWriter, r *http.Request)
EnvsPOSTHandler for POST request for /environments
func (*HandlersAdmin) ErrorHandler ¶
func (h *HandlersAdmin) ErrorHandler(w http.ResponseWriter, r *http.Request)
ErrorHandler for error requests
func (*HandlersAdmin) ExpirationPOSTHandler ¶
func (h *HandlersAdmin) ExpirationPOSTHandler(w http.ResponseWriter, r *http.Request)
ExpirationPOSTHandler for POST requests for expiring enroll links
func (*HandlersAdmin) FaviconHandler ¶
func (h *HandlersAdmin) FaviconHandler(w http.ResponseWriter, r *http.Request)
FaviconHandler for the favicon
func (*HandlersAdmin) ForbiddenHandler ¶
func (h *HandlersAdmin) ForbiddenHandler(w http.ResponseWriter, r *http.Request)
ForbiddenHandler for forbidden error requests
func (*HandlersAdmin) HealthHandler ¶
func (h *HandlersAdmin) HealthHandler(w http.ResponseWriter, r *http.Request)
HealthHandler for health requests
func (*HandlersAdmin) IntervalsPOSTHandler ¶
func (h *HandlersAdmin) IntervalsPOSTHandler(w http.ResponseWriter, r *http.Request)
IntervalsPOSTHandler for POST requests for saving intervals
func (*HandlersAdmin) JSONAuditLogHandler ¶ added in v0.4.8
func (h *HandlersAdmin) JSONAuditLogHandler(w http.ResponseWriter, r *http.Request)
JSONAuditLogHandler for audit logs in JSON
func (*HandlersAdmin) JSONCarvesHandler ¶
func (h *HandlersAdmin) JSONCarvesHandler(w http.ResponseWriter, r *http.Request)
JSONCarvesHandler for JSON carves by target
func (*HandlersAdmin) JSONDownloadQueryLogsHandler ¶ added in v0.4.8
func (h *HandlersAdmin) JSONDownloadQueryLogsHandler(w http.ResponseWriter, r *http.Request)
JSONDownloadQueryLogsHandler for JSON query logs by query name
func (*HandlersAdmin) JSONEnvironmentPagingHandler ¶ added in v0.4.8
func (h *HandlersAdmin) JSONEnvironmentPagingHandler(w http.ResponseWriter, r *http.Request)
JSONEnvironmentPagingHandler - Handler for JSON endpoints by environment, with pagination
func (*HandlersAdmin) JSONLogsHandler ¶
func (h *HandlersAdmin) JSONLogsHandler(w http.ResponseWriter, r *http.Request)
JSONLogsHandler GET requests for JSON status/result logs by node and environment
func (*HandlersAdmin) JSONNodeSearchHandler ¶ added in v0.4.8
func (h *HandlersAdmin) JSONNodeSearchHandler(w http.ResponseWriter, r *http.Request)
JSONNodeSearchHandler - Handler for searching nodes by UUID or hostname (for Select2 AJAX)
func (*HandlersAdmin) JSONQueryHandler ¶
func (h *HandlersAdmin) JSONQueryHandler(w http.ResponseWriter, r *http.Request)
JSONQueryHandler - Handler for JSON queries by target
func (*HandlersAdmin) JSONQueryJSON ¶
func (h *HandlersAdmin) JSONQueryJSON(q queries.DistributedQuery, env string) QueryJSON
JSONQueryJSON - Helper to convert saved distributed queries to serialized JSON
func (*HandlersAdmin) JSONQueryLogsHandler ¶
func (h *HandlersAdmin) JSONQueryLogsHandler(w http.ResponseWriter, r *http.Request)
JSONQueryLogsHandler for JSON query logs by query name
func (*HandlersAdmin) JSONSavedJSON ¶
func (h *HandlersAdmin) JSONSavedJSON(q queries.SavedQuery) SavedJSON
JSONSavedJSON - Helper to convert saved queries to serialized JSON
func (*HandlersAdmin) JSONStatsHandler ¶
func (h *HandlersAdmin) JSONStatsHandler(w http.ResponseWriter, r *http.Request)
JSONStatsHandler for platform/environment stats in JSON
func (*HandlersAdmin) JSONTagsHandler ¶
func (h *HandlersAdmin) JSONTagsHandler(w http.ResponseWriter, r *http.Request)
JSONTagsHandler for platform/environment stats in JSON
func (*HandlersAdmin) LoginHandler ¶
func (h *HandlersAdmin) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler for login page for GET requests
func (*HandlersAdmin) LoginPOSTHandler ¶
func (h *HandlersAdmin) LoginPOSTHandler(w http.ResponseWriter, r *http.Request)
LoginPOSTHandler for login page for POST requests
func (*HandlersAdmin) LogoutPOSTHandler ¶
func (h *HandlersAdmin) LogoutPOSTHandler(w http.ResponseWriter, r *http.Request)
LogoutPOSTHandler for POST requests to logout
func (*HandlersAdmin) NewTemplateFiles ¶
func (h *HandlersAdmin) NewTemplateFiles(base string, layoutFilename string) *TemplateFiles
NewTemplateFiles defines based on layout and default static pages
func (*HandlersAdmin) NodeActionsPOSTHandler ¶
func (h *HandlersAdmin) NodeActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
NodeActionsPOSTHandler for POST requests for multi node action
func (*HandlersAdmin) NodeHandler ¶
func (h *HandlersAdmin) NodeHandler(w http.ResponseWriter, r *http.Request)
NodeHandler for node view
func (*HandlersAdmin) PermissionsGETHandler ¶
func (h *HandlersAdmin) PermissionsGETHandler(w http.ResponseWriter, r *http.Request)
PermissionsGETHandler for platform/environment stats in JSON
func (*HandlersAdmin) PermissionsPOSTHandler ¶
func (h *HandlersAdmin) PermissionsPOSTHandler(w http.ResponseWriter, r *http.Request)
PermissionsPOSTHandler for POST request for /users/permissions
func (*HandlersAdmin) QueryActionsPOSTHandler ¶
func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.Request)
QueryActionsPOSTHandler for POST requests to queries
func (*HandlersAdmin) QueryListGETHandler ¶
func (h *HandlersAdmin) QueryListGETHandler(w http.ResponseWriter, r *http.Request)
QueryListGETHandler for GET requests to queries
func (*HandlersAdmin) QueryLogsHandler ¶
func (h *HandlersAdmin) QueryLogsHandler(w http.ResponseWriter, r *http.Request)
QueryLogsHandler for GET requests to see query results by name
func (*HandlersAdmin) QueryRunGETHandler ¶
func (h *HandlersAdmin) QueryRunGETHandler(w http.ResponseWriter, r *http.Request)
QueryRunGETHandler for GET requests to run queries
func (*HandlersAdmin) QueryRunPOSTHandler ¶
func (h *HandlersAdmin) QueryRunPOSTHandler(w http.ResponseWriter, r *http.Request)
QueryRunPOSTHandler for POST requests to run queries
func (*HandlersAdmin) RootHandler ¶
func (h *HandlersAdmin) RootHandler(w http.ResponseWriter, r *http.Request)
RootHandler - Handler for the root path
func (*HandlersAdmin) SavedQueriesGETHandler ¶
func (h *HandlersAdmin) SavedQueriesGETHandler(w http.ResponseWriter, r *http.Request)
SavedQueriesGETHandler for GET requests to queries
func (*HandlersAdmin) SavedQueriesPOSTHandler ¶
func (h *HandlersAdmin) SavedQueriesPOSTHandler(w http.ResponseWriter, r *http.Request)
SavedQueriesPOSTHandler for POST requests to save queries
func (*HandlersAdmin) SettingsGETHandler ¶
func (h *HandlersAdmin) SettingsGETHandler(w http.ResponseWriter, r *http.Request)
SettingsGETHandler for GET requests for /settings
func (*HandlersAdmin) SettingsPOSTHandler ¶
func (h *HandlersAdmin) SettingsPOSTHandler(w http.ResponseWriter, r *http.Request)
SettingsPOSTHandler for POST request for /settings
func (*HandlersAdmin) TagNodesPOSTHandler ¶
func (h *HandlersAdmin) TagNodesPOSTHandler(w http.ResponseWriter, r *http.Request)
TagNodesPOSTHandler for POST request for /tags/nodes
func (*HandlersAdmin) TagsGETHandler ¶
func (h *HandlersAdmin) TagsGETHandler(w http.ResponseWriter, r *http.Request)
TagsGETHandler for GET requests for /tags
func (*HandlersAdmin) TagsPOSTHandler ¶
func (h *HandlersAdmin) TagsPOSTHandler(w http.ResponseWriter, r *http.Request)
TagsPOSTHandler for POST request for /tags
func (*HandlersAdmin) TemplateMetadata ¶
func (h *HandlersAdmin) TemplateMetadata(ctx sessions.ContextValue, metadata types.BuildMetadata, admin bool) TemplateMetadata
TemplateMetadata - Helper to prepare template metadata
func (*HandlersAdmin) TokensGETHandler ¶
func (h *HandlersAdmin) TokensGETHandler(w http.ResponseWriter, r *http.Request)
TokensGETHandler for GET requests for /tokens/{username}
func (*HandlersAdmin) TokensPOSTHandler ¶
func (h *HandlersAdmin) TokensPOSTHandler(w http.ResponseWriter, r *http.Request)
TokensPOSTHandler for POST request for /tokens/{username}/refresh
func (*HandlersAdmin) UsersGETHandler ¶
func (h *HandlersAdmin) UsersGETHandler(w http.ResponseWriter, r *http.Request)
UsersGETHandler for GET requests for /users
func (*HandlersAdmin) UsersPOSTHandler ¶
func (h *HandlersAdmin) UsersPOSTHandler(w http.ResponseWriter, r *http.Request)
UsersPOSTHandler for POST request for /users
func (*HandlersAdmin) UsersTokensGETHandler ¶ added in v0.4.7
func (h *HandlersAdmin) UsersTokensGETHandler(w http.ResponseWriter, r *http.Request)
UsersTokensGETHandler for GET requests for /users/tokens
type HandlersOption ¶
type HandlersOption func(*HandlersAdmin)
func WithAdminConfig ¶
func WithAdminConfig(config *config.JSONConfigurationService) HandlersOption
func WithAuditLog ¶ added in v0.4.8
func WithAuditLog(auditLog *auditlog.AuditLogManager) HandlersOption
func WithCache ¶
func WithCache(rds *cache.RedisManager) HandlersOption
func WithCarves ¶
func WithCarves(carves *carves.Carves) HandlersOption
func WithCarvesFolder ¶
func WithCarvesFolder(carves string) HandlersOption
func WithDB ¶
func WithDB(db *gorm.DB) HandlersOption
func WithDBLogger ¶
func WithDBLogger(dbfile string, config *backend.JSONConfigurationDB) HandlersOption
func WithDebugHTTP ¶ added in v0.4.5
func WithDebugHTTP(cfg *config.DebugHTTPConfiguration) HandlersOption
func WithEnvs ¶
func WithEnvs(envs *environments.EnvManager) HandlersOption
func WithMetadata ¶ added in v0.4.6
func WithMetadata(metadata types.BuildMetadata) HandlersOption
func WithNodes ¶
func WithNodes(nodes *nodes.NodeManager) HandlersOption
func WithOsqueryTables ¶
func WithOsqueryTables(tables []types.OsqueryTable) HandlersOption
func WithOsqueryValues ¶ added in v0.4.7
func WithOsqueryValues(values config.OsqueryConfiguration) HandlersOption
func WithQueries ¶
func WithQueries(queries *queries.Queries) HandlersOption
func WithSessions ¶
func WithSessions(sessions *sessions.SessionManager) HandlersOption
func WithSettings ¶
func WithSettings(settings *settings.Settings) HandlersOption
func WithStaticLocation ¶
func WithStaticLocation(offline bool) HandlersOption
func WithTags ¶
func WithTags(tags *tags.TagManager) HandlersOption
func WithTemplates ¶
func WithTemplates(templates string) HandlersOption
func WithUsers ¶
func WithUsers(users *users.UserManager) HandlersOption
type IntervalsRequest ¶
type IntervalsRequest struct {
CSRFToken string `json:"csrftoken"`
ConfigInterval int `json:"config"`
LogInterval int `json:"log"`
QueryInterval int `json:"query"`
}
IntervalsRequest to receive changes to intervals
type LogJSON ¶
type LogJSON struct {
Created CreationTimes `json:"created"`
First string `json:"first"`
Second string `json:"second"`
}
LogJSON to be used to populate JSON data for a status/result log
type LoginRequest ¶
LoginRequest to receive login credentials
type LoginTemplateData ¶
LoginTemplateData for passing data to the login template
type LogoutRequest ¶
type LogoutRequest struct {
CSRFToken string `json:"csrftoken"`
}
LogoutRequest to receive logout requests
type NodeJSON ¶
type NodeJSON struct {
Checkbox string `json:"checkbox"`
UUID string `json:"uuid"`
Username string `json:"username"`
Localname string `json:"localname"`
IP string `json:"ip"`
Platform string `json:"platform"`
Version string `json:"version"`
Osquery string `json:"osquery"`
LastSeen CreationTimes `json:"lastseen"`
FirstSeen CreationTimes `json:"firstseen"`
}
NodeJSON to be used to populate JSON data for a node
type NodeMultiActionRequest ¶
type NodeMultiActionRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
UUIDs []string `json:"uuids"`
}
NodeMultiActionRequest to receive node action requests
type NodeTemplateData ¶
type NodeTemplateData struct {
Title string
Node nodes.OsqueryNode
NodeTags []tags.AdminTag
TagsForNode []tags.AdminTagForNode
Environments []environments.TLSEnvironment
Platforms []string
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
Dashboard bool
Schedule environments.ScheduleConf
Packs environments.PacksEntries
ServiceConfig config.JSONConfigurationService
}
NodeTemplateData for passing data to the query template
type PaginatedNodes ¶ added in v0.4.8
type PaginatedNodes struct {
Draw int `json:"draw"`
Total int `json:"recordsTotal"`
Filtered int `json:"recordsFiltered"`
Data []NodeJSON `json:"data"`
}
PaginatedNodes to return a JSON with nodes, paginated
type PermissionsRequest ¶
type PermissionsRequest struct {
CSRFToken string `json:"csrftoken"`
Environment string `json:"environment"`
Read bool `json:"read"`
Query bool `json:"query"`
Carve bool `json:"carve"`
Admin bool `json:"admin"`
}
PermissionsRequest to receive user permissions changes requests
type ProfileRequest ¶
type ProfileRequest struct {
CSRFToken string `json:"csrftoken"`
Username string `json:"username"`
}
ProfileRequest to receive user profile changes requests
type ProfileTemplateData ¶
type ProfileTemplateData struct {
Title string
Environments []environments.TLSEnvironment
CurrentUser users.AdminUser
Permissions users.UserAccess
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
ProfileTemplateData for passing data to the users profile template
type QueryJSON ¶
type QueryJSON struct {
Checkbox string `json:"checkbox"`
Name string `json:"name"`
Creator string `json:"creator"`
Query QueryData `json:"query"`
Created CreationTimes `json:"created"`
Status string `json:"status"`
Progress QueryProgress `json:"progress"`
Targets []QueryTarget `json:"targets"`
}
QueryJSON to be used to populate JSON data for a distributed query
type QueryLogJSON ¶
type QueryLogJSON struct {
Created CreationTimes `json:"created"`
Target QueryTargetNode `json:"target"`
Data string `json:"data"`
}
QueryLogJSON to be used to populate JSON data for a query log
type QueryLogsTemplateData ¶
type QueryLogsTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Query queries.DistributedQuery
QueryTargets []QueryTarget
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
ServiceConfig config.JSONConfigurationService
}
QueryLogsTemplateData for passing data to the query template
type QueryProgress ¶
QueryProgress to be used to show progress for a query
type QueryRunTemplateData ¶
type QueryRunTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Tags []string
Tables []types.OsqueryTable
OsqueryValues config.OsqueryConfiguration
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
QueryRunTemplateData for passing data to the query run template
type QueryTableTemplateData ¶
type QueryTableTemplateData GenericTableTemplateData
QueryTableTemplateData for passing data to the query template
type QueryTarget ¶
QueryTarget to be returned with the JSON data for a query
type QueryTargetNode ¶
QueryTargetNode to return the target of a on-demand query
type ReturnedAudit ¶ added in v0.4.8
type ReturnedAudit struct {
Data []AuditLogJSON `json:"data"`
}
ReturnedAudit to return a JSON with audit logs
type ReturnedCarves ¶
type ReturnedCarves struct {
Data []CarveJSON `json:"data"`
}
ReturnedCarves to return a JSON with carves
type ReturnedLogs ¶
type ReturnedLogs struct {
Data []LogJSON `json:"data"`
}
ReturnedLogs to return a JSON with status/result logs
type ReturnedNodes ¶
type ReturnedNodes struct {
Data []NodeJSON `json:"data"`
}
ReturnedNodes to return a JSON with nodes
type ReturnedQueries ¶
type ReturnedQueries struct {
Data []QueryJSON `json:"data"`
}
ReturnedQueries to return a JSON with distributed queries
type ReturnedQueryLogs ¶
type ReturnedQueryLogs struct {
Data []QueryLogJSON `json:"data"`
Download string `json:"download"`
}
ReturnedQueryLogs to return a JSON with query logs
type ReturnedSaved ¶
type ReturnedSaved struct {
Data []SavedJSON `json:"data"`
}
ReturnedSaved to return a JSON with saved queries
type SavedJSON ¶
type SavedJSON struct {
Checkbox string `json:"checkbox"`
Name string `json:"name"`
Creator string `json:"creator"`
Query string `json:"query"`
Created CreationTimes `json:"created"`
}
SavedJSON to be used to populate JSON data for a saved query
type SavedQueriesTemplateData ¶
type SavedQueriesTemplateData GenericTableTemplateData
SavedQueriesTemplateData for passing data to the saved queries
type SavedQueryRequest ¶
type SavedQueryRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
Name string `json:"name"`
Query string `json:"query"`
}
SavedQueryRequest to receive saved query requests
type Select2Response ¶ added in v0.4.8
type Select2Response struct {
Results []Select2Result `json:"results"`
}
Select2Response represents the response structure for Select2 AJAX requests
type Select2Result ¶ added in v0.4.8
Select2Result represents a single result item for Select2
type SettingsRequest ¶
type SettingsRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
Boolean bool `json:"boolean"`
Type string `json:"type"`
Name string `json:"name"`
Value string `json:"value"`
}
SettingsRequest to receive changes to settings
type SettingsTemplateData ¶
type SettingsTemplateData struct {
Title string
Service string
Environments []environments.TLSEnvironment
Platforms []string
CurrentSettings []settings.SettingValue
ServiceConfig config.JSONConfigurationService
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
SettingsTemplateData for passing data to the settings template
type TableTemplateData ¶
type TableTemplateData struct {
Title string
Selector string
SelectorName string
Target string
Tags []tags.AdminTag
Environments []environments.TLSEnvironment
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
TableTemplateData for passing data to the table template
type TagNodesRequest ¶
type TagNodesRequest struct {
CSRFToken string `json:"csrftoken"`
UUIDs []string `json:"uuids"`
TagsAdd []string `json:"tagsadd"`
TagsRemove []string `json:"tagsremove"`
}
TagNodesRequest to receive a tag for nodes
type TagsRequest ¶
type TagsRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
Name string `json:"name"`
Description string `json:"description"`
Color string `json:"color"`
Icon string `json:"icon"`
Environment string `json:"environment"`
TagType uint `json:"tagtype"`
Custom string `json:"custom"`
}
TagsRequest to receive tag action requests
type TagsTemplateData ¶
type TagsTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
Tags []tags.AdminTag
CounterTags tags.TagCounter
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
TagsTemplateData for passing data to the tags template
type TemplateFiles ¶
type TemplateFiles struct {
// contains filtered or unexported fields
}
TemplateFiles for building UI layout
type TemplateMetadata ¶
type TemplateMetadata struct {
Username string
Admin bool
Service string
Version string
Commit string
BuildDate string
CSRFToken string
}
TemplateMetadata to pass some metadata to templates
type TokenJSON ¶
type TokenJSON struct {
Token string `json:"token"`
Expires string `json:"expires"`
ExpiresTS string `json:"expires_ts"`
}
TokenJSON to be used to populate a JSON token
type TokenRequest ¶
type TokenRequest struct {
CSRFToken string `json:"csrftoken"`
Username string `json:"username"`
ExpHours int `json:"exp_hours"`
}
TokenRequest to receive API token related requests
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
Expiration string `json:"expiration"`
ExpirationTS string `json:"exp_ts"`
}
TokenResponse to be returned to API token requests
type TokensTemplateData ¶ added in v0.4.7
type TokensTemplateData struct {
Title string
Environments []environments.TLSEnvironment
SystemUsers []users.AdminUser
ServiceUsers []users.AdminUser
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
TokensTemplateData for passing data to the users template
type UsersRequest ¶
type UsersRequest struct {
CSRFToken string `json:"csrftoken"`
Action string `json:"action"`
Username string `json:"username"`
Email string `json:"email"`
Fullname string `json:"fullname"`
OldPassword string `json:"old_password"`
NewPassword string `json:"new_password"`
Token bool `json:"token"`
Admin bool `json:"admin"`
Service bool `json:"service"`
Environments []string `json:"environments"`
}
UsersRequest to receive user action requests
type UsersTemplateData ¶
type UsersTemplateData struct {
Title string
Environments []environments.TLSEnvironment
Platforms []string
SystemUsers []users.AdminUser
ServiceUsers []users.AdminUser
Metadata TemplateMetadata
LeftMetadata AsideLeftMetadata
}
UsersTemplateData for passing data to the users template