Documentation ¶
Index ¶
- func ClearSyscheckDatabaseRequest(ctx context.Context, client *Client, path string) (*ClearSyscheckDatabaseResponse, error)
- func DoDelete(ctx context.Context, client *Client, path string, intf interface{}) error
- func DoGet(ctx context.Context, client httpClient, req *http.Request, intf interface{}) error
- func DoPost(ctx context.Context, client httpClient, req *http.Request, intf interface{}) error
- func DoPut(ctx context.Context, client httpClient, req *http.Request, intf interface{}) error
- func GetAllDecodersRequest(ctx context.Context, client *Client, path string) (*GetDecodersResponse, error)
- func GetAnalysisdStatsRequest(ctx context.Context, client *Client, path string) (*GetAnalysisdStatsResponse, error)
- func GetDecoderByNameRequest(ctx context.Context, client *Client, path string) (*GetDecodersResponse, error)
- func GetDecoderFilesRequest(ctx context.Context, client *Client, path string) (*GetDecoderFilesResponse, error)
- func GetHardwareInfoRequest(ctx context.Context, client *Client, path string) (*GetHardwareInfoResponse, error)
- func GetJson(ctx context.Context, client *Client, path string, intf interface{}) error
- func GetLastSyscheckScanRequest(ctx context.Context, client *Client, path string) (*GetLastSyscheckScanResponse, error)
- func GetLogSummaryRequest(ctx context.Context, client *Client, path string) (*GetLogSummaryResponse, error)
- func GetLogsRequest(ctx context.Context, client *Client, path string) (*GetLogsResponse, error)
- func GetManagerConfigurationRequest(ctx context.Context, client *Client, path string) (*GetManagerConfigurationResponse, error)
- func GetManagerInformationRequest(ctx context.Context, client *Client, path string) (*GetManagerInformationResponse, error)
- func GetManagerStatsRequest(ctx context.Context, client *Client, path string) (*GetManagerStatsResponse, error)
- func GetManagerStatusRequest(ctx context.Context, client *Client, path string) (*GetManagerStatusResponse, error)
- func GetNetworkAddrInfoRequest(ctx context.Context, client *Client, path string) (*GetNetworkAddrInfoResponse, error)
- func GetNetworkInterfaceInfoRequest(ctx context.Context, client *Client, path string) (*GetNetworkInterfaceInfoResponse, error)
- func GetNetworkProtocolInfoRequest(ctx context.Context, client *Client, path string) (*GetNetworkProtocolInfoResponse, error)
- func GetOSInfoRequest(ctx context.Context, client *Client, path string) (*GetOSInfoResponse, error)
- func GetPackagesInfoRequest(ctx context.Context, client *Client, path string) (*GetPackagesInfoResponse, error)
- func GetParentDecodersRequest(ctx context.Context, client *Client, path string) (*GetDecodersResponse, error)
- func GetPortsInfoRequest(ctx context.Context, client *Client, path string) (*GetPortsInfoResponse, error)
- func GetProcessesInfoRequest(ctx context.Context, client *Client, path string) (*GetProcessesInfoResponse, error)
- func GetRemotedStatsRequest(ctx context.Context, client *Client, path string) (*GetRemotedStatsResponse, error)
- func GetRequest(ctx context.Context, client *Client, path string) (*Response, error)
- func GetRuleFilesRequest(ctx context.Context, client *Client, path string) (*GetRuleFilesResponse, error)
- func GetRulesRequest(ctx context.Context, client *Client, path string) (*GetRulesResponse, error)
- func GetScaChecksRequest(ctx context.Context, client *Client, path string) (*GetScaChecksResponse, error)
- func GetScaRequest(ctx context.Context, client *Client, path string) (*GetScaResponse, error)
- func GetStatsByHourRequest(ctx context.Context, client *Client, path string) (*GetStatsByHourResponse, error)
- func GetSyscheckFilesRequest(ctx context.Context, client *Client, path string) (*GetSyscheckFilesResponse, error)
- func GetWeeklyStatsRequest(ctx context.Context, client *Client, path string) (*GetWeeklyStatsResponse, error)
- func ParseResponseBody(body io.ReadCloser, intf interface{}) error
- func PostJson(ctx context.Context, client *Client, path string, json []byte, ...) error
- func PutJson(ctx context.Context, client *Client, path string, json []byte, ...) error
- func RunSyscheckAgentRequest(ctx context.Context, client *Client, path string) (*RunSyscheckAgentResponse, error)
- func RunSyscheckAllAgentsRequest(ctx context.Context, client *Client, path string) (*RunSyscheckAllAgentsResponse, error)
- type AgentInformation
- type AgentInformationData
- type AgentRestartData
- type AgentRestartResponse
- type Client
- func (client *Client) ClearSyscheckDatabase(agentId string) (*string, error)
- func (client *Client) ClearSyscheckDatabaseContext(ctx context.Context, agentId string) (*string, error)
- func (client *Client) GetAgentsByGroup(groupId string) (*[]AgentInformation, error)
- func (client *Client) GetAgentsByGroupContext(ctx context.Context, groupId string) (*[]AgentInformation, error)
- func (client *Client) GetAllAgents() (*[]AgentInformation, error)
- func (client *Client) GetAllAgentsContext(ctx context.Context) (*[]AgentInformation, error)
- func (client *Client) GetAllDecoders() (*[]Decoder, error)
- func (client *Client) GetAllDecodersContext(ctx context.Context) (*[]Decoder, error)
- func (client *Client) GetAllRules() (*[]Rules, error)
- func (client *Client) GetAllRulesContext(ctx context.Context) (*[]Rules, error)
- func (client *Client) GetAnAgent(agentID string) (*AgentInformation, error)
- func (client *Client) GetAnAgentContext(ctx context.Context, agentID string) (*AgentInformation, error)
- func (client *Client) GetAnalysisdStats() (*AnalysisdStats, error)
- func (client *Client) GetAnalysisdStatsContext(ctx context.Context) (*AnalysisdStats, error)
- func (client *Client) GetDecoderByName(name string) (*[]Decoder, error)
- func (client *Client) GetDecoderByNameContext(ctx context.Context, name string) (*[]Decoder, error)
- func (client *Client) GetDecoderFiles() (*[]DecoderFiles, error)
- func (client *Client) GetDecoderFilesContext(ctx context.Context) (*[]DecoderFiles, error)
- func (client *Client) GetGdprRules() (*[]string, error)
- func (client *Client) GetGdprRulesContext(ctx context.Context) (*[]string, error)
- func (client *Client) GetGroups() (*[]Group, error)
- func (client *Client) GetGroupsContext(ctx context.Context) (*[]Group, error)
- func (client *Client) GetHardwareInfo(agentID string) (*HardwareInfo, error)
- func (client *Client) GetHardwareInfoContext(ctx context.Context, agentID string) (*HardwareInfo, error)
- func (client *Client) GetLastSyscheckScan(agentId string) (*LastSyscheckScan, error)
- func (client *Client) GetLastSyscheckScanContext(ctx context.Context, agentId string) (*LastSyscheckScan, error)
- func (client *Client) GetLogSummary() (*LogSummary, error)
- func (client *Client) GetLogSummaryContext(ctx context.Context) (*LogSummary, error)
- func (client *Client) GetLogs() (*[]Log, error)
- func (client *Client) GetLogsContext(ctx context.Context) (*[]Log, error)
- func (client *Client) GetManagerConfiguration() (*ManagerConfiguration, error)
- func (client *Client) GetManagerConfigurationContext(ctx context.Context) (*ManagerConfiguration, error)
- func (client *Client) GetManagerInformation() (*ManagerInformation, error)
- func (client *Client) GetManagerInformationContext(ctx context.Context) (*ManagerInformation, error)
- func (client *Client) GetManagerStats() (*[]ManagerStats, error)
- func (client *Client) GetManagerStatsContext(ctx context.Context) (*[]ManagerStats, error)
- func (client *Client) GetManagerStatus() (*ManagerStatus, error)
- func (client *Client) GetManagerStatusContext(ctx context.Context) (*ManagerStatus, error)
- func (client *Client) GetNetworkAddrInfo(agentID string) (*[]NetworkAddrInfo, error)
- func (client *Client) GetNetworkAddrInfoContext(ctx context.Context, agentID string) (*[]NetworkAddrInfo, error)
- func (client *Client) GetNetworkInterfaceInfo(agentID string) (*[]NetworkInterfaceInfo, error)
- func (client *Client) GetNetworkInterfaceInfoContext(ctx context.Context, agentID string) (*[]NetworkInterfaceInfo, error)
- func (client *Client) GetNetworkProtocolInfo(agentID string) (*[]NetworkProtocolInfo, error)
- func (client *Client) GetNetworkProtocolInfoContext(ctx context.Context, agentID string) (*[]NetworkProtocolInfo, error)
- func (client *Client) GetOSInfo(agentID string) (*OSInfo, error)
- func (client *Client) GetOSInfoContext(ctx context.Context, agentID string) (*OSInfo, error)
- func (client *Client) GetPackagesInfo(agentID string) (*[]PackagesInfo, error)
- func (client *Client) GetPackagesInfoContext(ctx context.Context, agentID string) (*[]PackagesInfo, error)
- func (client *Client) GetParentDecoders() (*[]Decoder, error)
- func (client *Client) GetParentDecodersContext(ctx context.Context) (*[]Decoder, error)
- func (client *Client) GetPortsInfo(agentID string) (*[]PortsInfo, error)
- func (client *Client) GetPortsInfoContext(ctx context.Context, agentID string) (*[]PortsInfo, error)
- func (client *Client) GetProcessesInfo(agentID string) (*[]ProcessesInfo, error)
- func (client *Client) GetProcessesInfoContext(ctx context.Context, agentID string) (*[]ProcessesInfo, error)
- func (client *Client) GetRemotedStats() (*RemotedStats, error)
- func (client *Client) GetRemotedStatsContext(ctx context.Context) (*RemotedStats, error)
- func (client *Client) GetRuleFiles() (*[]RuleFiles, error)
- func (client *Client) GetRuleFilesContext(ctx context.Context) (*[]RuleFiles, error)
- func (client *Client) GetRuleGroups() (*[]string, error)
- func (client *Client) GetRuleGroupsContext(ctx context.Context) (*[]string, error)
- func (client *Client) GetRulePCI() (*[]string, error)
- func (client *Client) GetRulePCIContext(ctx context.Context) (*[]string, error)
- func (client *Client) GetRulesById(ruleId string) (*[]Rules, error)
- func (client *Client) GetRulesByIdContext(ctx context.Context, ruleId string) (*[]Rules, error)
- func (client *Client) GetSca(agentId string) (*[]Sca, error)
- func (client *Client) GetScaChecks(agentId, Id string) (*[]ScaCheck, error)
- func (client *Client) GetScaChecksContext(ctx context.Context, agentId, Id string) (*[]ScaCheck, error)
- func (client *Client) GetScaContext(ctx context.Context, agentId string) (*[]Sca, error)
- func (client *Client) GetStatsByHour() (*StatsByHour, error)
- func (client *Client) GetStatsByHourContext(ctx context.Context) (*StatsByHour, error)
- func (client *Client) GetSyscheckFiles(agentId string) (*[]SyscheckFiles, error)
- func (client *Client) GetSyscheckFilesContext(ctx context.Context, agentId string) (*[]SyscheckFiles, error)
- func (client *Client) GetWeeklyStats() (*WeeklyStats, error)
- func (client *Client) GetWeeklyStatsContext(ctx context.Context) (*WeeklyStats, error)
- func (client *Client) RestartAgent(agentId string) (*AgentRestartData, error)
- func (client *Client) RestartAgentContext(ctx context.Context, agentId string) (*AgentRestartData, error)
- func (client *Client) RunSyscheckAgent(agentId string) (*string, error)
- func (client *Client) RunSyscheckAgentContext(ctx context.Context, agentId string) (*string, error)
- func (client *Client) RunSyscheckAllAgents() (*string, error)
- func (client *Client) RunSyscheckAllAgentsContext(ctx context.Context) (*string, error)
- type ClientOption
- type ClientOptions
- type GetAllAgentsResponse
- type GetAnAgentResponse
- type GetGroupsResponse
- type Group
- type GroupData
- type Os
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllDecodersRequest ¶
func GetDecoderByNameRequest ¶
func GetDecoderFilesRequest ¶
func GetHardwareInfoRequest ¶
func GetLogSummaryRequest ¶
func GetLogsRequest ¶
func GetManagerStatsRequest ¶
func GetManagerStatusRequest ¶
func GetOSInfoRequest ¶
func GetPackagesInfoRequest ¶
func GetPortsInfoRequest ¶
func GetProcessesInfoRequest ¶
func GetRemotedStatsRequest ¶
func GetRequest ¶
func GetRuleFilesRequest ¶
func GetRulesRequest ¶
func GetScaChecksRequest ¶
func GetScaRequest ¶
func GetStatsByHourRequest ¶
func GetSyscheckFilesRequest ¶
func GetWeeklyStatsRequest ¶
func ParseResponseBody ¶
func ParseResponseBody(body io.ReadCloser, intf interface{}) error
func RunSyscheckAgentRequest ¶
Types ¶
type AgentInformation ¶
type AgentInformation struct { Status string `json:"status"` Name string `json:"name"` IP string `json:"ip"` Manager string `json:"manager"` NodeName string `json:"node_name"` DateAdd string `json:"dateAdd"` Version string `json:"version"` LastKeepAlive string `json:"lastKeepAlive"` Os Os `json:"os"` ID string `json:"id"` ConfigSum string `json:"configSum,omitempty"` Group []string `json:"group,omitempty"` MergedSum string `json:"mergedSum,omitempty"` }
type AgentInformationData ¶
type AgentInformationData struct { TotalItems int `json:"totalItems"` Items []AgentInformation `json:"items"` }
type AgentRestartData ¶
type AgentRestartResponse ¶
type AgentRestartResponse struct { Error int `json:"error"` Data AgentRestartData `json:"data"` }
func RestartAgentRequest ¶
type Client ¶
type Client struct { Options ClientOptions // contains filtered or unexported fields }
func New ¶
func New(endpoint string, options ...ClientOption) (*Client, error)
Example ¶
package main import ( "github.com/mrtc0/wazuh" ) func main() { wazuh.New("https://wazuh.localhost:55000/") }
Output:
Example (WithBasicAuth) ¶
package main import ( "github.com/mrtc0/wazuh" ) func main() { wazuh.New("https://wazuh.localhost:55000/", wazuh.WithBasicAuth("username", "password")) }
Output:
Example (WithClientCertificate) ¶
package main import ( "github.com/mrtc0/wazuh" ) func main() { var cert, key []byte wazuh.New("https://wazuh.localhost:55000/", wazuh.WithClientCertificate(cert, key)) }
Output:
Example (WithClientCertificateFromFile) ¶
package main import ( "github.com/mrtc0/wazuh" ) func main() { wazuh.New("https://wazuh.localhost:55000/", wazuh.WithClientCertificateFromFile("/path/to/certificate.cert", "/path/to/private.key")) }
Output:
func (*Client) ClearSyscheckDatabase ¶
Clear syscheck database of an agent Clears the syscheck database for the specified agent. https://documentation.wazuh.com/3.x/user-manual/api/reference.html#id20
func (*Client) ClearSyscheckDatabaseContext ¶
func (*Client) GetAgentsByGroup ¶
func (client *Client) GetAgentsByGroup(groupId string) (*[]AgentInformation, error)
func (*Client) GetAgentsByGroupContext ¶
func (*Client) GetAllAgents ¶
func (client *Client) GetAllAgents() (*[]AgentInformation, error)
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-all-agents
func (*Client) GetAllAgentsContext ¶
func (client *Client) GetAllAgentsContext(ctx context.Context) (*[]AgentInformation, error)
func (*Client) GetAllDecoders ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-all-decoders
func (*Client) GetAllDecodersContext ¶
func (*Client) GetAllRules ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-all-rules
func (*Client) GetAllRulesContext ¶
func (*Client) GetAnAgent ¶
func (client *Client) GetAnAgent(agentID string) (*AgentInformation, error)
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-an-agent
func (*Client) GetAnAgentContext ¶
func (*Client) GetAnalysisdStats ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-analysisd-stats
func (*Client) GetAnalysisdStatsContext ¶
func (*Client) GetDecoderByName ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-decoders-by-name
func (*Client) GetDecoderByNameContext ¶
func (*Client) GetDecoderFiles ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-all-decoders-files
func (*Client) GetDecoderFilesContext ¶
func (*Client) GetGdprRules ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-rule-gdpr-requirements
func (*Client) GetGdprRulesContext ¶
func (*Client) GetGroups ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-groups
func (*Client) GetGroupsContext ¶
func (*Client) GetHardwareInfo ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#id18
func (*Client) GetHardwareInfoContext ¶
func (*Client) GetLastSyscheckScan ¶
Get last syscheck scan Return the timestamp of the last syscheck scan. https://documentation.wazuh.com/3.x/user-manual/api/reference.html#get-last-syscheck-scan
func (*Client) GetLastSyscheckScanContext ¶
func (*Client) GetLogSummary ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-summary-of-ossec-log
func (*Client) GetLogSummaryContext ¶
func (*Client) GetLogs ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-ossec-log
func (*Client) GetLogsContext ¶
func (*Client) GetManagerConfiguration ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-configuration
func (*Client) GetManagerConfigurationContext ¶
func (*Client) GetManagerInformation ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-information
func (*Client) GetManagerInformationContext ¶
func (*Client) GetManagerStats ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-stats
func (*Client) GetManagerStatsContext ¶
func (*Client) GetManagerStatus ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-status
func (*Client) GetManagerStatusContext ¶
func (*Client) GetNetworkAddrInfo ¶
func (*Client) GetNetworkAddrInfoContext ¶
func (*Client) GetNetworkInterfaceInfo ¶
func (*Client) GetNetworkInterfaceInfoContext ¶
func (*Client) GetNetworkProtocolInfo ¶
func (*Client) GetNetworkProtocolInfoContext ¶
func (*Client) GetOSInfo ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-os-info
func (*Client) GetOSInfoContext ¶
func (*Client) GetPackagesInfo ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-packages-info
func (*Client) GetPackagesInfoContext ¶
func (*Client) GetParentDecoders ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-all-parent-decoders
func (*Client) GetParentDecodersContext ¶
func (*Client) GetPortsInfo ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-ports-info-of-an-agent
func (*Client) GetPortsInfoContext ¶
func (*Client) GetProcessesInfo ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-processes-info
func (*Client) GetProcessesInfoContext ¶
func (*Client) GetRemotedStats ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-stats-by-week
func (*Client) GetRemotedStatsContext ¶
func (*Client) GetRuleFiles ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-files-of-rules
func (*Client) GetRuleFilesContext ¶
func (*Client) GetRuleGroups ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-rule-groups
func (*Client) GetRuleGroupsContext ¶
func (*Client) GetRulePCI ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-rule-pci-requirements
func (*Client) GetRulePCIContext ¶
func (*Client) GetRulesById ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-rules-by-id
func (*Client) GetRulesByIdContext ¶
func (*Client) GetSca ¶
Get security configuration assessment (SCA) database Returns the sca database of an agent. https://documentation.wazuh.com/3.x/user-manual/api/reference.html#get-security-configuration-assessment-sca-database
func (*Client) GetScaChecks ¶
Get security configuration assessment (SCA) checks database Returns the sca checks of an agent https://documentation.wazuh.com/3.x/user-manual/api/reference.html#id19
func (*Client) GetScaChecksContext ¶
func (*Client) GetScaContext ¶
func (*Client) GetStatsByHour ¶
func (*Client) GetStatsByHourContext ¶
func (*Client) GetSyscheckFiles ¶
Get syscheck files Returns the syscheck files of an agent. https://documentation.wazuh.com/3.x/user-manual/api/reference.html#get-syscheck-files
func (*Client) GetSyscheckFilesContext ¶
func (*Client) GetWeeklyStats ¶
https://documentation.wazuh.com/current/user-manual/api/reference.html#get-manager-stats-by-week
func (*Client) GetWeeklyStatsContext ¶
func (*Client) RestartAgent ¶
func (client *Client) RestartAgent(agentId string) (*AgentRestartData, error)
func (*Client) RestartAgentContext ¶
func (*Client) RunSyscheckAgent ¶
Run syscheck scan in an agent Runs syscheck and rootcheck on an agent (Wazuh launches both processes simultaneously). https://documentation.wazuh.com/3.x/user-manual/api/reference.html#run-syscheck-scan-in-an-agent
func (*Client) RunSyscheckAgentContext ¶
func (*Client) RunSyscheckAllAgents ¶
Run sys check scan in all agents Runs syscheck and rootcheck on all agents (Wazuh launches both processes simultaneously). https://documentation.wazuh.com/3.x/user-manual/api/reference.html#id22
type ClientOption ¶
type ClientOption func(*ClientOptions)
func WithBasicAuth ¶
func WithBasicAuth(username, password string) ClientOption
func WithClientCertificate ¶
func WithClientCertificate(certPEMBlock, keyPEMBlock []byte) ClientOption
func WithClientCertificateFromFile ¶
func WithClientCertificateFromFile(cert string, key string) ClientOption
If you are doing client certificate authentication, use it
type ClientOptions ¶
type GetAllAgentsResponse ¶
type GetAllAgentsResponse struct { Error int `json:"error"` Data AgentInformationData `json:"data"` }
func GetAgentsByGroupRequest ¶
func GetAllAgentsRequest ¶
type GetAnAgentResponse ¶
type GetAnAgentResponse struct { Error int `json:"error"` Data AgentInformation `json::"data"` }