Documentation ¶
Index ¶
- type Aggregation
- type Bucket
- type CassandraConnection
- func (cassandra *CassandraConnection) CheckExploitCodeExists(log_uuid string) (bool, error)
- func (cassandra *CassandraConnection) CheckMachineExists(os string, hostname string) (string, error)
- func (cassandra *CassandraConnection) CheckUserCredentials(username string, password string) (bool, string, error)
- func (cassandra *CassandraConnection) CheckUserExists(username string) (bool, error)
- func (cassandra *CassandraConnection) DeleteMachine(id string) error
- func (cassandra *CassandraConnection) GetAgent(id string) (data.Agent, error)
- func (cassandra *CassandraConnection) GetAgentLogs(uuid string) ([]data.LogData, error)
- func (cassandra *CassandraConnection) GetAgentLogsShort(agent_id string) ([]data.LogDataShort, error)
- func (cassandra *CassandraConnection) GetAgentLogsShortPaginated(agent_id string, current_page string) (string, []data.LogDataShort, error)
- func (cassandra *CassandraConnection) GetAgents() ([]data.Agent, error)
- func (cassandra *CassandraConnection) GetCountAgents() (int64, error)
- func (cassandra *CassandraConnection) GetIPAddressesCounts(uuid string) (map[string]int64, error)
- func (cassandra *CassandraConnection) GetLog(uuid string) (data.LogDataDatabase, error)
- func (cassandra *CassandraConnection) GetLogFindings(log_id string) ([]data.FindingDatabase, error)
- func (cassandra *CassandraConnection) GetLogFindingsCount(log_id string, finding_type int64) (int64, error)
- func (cassandra *CassandraConnection) GetLogRequest(uuid string) (string, error)
- func (cassandra *CassandraConnection) GetLogRuleFindings(log_id string) ([]data.RuleFindingDatabase, error)
- func (cassandra *CassandraConnection) GetLogRuleFindingsCount(log_id string, finding_type int64) (int64, error)
- func (cassandra *CassandraConnection) GetLogsMethodCount(uuid string, method string) (int64, error)
- func (cassandra *CassandraConnection) GetMachine(id string) (data.MachineInformation, error)
- func (cassandra *CassandraConnection) GetMachines() ([]data.MachineDatabase, error)
- func (cassandra *CassandraConnection) GetNumberAgentsDeployed(machineId string) (int64, error)
- func (cassandra *CassandraConnection) GetNumberMachinesAndNumberNetworkInterfaces() (int64, int64, error)
- func (cassandra *CassandraConnection) GetRequestsPerDay(uuid string) (map[string]int64, error)
- func (cassandra *CassandraConnection) GetStatusCodeCounts(uuid string) (map[string]int64, error)
- func (cassandra *CassandraConnection) Init() error
- func (cassandra *CassandraConnection) InsertAgent(protocol string, ip_address string, port string, webserver_protocol string, ...) (string, error)
- func (cassandra *CassandraConnection) InsertFindings(log_id string, findings []data.Finding) (bool, error)
- func (cassandra *CassandraConnection) InsertLog(logData data.LogData) (string, bool, error)
- func (cassandra *CassandraConnection) InsertMachine(os string, hostname string, ip_addresses []string) (string, error)
- func (cassandra *CassandraConnection) InsertRuleFindings(log_id string, ruleFindings []data.RuleFinding) (bool, error)
- func (cassandra *CassandraConnection) InsertUser(username string, password string) (string, error)
- func (cassandra *CassandraConnection) ModifyAgent(id string, agent data.UpdateAgent) error
- type ElasticConnection
- func (elastic *ElasticConnection) GetAllAgentLogs(agentId string) []data.LogDataElastic
- func (elastic *ElasticConnection) GetLogsPaginated(agentId string) []data.LogDataElastic
- func (elastic *ElasticConnection) GetRecentLogs() []data.LogDataElastic
- func (elastic *ElasticConnection) GetRecentRuleClassifiedLogs() []data.LogDataElastic
- func (elastic *ElasticConnection) GetRuleFindingsCount() (int64, error)
- func (elastic *ElasticConnection) GetRuleFindingsStats() ([]data.FindingsMetrics, error)
- func (elastic *ElasticConnection) GetRuleIdStats() ([]data.FindingsMetrics, error)
- func (elastic *ElasticConnection) GetTotalCountLogs() (int64, error)
- func (elastic *ElasticConnection) Init() error
- func (elastic *ElasticConnection) InsertLog(log data.LogData) error
- type IConnection
- type IElasticConnection
- type Langs
- type ResponseCountElastic
- type RuleFindingsAggregationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
type Aggregation struct {
Langs Langs `json:"langs"`
}
type CassandraConnection ¶
type CassandraConnection struct {
// contains filtered or unexported fields
}
Structure that will hold the necessary fields and functions for interacting with Cassandra
func NewCassandraConnection ¶
func NewCassandraConnection(logger logging.ILogger, configuration config.Configuration) *CassandraConnection
Creates a new instance of the CassandraConnection structure
func (*CassandraConnection) CheckExploitCodeExists ¶
func (cassandra *CassandraConnection) CheckExploitCodeExists(log_uuid string) (bool, error)
Check if exploit code exists for a log
func (*CassandraConnection) CheckMachineExists ¶
func (cassandra *CassandraConnection) CheckMachineExists(os string, hostname string) (string, error)
Check if the machine already exists
func (*CassandraConnection) CheckUserCredentials ¶
func (cassandra *CassandraConnection) CheckUserCredentials(username string, password string) (bool, string, error)
Check user credentials
func (*CassandraConnection) CheckUserExists ¶
func (cassandra *CassandraConnection) CheckUserExists(username string) (bool, error)
Check if user exists
func (*CassandraConnection) DeleteMachine ¶
func (cassandra *CassandraConnection) DeleteMachine(id string) error
Delete a specific machine based on the id
func (*CassandraConnection) GetAgent ¶
func (cassandra *CassandraConnection) GetAgent(id string) (data.Agent, error)
Get a single agent from the database
func (*CassandraConnection) GetAgentLogs ¶
func (cassandra *CassandraConnection) GetAgentLogs(uuid string) ([]data.LogData, error)
Get all logs of an agent
func (*CassandraConnection) GetAgentLogsShort ¶
func (cassandra *CassandraConnection) GetAgentLogsShort(agent_id string) ([]data.LogDataShort, error)
Get all the logs of an agent in a short format
func (*CassandraConnection) GetAgentLogsShortPaginated ¶
func (cassandra *CassandraConnection) GetAgentLogsShortPaginated(agent_id string, current_page string) (string, []data.LogDataShort, error)
func (*CassandraConnection) GetAgents ¶
func (cassandra *CassandraConnection) GetAgents() ([]data.Agent, error)
Get all the agents from the database
func (*CassandraConnection) GetCountAgents ¶
func (cassandra *CassandraConnection) GetCountAgents() (int64, error)
Get number of agents from the database
func (*CassandraConnection) GetIPAddressesCounts ¶
func (cassandra *CassandraConnection) GetIPAddressesCounts(uuid string) (map[string]int64, error)
Get IP addresses metrics
func (*CassandraConnection) GetLog ¶
func (cassandra *CassandraConnection) GetLog(uuid string) (data.LogDataDatabase, error)
Get a specific log
func (*CassandraConnection) GetLogFindings ¶
func (cassandra *CassandraConnection) GetLogFindings(log_id string) ([]data.FindingDatabase, error)
Get all the findings of the request
func (*CassandraConnection) GetLogFindingsCount ¶
func (cassandra *CassandraConnection) GetLogFindingsCount(log_id string, finding_type int64) (int64, error)
Get number of request findings of a log
func (*CassandraConnection) GetLogRequest ¶
func (cassandra *CassandraConnection) GetLogRequest(uuid string) (string, error)
Get log request
func (*CassandraConnection) GetLogRuleFindings ¶
func (cassandra *CassandraConnection) GetLogRuleFindings(log_id string) ([]data.RuleFindingDatabase, error)
Get all the rule findings of the log
func (*CassandraConnection) GetLogRuleFindingsCount ¶
func (cassandra *CassandraConnection) GetLogRuleFindingsCount(log_id string, finding_type int64) (int64, error)
Get number of findings of a certain type of a log
func (*CassandraConnection) GetLogsMethodCount ¶
func (cassandra *CassandraConnection) GetLogsMethodCount(uuid string, method string) (int64, error)
Get all methods available and their count in the logs
func (*CassandraConnection) GetMachine ¶
func (cassandra *CassandraConnection) GetMachine(id string) (data.MachineInformation, error)
Get a specific machine based on the id
func (*CassandraConnection) GetMachines ¶
func (cassandra *CassandraConnection) GetMachines() ([]data.MachineDatabase, error)
Get all the machines from the database
func (*CassandraConnection) GetNumberAgentsDeployed ¶
func (cassandra *CassandraConnection) GetNumberAgentsDeployed(machineId string) (int64, error)
Get number of agents deployed on machine based on id
func (*CassandraConnection) GetNumberMachinesAndNumberNetworkInterfaces ¶
func (cassandra *CassandraConnection) GetNumberMachinesAndNumberNetworkInterfaces() (int64, int64, error)
Get the number of machines and the total number of network interfaces
func (*CassandraConnection) GetRequestsPerDay ¶
func (cassandra *CassandraConnection) GetRequestsPerDay(uuid string) (map[string]int64, error)
Get number of requests per day over all period of time
func (*CassandraConnection) GetStatusCodeCounts ¶
func (cassandra *CassandraConnection) GetStatusCodeCounts(uuid string) (map[string]int64, error)
Get status code counts
func (*CassandraConnection) Init ¶
func (cassandra *CassandraConnection) Init() error
Function that will initialize the connection to cassandra server
func (*CassandraConnection) InsertAgent ¶
func (cassandra *CassandraConnection) InsertAgent(protocol string, ip_address string, port string, webserver_protocol string, webserver_ip string, webserver_port string, machine_id string) (string, error)
Insert a new agent in the list of agents
func (*CassandraConnection) InsertFindings ¶
func (cassandra *CassandraConnection) InsertFindings(log_id string, findings []data.Finding) (bool, error)
Insert the findings from an agent
func (*CassandraConnection) InsertMachine ¶
func (cassandra *CassandraConnection) InsertMachine(os string, hostname string, ip_addresses []string) (string, error)
Insert a new machine in the database
func (*CassandraConnection) InsertRuleFindings ¶
func (cassandra *CassandraConnection) InsertRuleFindings(log_id string, ruleFindings []data.RuleFinding) (bool, error)
Insert the rule findings from an agent
func (*CassandraConnection) InsertUser ¶
func (cassandra *CassandraConnection) InsertUser(username string, password string) (string, error)
Add a new user in the database
func (*CassandraConnection) ModifyAgent ¶
func (cassandra *CassandraConnection) ModifyAgent(id string, agent data.UpdateAgent) error
Modify the agent
type ElasticConnection ¶
type ElasticConnection struct {
// contains filtered or unexported fields
}
func NewElasticConnection ¶
func NewElasticConnection(logger logging.ILogger, configuration config.Configuration) *ElasticConnection
func (*ElasticConnection) GetAllAgentLogs ¶
func (elastic *ElasticConnection) GetAllAgentLogs(agentId string) []data.LogDataElastic
func (*ElasticConnection) GetLogsPaginated ¶
func (elastic *ElasticConnection) GetLogsPaginated(agentId string) []data.LogDataElastic
func (*ElasticConnection) GetRecentLogs ¶
func (elastic *ElasticConnection) GetRecentLogs() []data.LogDataElastic
func (*ElasticConnection) GetRecentRuleClassifiedLogs ¶
func (elastic *ElasticConnection) GetRecentRuleClassifiedLogs() []data.LogDataElastic
func (*ElasticConnection) GetRuleFindingsCount ¶
func (elastic *ElasticConnection) GetRuleFindingsCount() (int64, error)
func (*ElasticConnection) GetRuleFindingsStats ¶
func (elastic *ElasticConnection) GetRuleFindingsStats() ([]data.FindingsMetrics, error)
func (*ElasticConnection) GetRuleIdStats ¶
func (elastic *ElasticConnection) GetRuleIdStats() ([]data.FindingsMetrics, error)
func (*ElasticConnection) GetTotalCountLogs ¶
func (elastic *ElasticConnection) GetTotalCountLogs() (int64, error)
func (*ElasticConnection) Init ¶
func (elastic *ElasticConnection) Init() error
type IConnection ¶
type IConnection interface { Init() error CheckUserExists(username string) (bool, error) InsertUser(username string, password string) (string, error) CheckUserCredentials(username string, password string) (bool, string, error) CheckMachineExists(os string, hostname string) (string, error) InsertMachine(os string, hostname string, ip_addresses []string) (string, error) InsertAgent(protocol string, ip_address string, port string, webserver_protocol string, webserver_ip string, webserver_port string, machine_id string) (string, error) GetCountAgents() (int64, error) GetAgents() ([]data.Agent, error) GetAgent(id string) (data.Agent, error) ModifyAgent(id string, agent data.UpdateAgent) error GetNumberMachinesAndNumberNetworkInterfaces() (int64, int64, error) GetMachines() ([]data.MachineDatabase, error) GetMachine(id string) (data.MachineInformation, error) DeleteMachine(id string) error GetAgentLogs(uuid string) ([]data.LogData, error) GetAgentLogsShortPaginated(agent_id string, current_page string) (string, []data.LogDataShort, error) GetAgentLogsShort(agent_id string) ([]data.LogDataShort, error) GetLogsMethodCount(uuid string, method string) (int64, error) GetRequestsPerDay(uuid string) (map[string]int64, error) GetStatusCodeCounts(uuid string) (map[string]int64, error) GetIPAddressesCounts(uuid string) (map[string]int64, error) InsertLog(logData data.LogData) (string, bool, error) GetLog(uuid string) (data.LogDataDatabase, error) GetLogRequest(uuid string) (string, error) GetLogFindings(log_uuid string) ([]data.FindingDatabase, error) GetLogRuleFindings(log_uuid string) ([]data.RuleFindingDatabase, error) CheckExploitCodeExists(log_uuid string) (bool, error) }
type IElasticConnection ¶
type IElasticConnection interface { Init() error InsertLog(log data.LogData) error GetLogsPaginated(agentId string) []data.LogDataElastic GetAllAgentLogs(agentId string) []data.LogDataElastic GetRecentLogs() []data.LogDataElastic GetRecentRuleClassifiedLogs() []data.LogDataElastic GetTotalCountLogs() (int64, error) GetRuleFindingsStats() ([]data.FindingsMetrics, error) GetRuleIdStats() ([]data.FindingsMetrics, error) }
type ResponseCountElastic ¶
type ResponseCountElastic struct {
Count int64 `json:"count"`
}
type RuleFindingsAggregationResponse ¶
type RuleFindingsAggregationResponse struct {
Aggregation Aggregation `json:"aggregations"`
}