Documentation ¶
Index ¶
- func SafeResponseClose(r *http.Response)
- type CheckResultsReq
- type CkoStatus
- type CkoStatusDiskspace
- type CkoStatusSamples
- type CkoStatusTasks
- type CkoTasksCreateResp
- type CkoTasksReport
- type CkoTasksReportBehavior
- type CkoTasksReportBhvPcs
- type CkoTasksReportBhvPcsCall
- type CkoTasksReportBhvPcsCallArg
- type CkoTasksReportBhvSummary
- type CkoTasksReportInfo
- type CkoTasksReportInfoMachine
- type CkoTasksReportSignature
- type CkoTasksViewResp
- type CkoTasksViewTask
- type Core
- func (c *Core) Consume(queue string, prefetchCount int, fn func(msg amqp.Delivery))
- func (c *Core) FailOnError(err error, msg string)
- func (c *Core) FastGet(url string, structPointer interface{}) ([]byte, int, error)
- func (c *Core) FastPostForm(url string, data url.Values, structPointer interface{}) ([]byte, int, error)
- func (c *Core) NackOnError(err error, desc string, msg *amqp.Delivery) bool
- func (c *Core) NewCrits(Data *CritsData) *CritsConn
- func (c *Core) NewCuckoo(URL string) *CuckooConn
- func (c *Core) SetupQueue(queue string) *QueueHandler
- type CritsConn
- func (crt *CritsConn) AddResults(results []*CrtResult) error
- func (crt *CritsConn) ForgeRelationship(id string) error
- func (crt *CritsConn) Log(level, msg string) error
- func (crt *CritsConn) MarkAsFinished() error
- func (crt *CritsConn) MarkAsRunning() error
- func (crt *CritsConn) NewSample(fileData []byte, fileName string) (string, error)
- type CritsData
- type CrtDefaultResponse
- type CrtResult
- type CuckooConn
- func (cko *CuckooConn) DeleteTask(id int) error
- func (cko *CuckooConn) GetDropped(id int) ([]byte, error)
- func (cko *CuckooConn) GetPending() (int, error)
- func (cko *CuckooConn) GetStatus() (*CkoStatus, error)
- func (cko *CuckooConn) NewTask(fileBytes []byte, fileName string, params map[string]string) (int, error)
- func (cko *CuckooConn) TaskReport(id int) (*CkoTasksReport, error)
- func (cko *CuckooConn) TaskStatus(id int) (string, error)
- type DistributedCuckooReq
- type FailedMsg
- type FeedCuckooReq
- type QueueHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SafeResponseClose ¶
Types ¶
type CheckResultsReq ¶
CheckResultsReq is the amqp msg sent from check_results to parse_and_submit
func (*CheckResultsReq) Validate ¶
func (r *CheckResultsReq) Validate() error
type CkoStatus ¶
type CkoStatus struct { Tasks *CkoStatusTasks `json:"tasks"` Diskspace *CkoStatusDiskspace `json:"diskspace"` }
type CkoStatusDiskspace ¶
type CkoStatusDiskspace struct {
Analyses *CkoStatusSamples `json:"samples"`
}
type CkoStatusSamples ¶
type CkoStatusTasks ¶
type CkoTasksCreateResp ¶
type CkoTasksCreateResp struct {
TaskId int `json:"task_id"`
}
type CkoTasksReport ¶
type CkoTasksReport struct { Info *CkoTasksReportInfo `json:"info"` Signatures []*CkoTasksReportSignature `json;"signatures"` Behavior *CkoTasksReportBehavior `json:"behavior"` }
type CkoTasksReportBehavior ¶
type CkoTasksReportBehavior struct { Processes []*CkoTasksReportBhvPcs `json:"processes"` Summary *CkoTasksReportBhvSummary `json:"summary"` }
type CkoTasksReportBhvPcs ¶
type CkoTasksReportBhvPcs struct { Name string `json:"process_name"` Id int `json:"process_id"` ParentId int `json:"parent_id"` FirstSeen string `json:"first_seen"` Calls []*CkoTasksReportBhvPcsCall `json:"calls"` }
type CkoTasksReportBhvPcsCall ¶
type CkoTasksReportBhvPcsCall struct { Category string `json:"category"` Status bool `json:"status"` Return string `json:"return"` Timestamp string `json:"timestamp"` ThreadId string `json:"thread_id"` Repeated int `json:"repeated"` Api string `json:"api"` Arguments []*CkoTasksReportBhvPcsCallArg `json:"arguments"` Id int `json:"id"` }
type CkoTasksReportInfo ¶
type CkoTasksReportInfo struct { Started string `json:"started"` Ended string `json:"ended"` Id int `json:"id"` Machine json.RawMessage `json:"machine"` //can be CkoTasksReportInfoMachine OR string }
type CkoTasksReportInfoMachine ¶
type CkoTasksReportInfoMachine struct {
Name string `json:"name"`
}
type CkoTasksReportSignature ¶
type CkoTasksViewResp ¶
type CkoTasksViewResp struct {
Task *CkoTasksViewTask
}
type CkoTasksViewTask ¶
type CkoTasksViewTask struct {
Status string `json:"status"`
}
type Core ¶
type Core struct { AmqpConn *amqp.Connection Debug *log.Logger Info *log.Logger Warning *log.Logger Client *http.Client ServiceName string // contains filtered or unexported fields }
Core struct contains all vital information for the microservices to run. Connection to amqp server, global HTTP client, loggers, and the queue for failed messages.
func Init ¶
Init creates a new Core struct containing all the necessary information. The function also initializes loggin, the amqp connection, the failed queue, and HTTP client.
func (*Core) Consume ¶
Consume connects to a queue as a consumer, sets the QoS and relays all incoming messages to the supplied function.
func (*Core) FailOnError ¶
FailOnError accepts an error and message. If the error is not nil the programm will panic with said message.
func (*Core) FastGet ¶
FastGet is a wrapper for http.Get which returns only the important data from the request.
func (*Core) FastPostForm ¶
func (c *Core) FastPostForm(url string, data url.Values, structPointer interface{}) ([]byte, int, error)
FastGet is a wrapper for http.PostForm which returns only the important data from the request.
func (*Core) NackOnError ¶
nackOnError accepts an error, error description, and amqp message. If the error is not nil a NACK is send in replay to the msg. The msg will be redirected to the failed queue so the overseer can handle it.
func (*Core) NewCuckoo ¶
func (c *Core) NewCuckoo(URL string) *CuckooConn
func (*Core) SetupQueue ¶
func (c *Core) SetupQueue(queue string) *QueueHandler
SetupQueue creates a new channel on top of the established amqp connection and declares a persistent queue with the given name. It then returns a pointer to a QueueHandler.
type CritsConn ¶
func (*CritsConn) AddResults ¶
AddResults is a "semi wrapper" for crits self._add_result and simple sends a batch of results back to crits.
func (*CritsConn) ForgeRelationship ¶
ForgeRelationship creates a relationship betwenn the object of the current CritsConn context and the supplied id.
func (*CritsConn) MarkAsFinished ¶
MarkAsRunnig does exactly what you'd expect.
func (*CritsConn) MarkAsRunning ¶
MarkAsRunnig does exactly what you'd expect, except that this does not work in crits so it does nothing currently.
type CritsData ¶
type CritsData struct { CritsURL string `json:"crits_url"` AnalysisId string `json:"analysis_id"` ObjectType string `json:"object_type"` ObjectId string `json:"object_id"` Username string `json:"username"` ApiKey string `json:"api_key"` MD5 string `json:"md5"` Source string `json:"source"` }
critsData contains the most important data about a analysis handled by crits. This data is needed to conntect to crits and is present in every amqp message.
type CrtDefaultResponse ¶
type CuckooConn ¶
func (*CuckooConn) DeleteTask ¶
func (cko *CuckooConn) DeleteTask(id int) error
func (*CuckooConn) GetDropped ¶
func (cko *CuckooConn) GetDropped(id int) ([]byte, error)
func (*CuckooConn) GetPending ¶
func (cko *CuckooConn) GetPending() (int, error)
func (*CuckooConn) GetStatus ¶
func (cko *CuckooConn) GetStatus() (*CkoStatus, error)
func (*CuckooConn) NewTask ¶
func (cko *CuckooConn) NewTask(fileBytes []byte, fileName string, params map[string]string) (int, error)
submitTask submits a new task to the cuckoo api.
func (*CuckooConn) TaskReport ¶
func (cko *CuckooConn) TaskReport(id int) (*CkoTasksReport, error)
func (*CuckooConn) TaskStatus ¶
func (cko *CuckooConn) TaskStatus(id int) (string, error)
type DistributedCuckooReq ¶
type DistributedCuckooReq struct { Payload map[string]string `json:"payload"` File map[string]string `json:"file"` CritsData *CritsData `json:"crits_data"` }
DistributedCuckooReq is the amqp msg sent from crits to feed_cuckoo
func (*DistributedCuckooReq) Validate ¶
func (r *DistributedCuckooReq) Validate() error
type FeedCuckooReq ¶
FeedCuckooReq is the amqp msg sent from feed_cuckoo to check_results
func (*FeedCuckooReq) Validate ¶
func (r *FeedCuckooReq) Validate() error
type QueueHandler ¶
func (*QueueHandler) Send ¶
func (q *QueueHandler) Send(msg []byte)
Send is used to send a message to a amqp queue. Channel and queue name are taken from the QueueHandler struct.