Skip to content

Commit

Permalink
PLAT-566 - added santa prefilght parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
portswigger-ben committed Sep 6, 2024
1 parent b915a91 commit 9df16c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions santa/santa.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ type Rule struct {

// Preflight represents sync response sent to a Santa client by the sync server.
type Preflight struct {
ClientMode ClientMode `json:"client_mode" toml:"client_mode"`
BlockedPathRegex string `json:"blocked_path_regex" toml:"blocked_path_regex"`
AllowedPathRegex string `json:"allowed_path_regex" toml:"allowed_path_regex"`
BatchSize int `json:"batch_size" toml:"batch_size"`
EnableAllEventUpload bool `json:"enable_all_event_upload" toml:"enable_all_event_upload"`
EnableBundles bool `json:"enable_bundles" toml:"enable_bundles"`
EnableTransitiveRules bool `json:"enable_transitive_rules" toml:"enable_transitive_rules"`
CleanSync bool `json:"clean_sync" toml:"clean_sync"`
BatchSize int `json:"batch_size" toml:"batch_size"`
FullSyncInterval int `json:"full_sync_interval" toml:"full_sync_interval"`
ClientMode ClientMode `json:"client_mode" toml:"client_mode"`
AllowedPathRegex string `json:"allowed_path_regex" toml:"allowed_path_regex"`
BlockedPathRegex string `json:"blocked_path_regex" toml:"blocked_path_regex"`
BlockUsbMount bool `json:"block_usb_mount" toml:"block_usb_mount"`
RemountUsbMode string `json:"remount_usb_mode" toml:"remount_usb_mode"`
SyncType string `json:"sync_type" toml:"sync_type"`
OverrideFileAccessAction string `json:"override_file_access_action,omitempty" toml:"override_file_access_action"`
// EnableAllEventUpload bool `json:"enable_all_event_upload" toml:"enable_all_event_upload"`
// CleanSync bool `json:"clean_sync" toml:"clean_sync"`
}

// A PreflightPayload represents the request sent by a santa client to the sync server.
Expand Down
6 changes: 3 additions & 3 deletions santa/santa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func TestConfigMarshalUnmarshal(t *testing.T) {
t.Errorf("have client_mode %d, want %d\n", have, want)
}

if have, want := conf.CleanSync, true; have != want {
t.Errorf("have clean_sync %t, want %t\n", have, want)
}
// if have, want := conf.CleanSync, true; have != want {
// t.Errorf("have clean_sync %t, want %t\n", have, want)
// }

if have, want := conf.FullSyncInterval, 600; have != want {
t.Errorf("have full_sync_interval %d, want %d\n", have, want)
Expand Down

0 comments on commit 9df16c8

Please sign in to comment.