22package santa
33
44import (
5- "encoding/json"
6-
75 "github.com/pkg/errors"
86)
97
@@ -24,12 +22,13 @@ type Rule struct {
2422 CustomMessage string `json:"custom_msg,omitempty" toml:"custom_msg,omitempty"`
2523}
2624
27- // Preflight representssync response sent to a Santa client by the sync server.
25+ // Preflight represents sync response sent to a Santa client by the sync server.
2826type Preflight struct {
2927 ClientMode ClientMode `json:"client_mode" toml:"client_mode"`
3028 BlockedPathRegex string `json:"blocked_path_regex" toml:"blocked_path_regex"`
3129 AllowedPathRegex string `json:"allowed_path_regex" toml:"allowed_path_regex"`
3230 BatchSize int `json:"batch_size" toml:"batch_size"`
31+ EnableAllEventUpload bool `json:"enable_all_event_upload" toml:"enable_all_event_upload"`
3332 EnableBundles bool `json:"enable_bundles" toml:"enable_bundles"`
3433 EnableTransitiveRules bool `json:"enable_transitive_rules" toml:"enable_transitive_rules"`
3534 CleanSync bool `json:"clean_sync" toml:"clean_sync"`
@@ -51,9 +50,55 @@ type PreflightPayload struct {
5150
5251// EventPayload represents derived metadata for events uploaded with the UploadEvent endpoint.
5352type EventPayload struct {
54- FileSHA string `json:"file_sha256"`
55- UnixTime float64 `json:"execution_time"`
56- Content json.RawMessage `json:"-"`
53+ FileSHA string `json:"file_sha256"`
54+ UnixTime float64 `json:"execution_time"`
55+ EventInfo EventUploadEvent
56+ }
57+
58+ // EventUploadRequest encapsulation of an /eventupload POST body sent by a Santa client
59+ type EventUploadRequest struct {
60+ Events []EventUploadEvent `json:"events"`
61+ }
62+
63+ // EventUploadEvent is a single event entry
64+ type EventUploadEvent struct {
65+ CurrentSessions []string `json:"current_sessions"`
66+ Decision string `json:"decision"`
67+ ExecutingUser string `json:"executing_user"`
68+ ExecutionTime float64 `json:"execution_time"`
69+ FileBundleBinaryCount int64 `json:"file_bundle_binary_count"`
70+ FileBundleExecutableRelPath string `json:"file_bundle_executable_rel_path"`
71+ FileBundleHash string `json:"file_bundle_hash"`
72+ FileBundleHashMilliseconds float64 `json:"file_bundle_hash_millis"`
73+ FileBundleID string `json:"file_bundle_id"`
74+ FileBundleName string `json:"file_bundle_name"`
75+ FileBundlePath string `json:"file_bundle_path"`
76+ FileBundleShortVersionString string `json:"file_bundle_version_string"`
77+ FileBundleVersion string `json:"file_bundle_version"`
78+ FileName string `json:"file_name"`
79+ FilePath string `json:"file_path"`
80+ FileSHA256 string `json:"file_sha256"`
81+ LoggedInUsers []string `json:"logged_in_users"`
82+ ParentName string `json:"parent_name"`
83+ ParentProcessID int `json:"ppid"`
84+ ProcessID int `json:"pid"`
85+ QuarantineAgentBundleID string `json:"quarantine_agent_bundle_id"`
86+ QuarantineDataUrl string `json:"quarantine_data_url"`
87+ QuarantineRefererUrl string `json:"quarantine_referer_url"`
88+ QuarantineTimestamp float64 `json:"quarantine_timestamp"`
89+ SigningChain []SigningEntry `json:"signing_chain"`
90+ SigningID string `json:"signing_id"`
91+ TeamID string `json:"team_id"`
92+ }
93+
94+ // SigningEntry is optionally present when an event includes a binary that is signed
95+ type SigningEntry struct {
96+ CertificateName string `json:"cn"`
97+ Organization string `json:"org"`
98+ OrganizationalUnit string `json:"ou"`
99+ SHA256 string `json:"sha256"`
100+ ValidFrom int `json:"valid_from"`
101+ ValidUntil int `json:"valid_until"`
57102}
58103
59104// RuleType represents a Santa rule type.
0 commit comments