67aecd65c1
This work extracts fingerprints and domains from CertStream data structure received through the stream. It builds nodes and edges and saves them to the relevant files. It sends this data to Kafka but no logic is implemented at the exit of the broker yet.
31 lines
1,000 B
Go
31 lines
1,000 B
Go
package models
|
|
|
|
// Node defines the data we gather through the parsing. It should follow the
|
|
// Styx terminology
|
|
// (https://docs.google.com/document/d/1dIrh1Lp3KAjEMm8o2VzAmuV0Peu-jt9aAh1IHrjAroM/pub#h.xzbicbtscatx)
|
|
type Node struct {
|
|
ID string `json:"id"`
|
|
Type string `json:"type"`
|
|
Data string `json:"data"`
|
|
Created string `json:"created"`
|
|
Modified string `json:"modified"`
|
|
}
|
|
|
|
// Edge defines a relation between two nodes.
|
|
type Edge struct {
|
|
ID string `json:"id"`
|
|
NodeOneID string `json:"nodeOneID"`
|
|
NodeTwoID string `json:"nodeTwoID"`
|
|
Timestamp string `json:"timestamp"`
|
|
Source string `json:"source"`
|
|
}
|
|
|
|
// CertStreamWrapper is a wrapper around the stream function to unmarshall the
|
|
// data receive in a Go structure.
|
|
type CertStreamWrapper struct {
|
|
ID string `json:"id"`
|
|
Type string `json:"type"`
|
|
Data CertStreamStruct `json:"data"`
|
|
Created string `json:"created"`
|
|
Modified string `json:"modified"`
|
|
}
|