From efc67f8d09cf658787f5907f3cd360c6b2c3aa7e Mon Sep 17 00:00:00 2001 From: Noah Talerman <47070608+noahtalerman@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:16:57 -0500 Subject: [PATCH] Remove automation for `audit-logs.md` (#39937) - Instead, changes to activity will be specified as a PR to `audit-logs.md` in the reference doc release branch just like API and YAML (GitOps) changes --- .github/ISSUE_TEMPLATE/story.md | 2 +- docs/Contributing/reference/audit-logs.md | 1 - handbook/company/writing.md | 11 - server/fleet/activities.go | 1581 --------------------- server/fleet/gen_activity_doc.go | 52 - 5 files changed, 1 insertion(+), 1646 deletions(-) delete mode 100644 server/fleet/gen_activity_doc.go diff --git a/.github/ISSUE_TEMPLATE/story.md b/.github/ISSUE_TEMPLATE/story.md index abbe173f21..dc79490acd 100644 --- a/.github/ISSUE_TEMPLATE/story.md +++ b/.github/ISSUE_TEMPLATE/story.md @@ -32,7 +32,7 @@ It is [planned and ready](https://fleetdm.com/handbook/company/development-group - [ ] fleetdm.com changes: TODO - [ ] GitOps mode UI changes: TODO - [ ] GitOps generation changes: TODO -- [ ] Activity changes: TODO +- [ ] Activity changes: TODO - [ ] Permissions changes: TODO - [ ] Changes to paid features or tiers: TODO - [ ] My device and fleetdm.com/better changes: TODO diff --git a/docs/Contributing/reference/audit-logs.md b/docs/Contributing/reference/audit-logs.md index bf13158804..4afa1e59ad 100644 --- a/docs/Contributing/reference/audit-logs.md +++ b/docs/Contributing/reference/audit-logs.md @@ -1,4 +1,3 @@ - # Audit logs Fleet logs activities. diff --git a/handbook/company/writing.md b/handbook/company/writing.md index 101cdea935..1c61d06d9d 100644 --- a/handbook/company/writing.md +++ b/handbook/company/writing.md @@ -211,17 +211,6 @@ We leave large gaps between values to make future changes easier. For example, t When adding or reordering a page, try to leave as much room between values as possible. If you were adding a new page that would go between the two pages from the example above, you would add `` to the page. -### Audit logs - -The [Audit logs doc page](https://fleetdm.com/docs/Using-Fleet/Audit-logs) has a page generator that is used to speed up doc writing when Fleet adds new activity types. - -- If you're making a copy change to an existing activity type, [edit the `activities.go` file](https://github.com/fleetdm/fleet/blob/main/server/fleet/activities.go). -- If you're making a change to the top section or meta tags, [edit the `gen_activity_doc.go` file](https://github.com/fleetdm/fleet/blob/main/server/fleet/gen_activity_doc.go). -- If you're adding a new activity type, add the activity to the `ActivityDetailsList` list in the `activities.go` file. - -After making your changes, save them and run `make generate-doc`. This will generate a new `Audit-logs.md` file. Make sure you run the command in the top-level folder of your cloned Fleet repo. - - ## Writing style diff --git a/server/fleet/activities.go b/server/fleet/activities.go index e621f7c271..c8cdf91dac 100644 --- a/server/fleet/activities.go +++ b/server/fleet/activities.go @@ -6,8 +6,6 @@ import ( "time" ) -//go:generate go run gen_activity_doc.go "../../docs/Contributing/reference/audit-logs.md" - type ContextKey string type ActivityWebhookPayload struct { @@ -265,8 +263,6 @@ var ActivityDetailsList = []ActivityDetails{ type ActivityDetails interface { // ActivityName is the name/type of the activity. ActivityName() string - // Documentation is used by "go generate" to generate markdown docs. - Documentation() (activity string, details string, detailsExample string) } // ActivityHosts is the optional additional interface that can be implemented @@ -309,14 +305,6 @@ func (a ActivityTypeEnabledActivityAutomations) ActivityName() string { return "enabled_activity_automations" } -func (a ActivityTypeEnabledActivityAutomations) Documentation() (activity string, details string, detailsExample string) { - return `Generated when activity automations are enabled`, - `This activity contains the following field: -- "webhook_url": the URL to broadcast activities to.`, `{ - "webhook_url": "https://example.com/notify" -}` -} - type ActivityTypeEditedActivityAutomations struct { WebhookUrl string `json:"webhook_url"` } @@ -325,25 +313,12 @@ func (a ActivityTypeEditedActivityAutomations) ActivityName() string { return "edited_activity_automations" } -func (a ActivityTypeEditedActivityAutomations) Documentation() (activity string, details string, detailsExample string) { - return `Generated when activity automations are edited while enabled`, - `This activity contains the following field: -- "webhook_url": the URL to broadcast activities to, post-edit.`, `{ - "webhook_url": "https://example.com/notify" -}` -} - type ActivityTypeDisabledActivityAutomations struct{} func (a ActivityTypeDisabledActivityAutomations) ActivityName() string { return "disabled_activity_automations" } -func (a ActivityTypeDisabledActivityAutomations) Documentation() (activity string, details string, detailsExample string) { - return `Generated when activity automations are disabled`, - `This activity does not contain any detail fields.`, "" -} - type ActivityTypeCreatedPack struct { ID uint `json:"pack_id"` Name string `json:"pack_name"` @@ -353,16 +328,6 @@ func (a ActivityTypeCreatedPack) ActivityName() string { return "created_pack" } -func (a ActivityTypeCreatedPack) Documentation() (activity string, details string, detailsExample string) { - return `Generated when creating scheduled query packs.`, - `This activity contains the following fields: -- "pack_id": the id of the created pack. -- "pack_name": the name of the created pack.`, `{ - "pack_id": 123, - "pack_name": "foo" -}` -} - type ActivityTypeEditedPack struct { ID uint `json:"pack_id"` Name string `json:"pack_name"` @@ -372,16 +337,6 @@ func (a ActivityTypeEditedPack) ActivityName() string { return "edited_pack" } -func (a ActivityTypeEditedPack) Documentation() (activity string, details string, detailsExample string) { - return `Generated when editing scheduled query packs.`, - `This activity contains the following fields: -- "pack_id": the id of the edited pack. -- "pack_name": the name of the edited pack.`, `{ - "pack_id": 123, - "pack_name": "foo" -}` -} - type ActivityTypeDeletedPack struct { Name string `json:"pack_name"` } @@ -390,25 +345,12 @@ func (a ActivityTypeDeletedPack) ActivityName() string { return "deleted_pack" } -func (a ActivityTypeDeletedPack) Documentation() (activity string, details string, detailsExample string) { - return `Generated when deleting scheduled query packs.`, - `This activity contains the following fields: -- "pack_name": the name of the created pack.`, `{ - "pack_name": "foo" -}` -} - type ActivityTypeAppliedSpecPack struct{} func (a ActivityTypeAppliedSpecPack) ActivityName() string { return "applied_spec_pack" } -func (a ActivityTypeAppliedSpecPack) Documentation() (activity string, details string, detailsExample string) { - return `Generated when applying a scheduled query pack spec.`, - `This activity does not contain any detail fields.`, "" -} - type ActivityTypeCreatedPolicy struct { ID uint `json:"policy_id"` Name string `json:"policy_name"` @@ -420,20 +362,6 @@ func (a ActivityTypeCreatedPolicy) ActivityName() string { return "created_policy" } -func (a ActivityTypeCreatedPolicy) Documentation() (activity string, details string, detailsExample string) { - return `Generated when creating policies.`, - `This activity contains the following fields: -- "policy_id": the ID of the created policy. -- "policy_name": the name of the created policy. -- "team_id": the ID of the team the policy belongs to. Use -1 for global policies, 0 for "No Team" policies. -- "team_name": the name of the team the policy belongs to. null for global policies and "No Team" policies.`, `{ - "policy_id": 123, - "policy_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedPolicy struct { ID uint `json:"policy_id"` Name string `json:"policy_name"` @@ -445,20 +373,6 @@ func (a ActivityTypeEditedPolicy) ActivityName() string { return "edited_policy" } -func (a ActivityTypeEditedPolicy) Documentation() (activity string, details string, detailsExample string) { - return `Generated when editing policies.`, - `This activity contains the following fields: -- "policy_id": the ID of the edited policy. -- "policy_name": the name of the edited policy. -- "team_id": the ID of the team the policy belongs to. Use -1 for global policies, 0 for "No Team" policies. -- "team_name": the name of the team the policy belongs to. null for global policies and "No Team" policies.`, `{ - "policy_id": 123, - "policy_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedPolicy struct { ID uint `json:"policy_id"` Name string `json:"policy_name"` @@ -470,20 +384,6 @@ func (a ActivityTypeDeletedPolicy) ActivityName() string { return "deleted_policy" } -func (a ActivityTypeDeletedPolicy) Documentation() (activity string, details string, detailsExample string) { - return `Generated when deleting policies.`, - `This activity contains the following fields: -- "policy_id": the ID of the deleted policy. -- "policy_name": the name of the deleted policy. -- "team_id": the ID of the team the policy belonged to. Use -1 for global policies, 0 for "No Team" policies. -- "team_name": the name of the team the policy belonged to. null for global policies and "No Team" policies.`, `{ - "policy_id": 123, - "policy_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeAppliedSpecPolicy struct { Policies []*PolicySpec `json:"policies"` } @@ -492,38 +392,6 @@ func (a ActivityTypeAppliedSpecPolicy) ActivityName() string { return "applied_spec_policy" } -func (a ActivityTypeAppliedSpecPolicy) Documentation() (activity string, details string, detailsExample string) { - return `Generated when applying policy specs.`, - `This activity contains a field "policies" where each item is a policy spec with the following fields: -- "name": Name of the applied policy. -- "query": SQL query of the policy. -- "description": Description of the policy. -- "critical": Marks the policy as high impact. -- "resolution": Describes how to solve a failing policy. -- "team": Name of the team this policy belongs to. -- "platform": Comma-separated string to indicate the target platforms. -`, `{ - "policies": [ - { - "name":"Gatekeeper enabled (macOS)", - "query":"SELECT 1 FROM gatekeeper WHERE assessments_enabled = 1;", - "critical":false, - "platform":"darwin", - "resolution":"To enable Gatekeeper, on the failing device [...]", - "description":"Checks to make sure that the Gatekeeper feature is [...]" - }, - { - "name":"Full disk encryption enabled (Windows)", - "query":"SELECT 1 FROM bitlocker_info WHERE drive_letter='C:' AND protection_status=1;", - "critical":false, - "platform":"windows", - "resolution":"To get additional information, run the following osquery [...]", - "description":"Checks to make sure that full disk encryption is enabled on Windows devices." - } - ] -}` -} - type ActivityTypeCreatedSavedQuery struct { ID uint `json:"query_id" renameto:"report_id"` Name string `json:"query_name" renameto:"report_name"` @@ -535,20 +403,6 @@ func (a ActivityTypeCreatedSavedQuery) ActivityName() string { return "created_saved_query" } -func (a ActivityTypeCreatedSavedQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when creating a new query.`, - `This activity contains the following fields: -- "query_id": the ID of the created query. -- "query_name": the name of the created query. -- "team_id": the ID of the team the query belongs to. -- "team_name": the name of the team the query belongs to.`, `{ - "query_id": 123, - "query_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedSavedQuery struct { ID uint `json:"query_id" renameto:"report_id"` Name string `json:"query_name" renameto:"report_name"` @@ -560,20 +414,6 @@ func (a ActivityTypeEditedSavedQuery) ActivityName() string { return "edited_saved_query" } -func (a ActivityTypeEditedSavedQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when editing a saved query.`, - `This activity contains the following fields: -- "query_id": the ID of the query being edited. -- "query_name": the name of the query being edited. -- "team_id": the ID of the team the query belongs to. -- "team_name": the name of the team the query belongs to.`, `{ - "query_id": 123, - "query_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedSavedQuery struct { Name string `json:"query_name" renameto:"report_name"` TeamID int64 `json:"team_id" renameto:"fleet_id"` @@ -584,18 +424,6 @@ func (a ActivityTypeDeletedSavedQuery) ActivityName() string { return "deleted_saved_query" } -func (a ActivityTypeDeletedSavedQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when deleting a saved query.`, - `This activity contains the following fields: -- "query_name": the name of the query being deleted. -- "team_id": the ID of the team the query belongs to. -- "team_name": the name of the team the query belongs to.`, `{ - "query_name": "foo", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedMultipleSavedQuery struct { IDs []uint `json:"query_ids" renameto:"report_ids"` Teamid int64 `json:"team_id" renameto:"fleet_id"` @@ -606,19 +434,6 @@ func (a ActivityTypeDeletedMultipleSavedQuery) ActivityName() string { return "deleted_multiple_saved_query" } -func (a ActivityTypeDeletedMultipleSavedQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when deleting multiple saved queries.`, - `This activity contains the following fields: -- "query_ids": list of IDs of the deleted saved queries. -- "team_id": the ID of the team the queries belonged to. -1 for global queries, null for no team. -- "team_name": the name of the team the queries belonged to. null for global or no team queries.`, - `{ - "query_ids": [1, 42, 100], - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeAppliedSpecSavedQuery struct { Specs []*QuerySpec `json:"specs"` } @@ -627,22 +442,6 @@ func (a ActivityTypeAppliedSpecSavedQuery) ActivityName() string { return "applied_spec_saved_query" } -func (a ActivityTypeAppliedSpecSavedQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when applying a query spec.`, - `This activity contains a field "specs" where each item is a query spec with the following fields: -- "name": Name of the query. -- "description": Description of the query. -- "query": SQL query.`, `{ - "specs": [ - { - "name":"Get OpenSSL versions", - "query":"SELECT name AS name, version AS version, 'deb_packages' AS source FROM [...]", - "description":"Retrieves the OpenSSL version." - } - ] -}` -} - type ActivityTypeCreatedTeam struct { ID uint `json:"team_id" renameto:"fleet_id"` Name string `json:"team_name" renameto:"fleet_name"` @@ -652,16 +451,6 @@ func (a ActivityTypeCreatedTeam) ActivityName() string { return "created_team" } -func (a ActivityTypeCreatedTeam) Documentation() (activity string, details string, detailsExample string) { - return `Generated when creating teams.`, - `This activity contains the following fields: -- "team_id": unique ID of the created team. -- "team_name": the name of the created team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedTeam struct { ID uint `json:"team_id" renameto:"fleet_id"` Name string `json:"team_name" renameto:"fleet_name"` @@ -671,16 +460,6 @@ func (a ActivityTypeDeletedTeam) ActivityName() string { return "deleted_team" } -func (a ActivityTypeDeletedTeam) Documentation() (activity string, details string, detailsExample string) { - return `Generated when deleting teams.`, - `This activity contains the following fields: -- "team_id": unique ID of the deleted team. -- "team_name": the name of the deleted team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type TeamActivityDetail struct { ID uint `json:"id"` Name string `json:"name"` @@ -694,20 +473,6 @@ func (a ActivityTypeAppliedSpecTeam) ActivityName() string { return "applied_spec_team" } -func (a ActivityTypeAppliedSpecTeam) Documentation() (activity string, details string, detailsExample string) { - return `Generated when applying team specs.`, - `This activity contains a field "teams" where each item contains the team details with the following fields: -- "id": Unique ID of the team. -- "name": Name of the team.`, `{ - "teams": [ - { - "id": 123, - "name": "foo" - } - ] -}` -} - type ActivityTypeTransferredHostsToTeam struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -719,20 +484,6 @@ func (a ActivityTypeTransferredHostsToTeam) ActivityName() string { return "transferred_hosts" } -func (a ActivityTypeTransferredHostsToTeam) Documentation() (activity, details, detailsExample string) { - return `Generated when a user transfers a host (or multiple hosts) to a team (or no team).`, - `This activity contains the following fields: -- "team_id": The ID of the team that the hosts were transferred to, ` + "`null`" + ` if transferred to no team. -- "team_name": The name of the team that the hosts were transferred to, ` + "`null`" + ` if transferred to no team. -- "host_ids": The list of identifiers of the hosts that were transferred. -- "host_display_names": The list of display names of the hosts that were transferred (in the same order as the "host_ids").`, `{ - "team_id": 123, - "team_name": "Workstations", - "host_ids": [1, 2, 3], - "host_display_names": ["alice-macbook-air", "bob-macbook-pro", "linux-server"] -}` -} - type ActivityTypeEditedAgentOptions struct { Global bool `json:"global"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -743,18 +494,6 @@ func (a ActivityTypeEditedAgentOptions) ActivityName() string { return "edited_agent_options" } -func (a ActivityTypeEditedAgentOptions) Documentation() (activity string, details string, detailsExample string) { - return `Generated when agent options are edited (either globally or for a team).`, - `This activity contains the following fields: -- "global": "true" if the user updated the global agent options, "false" if the agent options of a team were updated. -- "team_id": unique ID of the team for which the agent options were updated (` + "`null`" + ` if global is true). -- "team_name": the name of the team for which the agent options were updated (` + "`null`" + ` if global is true).`, `{ - "team_id": 123, - "team_name": "Workstations", - "global": false -}` -} - type ActivityTypeLiveQuery struct { TargetsCount uint `json:"targets_count"` QuerySQL string `json:"query_sql" renameto:"report_sql"` @@ -766,29 +505,12 @@ func (a ActivityTypeLiveQuery) ActivityName() string { return "live_query" } -func (a ActivityTypeLiveQuery) Documentation() (activity string, details string, detailsExample string) { - return `Generated when running live queries.`, - `This activity contains the following fields: -- "targets_count": Number of hosts where the live query was targeted to run. -- "query_sql": The SQL query to run on hosts. -- "query_name": Name of the query (this field is not set if this was not a saved query).`, `{ - "targets_count": 5000, - "query_sql": "SELECT * from osquery_info;", - "query_name": "foo" -}` -} - type ActivityTypeUserAddedBySSO struct{} func (a ActivityTypeUserAddedBySSO) ActivityName() string { return "user_added_by_sso" } -func (a ActivityTypeUserAddedBySSO) Documentation() (activity string, details string, detailsExample string) { - return `Generated when new users are added via SSO JIT provisioning`, - `This activity does not contain any detail fields.`, "" -} - type ActivityTypeUserLoggedIn struct { PublicIP string `json:"public_ip"` } @@ -797,14 +519,6 @@ func (a ActivityTypeUserLoggedIn) ActivityName() string { return "user_logged_in" } -func (a ActivityTypeUserLoggedIn) Documentation() (activity string, details string, detailsExample string) { - return `Generated when users successfully log in to Fleet.`, - `This activity contains the following fields: -- "public_ip": Public IP of the login request.`, `{ - "public_ip": "168.226.215.82" -}` -} - type ActivityTypeUserFailedLogin struct { Email string `json:"email"` PublicIP string `json:"public_ip"` @@ -814,16 +528,6 @@ func (a ActivityTypeUserFailedLogin) ActivityName() string { return "user_failed_login" } -func (a ActivityTypeUserFailedLogin) Documentation() (activity string, details string, detailsExample string) { - return `Generated when users try to log in to Fleet and fail.`, - `This activity contains the following fields: -- "email": The email used in the login request. -- "public_ip": Public IP of the login request.`, `{ - "email": "foo@example.com", - "public_ip": "168.226.215.82" -}` -} - type ActivityTypeCreatedUser struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -834,18 +538,6 @@ func (a ActivityTypeCreatedUser) ActivityName() string { return "created_user" } -func (a ActivityTypeCreatedUser) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user is created.`, - `This activity contains the following fields: -- "user_id": Unique ID of the created user in Fleet. -- "user_name": Name of the created user. -- "user_email": E-mail of the created user.`, `{ - "user_id": 42, - "user_name": "Foo", - "user_email": "foo@example.com" -}` -} - type ActivityTypeDeletedUser struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -861,18 +553,6 @@ func (a ActivityTypeDeletedUser) WasFromAutomation() bool { return a.FromScimUserDeletion } -func (a ActivityTypeDeletedUser) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user is deleted.`, - `This activity contains the following fields: -- "user_id": Unique ID of the deleted user in Fleet. -- "user_name": Name of the deleted user. -- "user_email": E-mail of the deleted user.`, `{ - "user_id": 42, - "user_name": "Foo", - "user_email": "foo@example.com" -}` -} - type ActivityTypeDeletedHost struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -896,22 +576,6 @@ func (a ActivityTypeDeletedHost) WasFromAutomation() bool { return a.TriggeredBy == DeletedHostTriggeredByExpiration } -func (a ActivityTypeDeletedHost) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a host is deleted.`, - `This activity contains the following fields: -- "host_id": Unique ID of the deleted host in Fleet. -- "host_display_name": Display name of the deleted host. -- "host_serial": Hardware serial number of the deleted host. -- "triggered_by": How the deletion was triggered. Can be "manual" for manual deletions or "expiration" for automatic deletions due to host expiry settings. -- "host_expiry_window": (Optional) The number of days configured for host expiry. Only present when "triggered_by" is "expiration".`, `{ - "host_id": 42, - "host_display_name": "USER-WINDOWS", - "host_serial": "ABC123", - "triggered_by": "expiration", - "host_expiry_window": 30 -}` -} - type ActivityTypeChangedUserGlobalRole struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -923,20 +587,6 @@ func (a ActivityTypeChangedUserGlobalRole) ActivityName() string { return "changed_user_global_role" } -func (a ActivityTypeChangedUserGlobalRole) Documentation() (activity string, details string, detailsExample string) { - return `Generated when user global roles are changed.`, - `This activity contains the following fields: -- "user_id": Unique ID of the edited user in Fleet. -- "user_name": Name of the edited user. -- "user_email": E-mail of the edited user. -- "role": New global role of the edited user.`, `{ - "user_id": 42, - "user_name": "Foo", - "user_email": "foo@example.com", - "role": "Observer" -}` -} - type ActivityTypeDeletedUserGlobalRole struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -948,20 +598,6 @@ func (a ActivityTypeDeletedUserGlobalRole) ActivityName() string { return "deleted_user_global_role" } -func (a ActivityTypeDeletedUserGlobalRole) Documentation() (activity string, details string, detailsExample string) { - return `Generated when user global roles are deleted.`, - `This activity contains the following fields: -- "user_id": Unique ID of the edited user in Fleet. -- "user_name": Name of the edited user. -- "user_email": E-mail of the edited user. -- "role": Deleted global role of the edited user.`, `{ - "user_id": 43, - "user_name": "Foo", - "user_email": "foo@example.com", - "role": "Maintainer" -}` -} - type ActivityTypeChangedUserTeamRole struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -975,24 +611,6 @@ func (a ActivityTypeChangedUserTeamRole) ActivityName() string { return "changed_user_team_role" } -func (a ActivityTypeChangedUserTeamRole) Documentation() (activity string, details string, detailsExample string) { - return `Generated when user team roles are changed.`, - `This activity contains the following fields: -- "user_id": Unique ID of the edited user in Fleet. -- "user_name": Name of the edited user. -- "user_email": E-mail of the edited user. -- "role": Team role set to the edited user. -- "team_id": Unique ID of the team of the changed role. -- "team_name": Name of the team of the changed role.`, `{ - "user_id": 43, - "user_name": "Foo", - "user_email": "foo@example.com", - "role": "Maintainer", - "team_id": 5, - "team_name": "Bar" -}` -} - type ActivityTypeDeletedUserTeamRole struct { UserID uint `json:"user_id"` UserName string `json:"user_name"` @@ -1006,24 +624,6 @@ func (a ActivityTypeDeletedUserTeamRole) ActivityName() string { return "deleted_user_team_role" } -func (a ActivityTypeDeletedUserTeamRole) Documentation() (activity string, details string, detailsExample string) { - return `Generated when user team roles are deleted.`, - `This activity contains the following fields: -- "user_id": Unique ID of the edited user in Fleet. -- "user_name": Name of the edited user. -- "user_email": E-mail of the edited user. -- "role": Team role deleted from the edited user. -- "team_id": Unique ID of the team of the deleted role. -- "team_name": Name of the team of the deleted role.`, `{ - "user_id": 44, - "user_name": "Foo", - "user_email": "foo@example.com", - "role": "Observer", - "team_id": 2, - "team_name": "Zoo" -}` -} - type ActivityTypeFleetEnrolled struct { HostID uint `json:"host_id"` HostSerial string `json:"host_serial"` @@ -1034,18 +634,6 @@ func (a ActivityTypeFleetEnrolled) ActivityName() string { return "fleet_enrolled" } -func (a ActivityTypeFleetEnrolled) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a host is enrolled to Fleet (Fleet's agent fleetd is installed).`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_serial": Serial number of the host. -- "host_display_name": Display name of the host.`, `{ - "host_id": "123", - "host_serial": "B04FL3ALPT21", - "host_display_name": "WIN-DESKTOP-JGS78KJ7C" -}` -} - type ActivityTypeMDMEnrolled struct { HostSerial *string `json:"host_serial"` HostDisplayName string `json:"host_display_name"` @@ -1060,24 +648,6 @@ func (a ActivityTypeMDMEnrolled) ActivityName() string { return "mdm_enrolled" } -func (a ActivityTypeMDMEnrolled) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a host is enrolled in Fleet's MDM.`, - `This activity contains the following fields: -- "host_serial": Serial number of the host (Apple enrollments only, always empty for Microsoft). -- "host_display_name": Display name of the host. -- "installed_from_dep": Whether the host was enrolled via DEP (Apple enrollments only, always false for Microsoft). -- "mdm_platform": Used to distinguish between Apple and Microsoft enrollments. Can be "apple", "microsoft" or not present. If missing, this value is treated as "apple" for backwards compatibility. -- "enrollment_id": The unique identifier for MDM BYOD enrollments; null for other enrollments. -- "platform": The enrolled host's platform`, `{ - "host_serial": "C08VQ2AXHT96", - "host_display_name": "MacBookPro16,1 (C08VQ2AXHT96)", - "installed_from_dep": true, - "mdm_platform": "apple", - "enrollment_id": null, - "platform": "darwin" -}` -} - // TODO(BMAA): Should we add enrollment_id for BYOD unenrollments? type ActivityTypeMDMUnenrolled struct { HostSerial string `json:"host_serial"` @@ -1091,22 +661,6 @@ func (a ActivityTypeMDMUnenrolled) ActivityName() string { return "mdm_unenrolled" } -func (a ActivityTypeMDMUnenrolled) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a host is unenrolled from Fleet's MDM.`, - `This activity contains the following fields: -- "host_serial": Serial number of the host. -- "enrollment_id": Unique identifier for personal (BYOD) hosts. -- "host_display_name": Display name of the host. -- "installed_from_dep": Whether the host was enrolled via DEP. -- "platform": The unenrolled host's platform`, `{ - "host_serial": "C08VQ2AXHT96", - "enrollment_id": null, - "host_display_name": "MacBookPro16,1 (C08VQ2AXHT96)", - "installed_from_dep": true, - "platform": "darwin" -}` -} - type ActivityTypeEditedMacOSMinVersion struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1118,20 +672,6 @@ func (a ActivityTypeEditedMacOSMinVersion) ActivityName() string { return "edited_macos_min_version" } -func (a ActivityTypeEditedMacOSMinVersion) Documentation() (activity string, details string, detailsExample string) { - return `Generated when the minimum required macOS version or deadline is modified.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the minimum macOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the minimum macOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "minimum_version": The minimum macOS version required, empty if the requirement was removed. -- "deadline": The deadline by which the minimum version requirement must be applied, empty if the requirement was removed.`, `{ - "team_id": 3, - "team_name": "Workstations", - "minimum_version": "13.0.1", - "deadline": "2023-06-01" -}` -} - type ActivityTypeEnabledMacosUpdateNewHosts struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1141,16 +681,6 @@ func (a ActivityTypeEnabledMacosUpdateNewHosts) ActivityName() string { return "enabled_macos_update_new_hosts" } -func (a ActivityTypeEnabledMacosUpdateNewHosts) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user turns on updates during macOS Setup Assistant for hosts that automatically enroll (ADE).`, - `This activity contains the following fields: -- "team_id": The ID of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDisabledMacosUpdateNewHosts struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1160,16 +690,6 @@ func (a ActivityTypeDisabledMacosUpdateNewHosts) ActivityName() string { return "disabled_macos_update_new_hosts" } -func (a ActivityTypeDisabledMacosUpdateNewHosts) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user turns off updates during macOS Setup Assistant for hosts that automatically enroll (ADE).`, - `This activity contains the following fields: -- "team_id": The ID of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the setting applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedWindowsUpdates struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1181,20 +701,6 @@ func (a ActivityTypeEditedWindowsUpdates) ActivityName() string { return "edited_windows_updates" } -func (a ActivityTypeEditedWindowsUpdates) Documentation() (activity string, details string, detailsExample string) { - return `Generated when the Windows OS updates deadline or grace period is modified.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the Windows OS updates settings applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the Windows OS updates settings applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "deadline_days": The number of days before updates are installed, ` + "`null`" + ` if the requirement was removed. -- "grace_period_days": The number of days after the deadline before the host is forced to restart, ` + "`null`" + ` if the requirement was removed.`, `{ - "team_id": 3, - "team_name": "Workstations", - "deadline_days": 5, - "grace_period_days": 2 -}` -} - type ActivityTypeEditedIOSMinVersion struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1206,20 +712,6 @@ func (a ActivityTypeEditedIOSMinVersion) ActivityName() string { return "edited_ios_min_version" } -func (a ActivityTypeEditedIOSMinVersion) Documentation() (activity string, details string, detailsExample string) { - return `Generated when the minimum required iOS version or deadline is modified.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the minimum iOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the minimum iOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "minimum_version": The minimum iOS version required, empty if the requirement was removed. -- "deadline": The deadline by which the minimum version requirement must be applied, empty if the requirement was removed.`, `{ - "team_id": 3, - "team_name": "iPhones", - "minimum_version": "17.5.1", - "deadline": "2023-06-01" -}` -} - type ActivityTypeEditedIPadOSMinVersion struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1231,20 +723,6 @@ func (a ActivityTypeEditedIPadOSMinVersion) ActivityName() string { return "edited_ipados_min_version" } -func (a ActivityTypeEditedIPadOSMinVersion) Documentation() (activity string, details string, detailsExample string) { - return `Generated when the minimum required iPadOS version or deadline is modified.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the minimum iPadOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the minimum iPadOS version applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "minimum_version": The minimum iPadOS version required, empty if the requirement was removed. -- "deadline": The deadline by which the minimum version requirement must be applied, empty if the requirement was removed.`, `{ - "team_id": 3, - "team_name": "iPads", - "minimum_version": "17.5.1", - "deadline": "2023-06-01" -}` -} - type ActivityTypeReadHostDiskEncryptionKey struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1258,16 +736,6 @@ func (a ActivityTypeReadHostDiskEncryptionKey) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeReadHostDiskEncryptionKey) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user reads the disk encryption key for a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro" -}` -} - type ActivityTypeCreatedMacosProfile struct { ProfileName string `json:"profile_name"` ProfileIdentifier string `json:"profile_identifier"` @@ -1279,20 +747,6 @@ func (a ActivityTypeCreatedMacosProfile) ActivityName() string { return "created_macos_profile" } -func (a ActivityTypeCreatedMacosProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user adds a new macOS profile to a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the profile. -- "profile_identifier": Identifier of the profile. -- "team_id": The ID of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "profile_identifier": "com.my.profile", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedMacosProfile struct { ProfileName string `json:"profile_name"` ProfileIdentifier string `json:"profile_identifier"` @@ -1304,20 +758,6 @@ func (a ActivityTypeDeletedMacosProfile) ActivityName() string { return "deleted_macos_profile" } -func (a ActivityTypeDeletedMacosProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user deletes a macOS profile from a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the deleted profile. -- "profile_identifier": Identifier of deleted the profile. -- "team_id": The ID of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team. -- "team_name": The name of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "profile_identifier": "com.my.profile", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedMacosProfile struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1327,16 +767,6 @@ func (a ActivityTypeEditedMacosProfile) ActivityName() string { return "edited_macos_profile" } -func (a ActivityTypeEditedMacosProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user edits the macOS profiles of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeChangedMacosSetupAssistant struct { Name string `json:"name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1347,18 +777,6 @@ func (a ActivityTypeChangedMacosSetupAssistant) ActivityName() string { return "changed_macos_setup_assistant" } -func (a ActivityTypeChangedMacosSetupAssistant) Documentation() (activity, details, detailsExample string) { - return `Generated when a user sets the macOS setup assistant for a team (or no team).`, - `This activity contains the following fields: -- "name": Name of the macOS setup assistant file. -- "team_id": The ID of the team that the setup assistant applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the setup assistant applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "name": "dep_profile.json", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedMacosSetupAssistant struct { Name string `json:"name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1369,18 +787,6 @@ func (a ActivityTypeDeletedMacosSetupAssistant) ActivityName() string { return "deleted_macos_setup_assistant" } -func (a ActivityTypeDeletedMacosSetupAssistant) Documentation() (activity, details, detailsExample string) { - return `Generated when a user deletes the macOS setup assistant for a team (or no team).`, - `This activity contains the following fields: -- "name": Name of the deleted macOS setup assistant file. -- "team_id": The ID of the team that the setup assistant applied to, ` + "`null`" + ` if it applied to devices that are not in a team. -- "team_name": The name of the team that the setup assistant applied to, ` + "`null`" + ` if it applied to devices that are not in a team.`, `{ - "name": "dep_profile.json", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEnabledMacosDiskEncryption struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1390,16 +796,6 @@ func (a ActivityTypeEnabledMacosDiskEncryption) ActivityName() string { return "enabled_macos_disk_encryption" } -func (a ActivityTypeEnabledMacosDiskEncryption) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns on macOS disk encryption for a team (or no team).`, - `This activity contains the following fields: -- "team_id": The ID of the team that disk encryption applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that disk encryption applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDisabledMacosDiskEncryption struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1409,36 +805,18 @@ func (a ActivityTypeDisabledMacosDiskEncryption) ActivityName() string { return "disabled_macos_disk_encryption" } -func (a ActivityTypeDisabledMacosDiskEncryption) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns off macOS disk encryption for a team (or no team).`, - `This activity contains the following fields: -- "team_id": The ID of the team that disk encryption applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that disk encryption applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEnabledGitOpsMode struct{} func (a ActivityTypeEnabledGitOpsMode) ActivityName() string { return "enabled_gitops_mode" } -func (a ActivityTypeEnabledGitOpsMode) Documentation() (activity, details, detailsExample string) { - return `Generated when a user enables GitOps mode.`, `This activity does not contain any detail fields.`, `` -} - type ActivityTypeDisabledGitOpsMode struct{} func (a ActivityTypeDisabledGitOpsMode) ActivityName() string { return "disabled_gitops_mode" } -func (a ActivityTypeDisabledGitOpsMode) Documentation() (activity, details, detailsExample string) { - return `Generated when a user disables GitOps mode.`, `This activity does not contain any detail fields.`, `` -} - type ActivityTypeAddedBootstrapPackage struct { BootstrapPackageName string `json:"bootstrap_package_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1449,18 +827,6 @@ func (a ActivityTypeAddedBootstrapPackage) ActivityName() string { return "added_bootstrap_package" } -func (a ActivityTypeAddedBootstrapPackage) Documentation() (activity, details, detailsExample string) { - return `Generated when a user adds a new bootstrap package to a team (or no team).`, - `This activity contains the following fields: -- "package_name": Name of the package. -- "team_id": The ID of the team that the package applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the package applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "bootstrap_package_name": "bootstrap-package.pkg", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedBootstrapPackage struct { BootstrapPackageName string `json:"bootstrap_package_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1471,18 +837,6 @@ func (a ActivityTypeDeletedBootstrapPackage) ActivityName() string { return "deleted_bootstrap_package" } -func (a ActivityTypeDeletedBootstrapPackage) Documentation() (activity, details, detailsExample string) { - return `Generated when a user deletes a bootstrap package from a team (or no team).`, - `This activity contains the following fields: -- "package_name": Name of the package. -- "team_id": The ID of the team that the package applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the package applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "package_name": "bootstrap-package.pkg", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEnabledMacosSetupEndUserAuth struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1492,16 +846,6 @@ func (a ActivityTypeEnabledMacosSetupEndUserAuth) ActivityName() string { return "enabled_macos_setup_end_user_auth" } -func (a ActivityTypeEnabledMacosSetupEndUserAuth) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns on end user authentication for macOS hosts that automatically enroll to a team (or no team).`, - `This activity contains the following fields: -- "team_id": The ID of the team that end user authentication applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that end user authentication applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDisabledMacosSetupEndUserAuth struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1511,60 +855,30 @@ func (a ActivityTypeDisabledMacosSetupEndUserAuth) ActivityName() string { return "disabled_macos_setup_end_user_auth" } -func (a ActivityTypeDisabledMacosSetupEndUserAuth) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns off end user authentication for macOS hosts that automatically enroll to a team (or no team).`, - `This activity contains the following fields: -- "team_id": The ID of the team that end user authentication applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that end user authentication applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEnabledWindowsMDM struct{} func (a ActivityTypeEnabledWindowsMDM) ActivityName() string { return "enabled_windows_mdm" } -func (a ActivityTypeEnabledWindowsMDM) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns on MDM features for all Windows hosts (servers excluded).`, - `This activity does not contain any detail fields.`, `` -} - type ActivityTypeDisabledWindowsMDM struct{} func (a ActivityTypeDisabledWindowsMDM) ActivityName() string { return "disabled_windows_mdm" } -func (a ActivityTypeDisabledWindowsMDM) Documentation() (activity, details, detailsExample string) { - return `Generated when a user turns off MDM features for all Windows hosts.`, - `This activity does not contain any detail fields.`, `` -} - type ActivityTypeEnabledWindowsMDMMigration struct{} func (a ActivityTypeEnabledWindowsMDMMigration) ActivityName() string { return "enabled_windows_mdm_migration" } -func (a ActivityTypeEnabledWindowsMDMMigration) Documentation() (activity, details, detailsExample string) { - return `Generated when a user enables automatic MDM migration for Windows hosts, if Windows MDM is turned on.`, - `This activity does not contain any detail fields.`, `` -} - type ActivityTypeDisabledWindowsMDMMigration struct{} func (a ActivityTypeDisabledWindowsMDMMigration) ActivityName() string { return "disabled_windows_mdm_migration" } -func (a ActivityTypeDisabledWindowsMDMMigration) Documentation() (activity, details, detailsExample string) { - return `Generated when a user disables automatic MDM migration for Windows hosts, if Windows MDM is turned on.`, - `This activity does not contain any detail fields.`, `` -} - type ActivityTypeRanScript struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1593,28 +907,6 @@ func (a ActivityTypeRanScript) WasFromAutomation() bool { return a.PolicyID != nil || a.FromSetupExperience } -func (a ActivityTypeRanScript) Documentation() (activity, details, detailsExample string) { - return `Generated when a script is sent to be run for a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "script_execution_id": Execution ID of the script run. -- "batch_execution_id": Batch execution ID of the script run. -- "script_name": Name of the script (empty if it was an anonymous script). -- "async": Whether the script was executed asynchronously. -- "policy_id": ID of the policy whose failure triggered the script run. Null if no associated policy. -- "policy_name": Name of the policy whose failure triggered the script run. Null if no associated policy.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "script_name": "set-timezones.sh", - "script_execution_id": "d6cffa75-b5b5-41ef-9230-15073c8a88cf", - "batch_execution_id": "3274d95a-c140-4b17-b185-fb33c93b84e3", - "async": false, - "policy_id": 123, - "policy_name": "Ensure photon torpedoes are primed" -}` -} - type ActivityTypeAddedScript struct { ScriptName string `json:"script_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1625,18 +917,6 @@ func (a ActivityTypeAddedScript) ActivityName() string { return "added_script" } -func (a ActivityTypeAddedScript) Documentation() (activity, details, detailsExample string) { - return `Generated when a script is added to a team (or no team).`, - `This activity contains the following fields: -- "script_name": Name of the script. -- "team_id": The ID of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "script_name": "set-timezones.sh", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeUpdatedScript struct { ScriptName string `json:"script_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1647,18 +927,6 @@ func (a ActivityTypeUpdatedScript) ActivityName() string { return "updated_script" } -func (a ActivityTypeUpdatedScript) Documentation() (activity, details, detailsExample string) { - return `Generated when a script is updated.`, - `This activity contains the following fields: -- "script_name": Name of the script. -- "team_id": The ID of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "script_name": "set-timezones.sh", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedScript struct { ScriptName string `json:"script_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1669,18 +937,6 @@ func (a ActivityTypeDeletedScript) ActivityName() string { return "deleted_script" } -func (a ActivityTypeDeletedScript) Documentation() (activity, details, detailsExample string) { - return `Generated when a script is deleted from a team (or no team).`, - `This activity contains the following fields: -- "script_name": Name of the script. -- "team_id": The ID of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the script applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "script_name": "set-timezones.sh", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedScript struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1690,16 +946,6 @@ func (a ActivityTypeEditedScript) ActivityName() string { return "edited_script" } -func (a ActivityTypeEditedScript) Documentation() (activity, details, detailsExample string) { - return `Generated when a user edits the scripts of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the scripts apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the scripts apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeCreatedWindowsProfile struct { ProfileName string `json:"profile_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1710,18 +956,6 @@ func (a ActivityTypeCreatedWindowsProfile) ActivityName() string { return "created_windows_profile" } -func (a ActivityTypeCreatedWindowsProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user adds a new Windows profile to a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the profile. -- "team_id": The ID of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedWindowsProfile struct { ProfileName string `json:"profile_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -1732,18 +966,6 @@ func (a ActivityTypeDeletedWindowsProfile) ActivityName() string { return "deleted_windows_profile" } -func (a ActivityTypeDeletedWindowsProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user deletes a Windows profile from a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the deleted profile. -- "team_id": The ID of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team. -- "team_name": The name of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedWindowsProfile struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1753,16 +975,6 @@ func (a ActivityTypeEditedWindowsProfile) ActivityName() string { return "edited_windows_profile" } -func (a ActivityTypeEditedWindowsProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user edits the Windows profiles of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeLockedHost struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1777,18 +989,6 @@ func (a ActivityTypeLockedHost) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeLockedHost) Documentation() (activity, details, detailsExample string) { - return `Generated when a user sends a request to lock a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "view_pin": Whether lock PIN was viewed (for Apple devices).`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "view_pin": true -}` -} - type ActivityTypeUnlockedHost struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1803,18 +1003,6 @@ func (a ActivityTypeUnlockedHost) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeUnlockedHost) Documentation() (activity, details, detailsExample string) { - return `Generated when a user sends a request to unlock a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "host_platform": Platform of the host.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "host_platform": "darwin" -}` -} - type ActivityTypeWipedHost struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1828,16 +1016,6 @@ func (a ActivityTypeWipedHost) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeWipedHost) Documentation() (activity, details, detailsExample string) { - return `Generated when a user sends a request to wipe a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro" -}` -} - type ActivityTypeCreatedDeclarationProfile struct { ProfileName string `json:"profile_name"` Identifier string `json:"identifier"` @@ -1849,20 +1027,6 @@ func (a ActivityTypeCreatedDeclarationProfile) ActivityName() string { return "created_declaration_profile" } -func (a ActivityTypeCreatedDeclarationProfile) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user adds a new macOS declaration to a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the declaration. -- "identifier": Identifier of the declaration. -- "team_id": The ID of the team that the declaration applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the declaration applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "profile_name": "Passcode requirements", - "profile_identifier": "com.my.declaration", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedDeclarationProfile struct { ProfileName string `json:"profile_name"` Identifier string `json:"identifier"` @@ -1874,20 +1038,6 @@ func (a ActivityTypeDeletedDeclarationProfile) ActivityName() string { return "deleted_declaration_profile" } -func (a ActivityTypeDeletedDeclarationProfile) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user removes a macOS declaration from a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the declaration. -- "identifier": Identifier of the declaration. -- "team_id": The ID of the team that the declaration applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the declaration applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "profile_name": "Passcode requirements", - "profile_identifier": "com.my.declaration", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedDeclarationProfile struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -1897,16 +1047,6 @@ func (a ActivityTypeEditedDeclarationProfile) ActivityName() string { return "edited_declaration_profile" } -func (a ActivityTypeEditedDeclarationProfile) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user edits the macOS declarations of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the declarations apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the declarations apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeResentConfigurationProfile struct { HostID *uint `json:"host_id"` HostDisplayName *string `json:"host_display_name"` @@ -1917,18 +1057,6 @@ func (a ActivityTypeResentConfigurationProfile) ActivityName() string { return "resent_configuration_profile" } -func (a ActivityTypeResentConfigurationProfile) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user resends a configuration profile to a host.`, - `This activity contains the following fields: -- "host_id": The ID of the host. -- "host_display_name": The display name of the host. -- "profile_name": The name of the configuration profile.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "profile_name": "Passcode requirements" -}` -} - type ActivityTypeResentConfigurationProfileBatch struct { ProfileName string `json:"profile_name"` HostCount int64 `json:"host_count"` @@ -1938,16 +1066,6 @@ func (a ActivityTypeResentConfigurationProfileBatch) ActivityName() string { return "resent_configuration_profile_batch" } -func (a ActivityTypeResentConfigurationProfileBatch) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user resends a configuration profile to a batch of hosts.`, - `This activity contains the following fields: -- "profile_name": The name of the configuration profile. -- "host_count": Number of hosts in the batch.`, `{ - "profile_name": "Passcode requirements", - "host_count": 3 -}` -} - type ActivityTypeInstalledSoftware struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -1987,34 +1105,6 @@ func (a ActivityTypeInstalledSoftware) ActivateNextUpcomingActivityArgs() (uint, return a.HostID, a.CommandUUID } -func (a ActivityTypeInstalledSoftware) Documentation() (activity, details, detailsExample string) { - return `Generated when a Fleet-maintained app or custom package is installed on a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "install_uuid": ID of the software installation. -- "self_service": Whether the installation was initiated by the end user. -- "software_title": Name of the software. -- "software_package": Filename of the installer. -- "status": Status of the software installation. -- "source": Software source type (e.g., "pkg_packages", "sh_packages", "ps1_packages"). -- "policy_id": ID of the policy whose failure triggered the installation. Null if no associated policy. -- "policy_name": Name of the policy whose failure triggered installation. Null if no associated policy. -- "command_uuid": ID of the in-house app installation. -`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Falcon.app", - "software_package": "FalconSensor-6.44.pkg", - "self_service": true, - "install_uuid": "d6cffa75-b5b5-41ef-9230-15073c8a88cf", - "status": "pending", - "source": "pkg_packages", - "policy_id": 1337, - "policy_name": "Ensure 1Password is installed and up to date" -}` -} - type ActivityTypeUninstalledSoftware struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2033,26 +1123,6 @@ func (a ActivityTypeUninstalledSoftware) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeUninstalledSoftware) Documentation() (activity, details, detailsExample string) { - return `Generated when a Fleet-maintained app or custom package is uninstalled on a host.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "software_title": Name of the software. -- "script_execution_id": ID of the software uninstall script. -- "self_service": Whether the uninstallation was initiated by the end user from the My device UI. -- "status": Status of the software uninstallation. -- "source": Software source type (e.g., "pkg_packages", "sh_packages", "ps1_packages").`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Falcon.app", - "script_execution_id": "ece8d99d-4313-446a-9af2-e152cd1bad1e", - "self_service": false, - "status": "uninstalled", - "source": "pkg_packages" -}` -} - type ActivitySoftwareLabel struct { Name string `json:"name"` ID uint `json:"id"` @@ -2073,35 +1143,6 @@ func (a ActivityTypeAddedSoftware) ActivityName() string { return "added_software" } -func (a ActivityTypeAddedSoftware) Documentation() (string, string, string) { - return `Generated when a Fleet-maintained app or custom package is added to Fleet.`, `This activity contains the following fields: -- "software_title": Name of the software. -- "software_package": Filename of the installer. -- "team_name": Name of the team to which this software was added.` + " `null` " + `if it was added to no team." + -- "team_id": The ID of the team to which this software was added.` + " `null` " + `if it was added to no team. -- "self_service": Whether the software is available for installation by the end user. -- "software_title_id": ID of the added software title. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array.`, `{ - "software_title": "Falcon.app", - "software_package": "FalconSensor-6.44.pkg", - "team_name": "Workstations", - "team_id": 123, - "self_service": true, - "software_title_id": 2234, - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] -}` -} - type ActivityTypeEditedSoftware struct { SoftwareTitle string `json:"software_title"` SoftwarePackage *string `json:"software_package"` @@ -2119,38 +1160,6 @@ func (a ActivityTypeEditedSoftware) ActivityName() string { return "edited_software" } -func (a ActivityTypeEditedSoftware) Documentation() (string, string, string) { - return `Generated when a Fleet-maintained app or custom package is edited in Fleet.`, `This activity contains the following fields: -- "software_title": Name of the software. -- "software_package": Filename of the installer as of this update (including if unchanged). -- "team_name": Name of the team on which this software was updated.` + " `null` " + `if it was updated on no team. -- "team_id": The ID of the team on which this software was updated.` + " `null` " + `if it was updated on no team. -- "self_service": Whether the software is available for installation by the end user. -- "software_title_id": ID of the added software title. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array. -- "software_display_name": Display name of the software title.`, `{ - "software_title": "Falcon.app", - "software_package": "FalconSensor-6.44.pkg", - "team_name": "Workstations", - "team_id": 123, - "self_service": true, - "software_title_id": 2234, - "software_icon_url": "/api/latest/fleet/software/titles/2234/icon?team_id=123", - "software_display_name": "Crowdstrike Falcon", - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] -}` -} - type ActivityTypeDeletedSoftware struct { SoftwareTitle string `json:"software_title"` SoftwarePackage string `json:"software_package"` @@ -2166,34 +1175,6 @@ func (a ActivityTypeDeletedSoftware) ActivityName() string { return "deleted_software" } -func (a ActivityTypeDeletedSoftware) Documentation() (string, string, string) { - return `Generated when a Fleet maintained app or custom package is deleted from Fleet.`, `This activity contains the following fields: -- "software_title": Name of the software. -- "software_package": Filename of the installer. -- "team_name": Name of the team to which this software was added.` + " `null` " + `if it was added to no team. -- "team_id": The ID of the team to which this software was added.` + " `null` " + `if it was added to no team. -- "self_service": Whether the software was available for installation by the end user. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array.`, `{ - "software_title": "Falcon.app", - "software_package": "FalconSensor-6.44.pkg", - "team_name": "Workstations", - "team_id": 123, - "self_service": true, - "software_icon_url": "", - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] -}` -} - // LogRoleChangeActivities logs activities for each role change, globally and one for each change in teams. func LogRoleChangeActivities( ctx context.Context, svc Service, adminUser *User, oldGlobalRole *string, oldTeamRoles []UserTeam, user *User, @@ -2283,13 +1264,6 @@ func (a ActivityEnabledVPP) ActivityName() string { return "enabled_vpp" } -func (a ActivityEnabledVPP) Documentation() (activity string, details string, detailsExample string) { - return "Generated when VPP features are enabled in Fleet.", `This activity contains the following fields: -- "location": Location associated with the VPP content token for the enabled VPP features.`, `{ - "location": "Acme Inc." -}` -} - type ActivityDisabledVPP struct { Location string `json:"location"` } @@ -2298,13 +1272,6 @@ func (a ActivityDisabledVPP) ActivityName() string { return "disabled_vpp" } -func (a ActivityDisabledVPP) Documentation() (activity string, details string, detailsExample string) { - return "Generated when VPP features are disabled in Fleet.", `This activity contains the following fields: -- "location": Location associated with the VPP content token for the disabled VPP features.`, `{ - "location": "Acme Inc." -}` -} - type ActivityAddedAppStoreApp struct { SoftwareTitle string `json:"software_title"` SoftwareTitleId uint `json:"software_title_id"` @@ -2322,37 +1289,6 @@ func (a ActivityAddedAppStoreApp) ActivityName() string { return "added_app_store_app" } -func (a ActivityAddedAppStoreApp) Documentation() (activity string, details string, detailsExample string) { - return "Generated when an App Store app is added to Fleet.", `This activity contains the following fields: -- "software_title": Name of the App Store app. -- "software_title_id": ID of the added software title. -- "app_store_id": ID of the app on the Apple App Store or Google Play. -- "platform": Platform of the app (` + "`android`, `darwin`, `ios`, or `ipados`" + `). -- "self_service": App installation can be initiated by device owner. -- "team_name": Name of the team to which this App Store app was added, or ` + "`null`" + ` if it was added to no team. -- "team_id": ID of the team to which this App Store app was added, or ` + "`null`" + `if it was added to no team. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array.`, `{ - "software_title": "Logic Pro", - "software_title_id": 123, - "app_store_id": "1234567", - "platform": "darwin", - "self_service": false, - "team_name": "Workstations", - "team_id": 1, - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] -}` -} - type ActivityDeletedAppStoreApp struct { SoftwareTitle string `json:"software_title"` AppStoreID string `json:"app_store_id"` @@ -2368,34 +1304,6 @@ func (a ActivityDeletedAppStoreApp) ActivityName() string { return "deleted_app_store_app" } -func (a ActivityDeletedAppStoreApp) Documentation() (activity string, details string, detailsExample string) { - return "Generated when an App Store app is deleted from Fleet.", `This activity contains the following fields: -- "software_title": Name of the App Store app. -- "app_store_id": ID of the app on the Apple App Store or Google Play. -- "platform": Platform of the app (` + "`android`, `darwin`, `ios`, or `ipados`" + `). -- "team_name": Name of the team from which this App Store app was deleted, or ` + "`null`" + ` if it was deleted from no team. -- "team_id": ID of the team from which this App Store app was deleted, or ` + "`null`" + `if it was deleted from no team. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array`, `{ - "software_title": "Logic Pro", - "app_store_id": "1234567", - "platform": "darwin", - "team_name": "Workstations", - "team_id": 1, - "software_icon_url": "", - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] -}` -} - type ActivityInstalledAppStoreApp struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2435,28 +1343,6 @@ func (a ActivityInstalledAppStoreApp) ActivateNextUpcomingActivityArgs() (uint, return a.HostID, a.CommandUUID } -func (a ActivityInstalledAppStoreApp) Documentation() (string, string, string) { - return "Generated when an App Store app is installed on a device.", `This activity contains the following fields: -- "host_id": ID of the host on which the app was installed. -- "self_service": App installation was initiated by device owner. -- "host_display_name": Display name of the host. -- "software_title": Name of the App Store app. -- "app_store_id": ID of the app on the Apple App Store or Google Play. -- "status": Status of the App Store app installation. -- "command_uuid": UUID of the MDM command used to install the app. -- "policy_id": ID of the policy whose failure triggered the install. Null if no associated policy. -- "policy_name": Name of the policy whose failure triggered the install. Null if no associated policy.`, `{ - "host_id": 42, - "self_service": true, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Logic Pro", - "app_store_id": "1234567", - "command_uuid": "98765432-1234-1234-1234-1234567890ab", - "policy_id": 123, - "policy_name": "[Install Software] Logic Pro" -}` -} - type ActivityEditedAppStoreApp struct { SoftwareTitle string `json:"software_title"` SoftwareTitleID uint `json:"software_title_id"` @@ -2479,77 +1365,24 @@ func (a ActivityEditedAppStoreApp) ActivityName() string { return "edited_app_store_app" } -func (a ActivityEditedAppStoreApp) Documentation() (activity string, details string, detailsExample string) { - return "Generated when an App Store app is updated in Fleet.", `This activity contains the following fields: -- "software_title": Name of the App Store app. -- "software_title_id": ID of the updated app's software title. -- "app_store_id": ID of the app on the Apple App Store or Google Play. -- "platform": Platform of the app (` + "`android`, `darwin`, `ios`, or `ipados`" + `). -- "self_service": App installation can be initiated by device owner. -- "team_name": Name of the team on which this App Store app was updated, or ` + "`null`" + ` if it was updated on no team. -- "team_id": ID of the team on which this App Store app was updated, or ` + "`null`" + `if it was updated on no team. -- "labels_include_any": Target hosts that have any label in the array. -- "labels_exclude_any": Target hosts that don't have any label in the array. -- "software_display_name": Display name of the software title. -- "auto_update_enabled": Whether automatic updates are enabled for iOS/iPadOS App Store (VPP) apps. -- "auto_update_window_start": Update window start time (local time of the device) when automatic updates will take place for iOS/iPadOS App Store (VPP) apps, formatted as HH:MM. -- "auto_update_window_end": Update window end time (local time of the device) when automatic updates will take place for iOS/iPadOS App Store (VPP) apps, formatted as HH:MM. -`, `{ - "software_title": "Logic Pro", - "software_title_id": 123, - "app_store_id": "1234567", - "platform": "darwin", - "self_service": true, - "team_name": "Workstations", - "team_id": 1, - "software_icon_url": "/api/latest/fleet/software/titles/123/icon?team_id=1", - "labels_include_any": [ - { - "name": "Engineering", - "id": 12 - }, - { - "name": "Product", - "id": 17 - } - ] - "software_display_name": "Logic Pro DAW" - "auto_update_enabled": true - "auto_update_window_start": "22:00" - "auto_update_window_end": "02:00" -}` -} - type ActivityAddedNDESSCEPProxy struct{} func (a ActivityAddedNDESSCEPProxy) ActivityName() string { return "added_ndes_scep_proxy" } -func (a ActivityAddedNDESSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when NDES SCEP proxy is configured in Fleet.", `This activity does not contain any detail fields.`, `` -} - type ActivityDeletedNDESSCEPProxy struct{} func (a ActivityDeletedNDESSCEPProxy) ActivityName() string { return "deleted_ndes_scep_proxy" } -func (a ActivityDeletedNDESSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when NDES SCEP proxy configuration is deleted in Fleet.", `This activity does not contain any detail fields.`, `` -} - type ActivityEditedNDESSCEPProxy struct{} func (a ActivityEditedNDESSCEPProxy) ActivityName() string { return "edited_ndes_scep_proxy" } -func (a ActivityEditedNDESSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when NDES SCEP proxy configuration is edited in Fleet.", `This activity does not contain any detail fields.`, `` -} - type ActivityAddedCustomSCEPProxy struct { Name string `json:"name"` } @@ -2558,13 +1391,6 @@ func (a ActivityAddedCustomSCEPProxy) ActivityName() string { return "added_custom_scep_proxy" } -func (a ActivityAddedCustomSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when SCEP certificate authority configuration is added in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SCEP_WIFI" -}` -} - type ActivityDeletedCustomSCEPProxy struct { Name string `json:"name"` } @@ -2573,13 +1399,6 @@ func (a ActivityDeletedCustomSCEPProxy) ActivityName() string { return "deleted_custom_scep_proxy" } -func (a ActivityDeletedCustomSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when SCEP certificate authority configuration is deleted in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SCEP_WIFI" -}` -} - type ActivityEditedCustomSCEPProxy struct { Name string `json:"name"` } @@ -2588,13 +1407,6 @@ func (a ActivityEditedCustomSCEPProxy) ActivityName() string { return "edited_custom_scep_proxy" } -func (a ActivityEditedCustomSCEPProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when SCEP certificate authority configuration is edited in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SCEP_WIFI" -}` -} - type ActivityAddedDigiCert struct { Name string `json:"name"` } @@ -2603,13 +1415,6 @@ func (a ActivityAddedDigiCert) ActivityName() string { return "added_digicert" } -func (a ActivityAddedDigiCert) Documentation() (activity string, details string, detailsExample string) { - return "Generated when DigiCert certificate authority configuration is added in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "DIGICERT_WIFI" -}` -} - type ActivityDeletedDigiCert struct { Name string `json:"name"` } @@ -2618,13 +1423,6 @@ func (a ActivityDeletedDigiCert) ActivityName() string { return "deleted_digicert" } -func (a ActivityDeletedDigiCert) Documentation() (activity string, details string, detailsExample string) { - return "Generated when DigiCert certificate authority configuration is deleted in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "DIGICERT_WIFI" -}` -} - type ActivityEditedDigiCert struct { Name string `json:"name"` } @@ -2633,13 +1431,6 @@ func (a ActivityEditedDigiCert) ActivityName() string { return "edited_digicert" } -func (a ActivityEditedDigiCert) Documentation() (activity string, details string, detailsExample string) { - return "Generated when DigiCert certificate authority configuration is edited in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "DIGICERT_WIFI" -}` -} - type ActivityAddedHydrant struct { Name string `json:"name"` } @@ -2648,13 +1439,6 @@ func (a ActivityAddedHydrant) ActivityName() string { return "added_hydrant" } -func (a ActivityAddedHydrant) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Hydrant certificate authority configuration is added in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "HYDRANT_WIFI" -}` -} - type ActivityDeletedHydrant struct { Name string `json:"name"` } @@ -2663,13 +1447,6 @@ func (a ActivityDeletedHydrant) ActivityName() string { return "deleted_hydrant" } -func (a ActivityDeletedHydrant) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Hydrant certificate authority configuration is deleted in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "HYDRANT_WIFI" -}` -} - type ActivityEditedHydrant struct { Name string `json:"name"` } @@ -2678,13 +1455,6 @@ func (a ActivityEditedHydrant) ActivityName() string { return "edited_hydrant" } -func (a ActivityEditedHydrant) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Hydrant certificate authority configuration is edited in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "HYDRANT_WIFI" -}` -} - type ActivityAddedCustomESTProxy struct { Name string `json:"name"` } @@ -2693,13 +1463,6 @@ func (a ActivityAddedCustomESTProxy) ActivityName() string { return "added_custom_est_proxy" } -func (a ActivityAddedCustomESTProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when a custom EST certificate authority configuration is added in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "EST_WIFI" -}` -} - type ActivityDeletedCustomESTProxy struct { Name string `json:"name"` } @@ -2708,13 +1471,6 @@ func (a ActivityDeletedCustomESTProxy) ActivityName() string { return "deleted_custom_est_proxy" } -func (a ActivityDeletedCustomESTProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when a custom EST certificate authority configuration is deleted in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "EST_WIFI" -}` -} - type ActivityEditedCustomESTProxy struct { Name string `json:"name"` } @@ -2723,13 +1479,6 @@ func (a ActivityEditedCustomESTProxy) ActivityName() string { return "edited_custom_est_proxy" } -func (a ActivityEditedCustomESTProxy) Documentation() (activity string, details string, detailsExample string) { - return "Generated when a custom EST certificate authority configuration is edited in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "EST_WIFI" -}` -} - type ActivityAddedSmallstep struct { Name string `json:"name"` } @@ -2738,13 +1487,6 @@ func (a ActivityAddedSmallstep) ActivityName() string { return "added_smallstep" } -func (a ActivityAddedSmallstep) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Smallstep certificate authority configuration is added in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SMALLSTEP_WIFI" -}` -} - type ActivityDeletedSmallstep struct { Name string `json:"name"` } @@ -2753,13 +1495,6 @@ func (a ActivityDeletedSmallstep) ActivityName() string { return "deleted_smallstep" } -func (a ActivityDeletedSmallstep) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Smallstep certificate authority configuration is deleted in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SMALLSTEP_WIFI" -}` -} - type ActivityEditedSmallstep struct { Name string `json:"name"` } @@ -2768,27 +1503,12 @@ func (a ActivityEditedSmallstep) ActivityName() string { return "edited_smallstep" } -func (a ActivityEditedSmallstep) Documentation() (activity string, details string, detailsExample string) { - return "Generated when Smallstep certificate authority configuration is edited in Fleet.", `This activity contains the following fields: -- "name": Name of the certificate authority.`, `{ - "name": "SMALLSTEP_WIFI" -}` -} - type ActivityTypeEnabledAndroidMDM struct{} func (a ActivityTypeEnabledAndroidMDM) ActivityName() string { return "enabled_android_mdm" } -func (a ActivityTypeEnabledAndroidMDM) Documentation() (activity string, details string, detailsExample string) { - return "Generated when a user turns on MDM features for all Android hosts.", `This activity does not contain any detail fields.`, `` -} - type ActivityTypeDisabledAndroidMDM struct{} func (a ActivityTypeDisabledAndroidMDM) ActivityName() string { return "disabled_android_mdm" } -func (a ActivityTypeDisabledAndroidMDM) Documentation() (activity string, details string, detailsExample string) { - return "Generated when a user turns off MDM features for all Android hosts.", `This activity does not contain any detail fields.`, `` -} - type ActivityTypeCanceledRunScript struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2803,18 +1523,6 @@ func (a ActivityTypeCanceledRunScript) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeCanceledRunScript) Documentation() (activity, details, detailsExample string) { - return "Generated when upcoming activity `ran_script` is canceled.", - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "script_name": Name of the script (empty if it was an anonymous script).`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "script_name": "set-timezones.sh" -}` -} - type ActivityTypeCanceledInstallSoftware struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2830,20 +1538,6 @@ func (a ActivityTypeCanceledInstallSoftware) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeCanceledInstallSoftware) Documentation() (activity, details, detailsExample string) { - return "Generated when upcoming activity `installed_software` is canceled.", - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "software_title": Name of the software. -- "software_title_id": ID of the software title.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Adobe Acrobat.app", - "software_title_id": 12334 -}` -} - type ActivityTypeCanceledUninstallSoftware struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2859,20 +1553,6 @@ func (a ActivityTypeCanceledUninstallSoftware) HostIDs() []uint { return []uint{a.HostID} } -func (a ActivityTypeCanceledUninstallSoftware) Documentation() (activity, details, detailsExample string) { - return "Generated when upcoming activity `uninstalled_software` is canceled.", - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "software_title": Name of the software. -- "software_title_id": ID of the software title.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Adobe Acrobat.app", - "software_title_id": 12334 -}` -} - type ActivityTypeCanceledInstallAppStoreApp struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -2888,19 +1568,6 @@ func (a ActivityTypeCanceledInstallAppStoreApp) ActivityName() string { return "canceled_install_app_store_app" } -func (a ActivityTypeCanceledInstallAppStoreApp) Documentation() (string, string, string) { - return "Generated when upcoming activity `installed_app_store_app` is canceled.", `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "software_title": Name of the software. -- "software_title_id": ID of the software title.`, `{ - "host_id": 123, - "host_display_name": "Anna's MacBook Pro", - "software_title": "Adobe Acrobat.app", - "software_title_id": 12334 -}` -} - type ActivityTypeRanScriptBatch struct { ScriptName string `json:"script_name"` BatchExecutionID string `json:"batch_execution_id"` @@ -2912,18 +1579,6 @@ func (a ActivityTypeRanScriptBatch) ActivityName() string { return "ran_script_batch" } -func (a ActivityTypeRanScriptBatch) Documentation() (string, string, string) { - return "Generated when a script is run on a batch of hosts.", - `This activity contains the following fields: -- "script_name": Name of the script. -- "batch_execution_id": Execution ID of the batch script run. -- "host_count": Number of hosts in the batch.`, `{ - "script_name": "set-timezones.sh", - "batch_execution_id": "d6cffa75-b5b5-41ef-9230-15073c8a88cf", - "host_count": 12 -}` -} - type ActivityTypeBatchScriptScheduled struct { BatchExecutionID string `json:"batch_execution_id"` ScriptName *string `json:"script_name,omitempty"` @@ -2936,20 +1591,6 @@ func (a ActivityTypeBatchScriptScheduled) ActivityName() string { return "scheduled_script_batch" } -func (a ActivityTypeBatchScriptScheduled) Documentation() (string, string, string) { - return "Generated when a batch script is scheduled.", - `This activity contains the following fields: -- "batch_execution_id": Execution ID of the batch script run. -- "script_name": Name of the script. -- "host_count": Number of hosts in the batch. -- "not_before": Time that the batch activity is scheduled to launch.`, `{ - "batch_execution_id": "d6cffa75-b5b5-41ef-9230-15073c8a88cf", - "script_name": "set-timezones.sh", - "host_count": 12, - "not_before": "2025-08-06T17:49:21.810204Z" -}` -} - type ActivityTypeBatchScriptCanceled struct { BatchExecutionID string `json:"batch_execution_id"` ScriptName string `json:"script_name"` @@ -2961,64 +1602,30 @@ func (a ActivityTypeBatchScriptCanceled) ActivityName() string { return "canceled_script_batch" } -func (a ActivityTypeBatchScriptCanceled) Documentation() (string, string, string) { - return "Generated when a batch script is canceled.", - `This activity contains the following fields: -- "batch_execution_id": Execution ID of the batch script run. -- "script_name": Name of the script. -- "host_count": Number of hosts in the batch. -- "canceled_count": Number of hosts the job was canceled for.`, `{ - "batch_execution_id": "d6cffa75-b5b5-41ef-9230-15073c8a88cf", - "script_name": "set-timezones.sh", - "host_count": 12, - "canceled_count": 5 -}` -} - type ActivityTypeAddedConditionalAccessIntegrationMicrosoft struct{} func (a ActivityTypeAddedConditionalAccessIntegrationMicrosoft) ActivityName() string { return "added_conditional_access_integration_microsoft" } -func (a ActivityTypeAddedConditionalAccessIntegrationMicrosoft) Documentation() (string, string, string) { - return "Generated when Microsoft Entra is connected for conditional access.", - "This activity does not contain any detail fields.", "" -} - type ActivityTypeDeletedConditionalAccessIntegrationMicrosoft struct{} func (a ActivityTypeDeletedConditionalAccessIntegrationMicrosoft) ActivityName() string { return "deleted_conditional_access_integration_microsoft" } -func (a ActivityTypeDeletedConditionalAccessIntegrationMicrosoft) Documentation() (string, string, string) { - return "Generated when Microsoft Entra is integration is disconnected.", - "This activity does not contain any detail fields.", "" -} - type ActivityTypeAddedConditionalAccessOkta struct{} func (a ActivityTypeAddedConditionalAccessOkta) ActivityName() string { return "added_conditional_access_okta" } -func (a ActivityTypeAddedConditionalAccessOkta) Documentation() (string, string, string) { - return "Generated when Okta is configured or edited for conditional access.", - "This activity does not contain any detail fields.", "" -} - type ActivityTypeDeletedConditionalAccessOkta struct{} func (a ActivityTypeDeletedConditionalAccessOkta) ActivityName() string { return "deleted_conditional_access_okta" } -func (a ActivityTypeDeletedConditionalAccessOkta) Documentation() (string, string, string) { - return "Generated when Okta conditional access configuration is removed.", - "This activity does not contain any detail fields.", "" -} - type ActivityTypeEnabledConditionalAccessAutomations struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName string `json:"team_name" renameto:"fleet_name"` @@ -3028,16 +1635,6 @@ func (a ActivityTypeEnabledConditionalAccessAutomations) ActivityName() string { return "enabled_conditional_access_automations" } -func (a ActivityTypeEnabledConditionalAccessAutomations) Documentation() (string, string, string) { - return "Generated when conditional access automations are enabled for a team.", - `This activity contains the following field: -- "team_id": The ID of the team ("null" for "No team"). -- "team_name": The name of the team (empty for "No team").`, `{ - "team_id": 5, - "team_name": "Workstations" -}` -} - type ActivityTypeDisabledConditionalAccessAutomations struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName string `json:"team_name" renameto:"fleet_name"` @@ -3047,16 +1644,6 @@ func (a ActivityTypeDisabledConditionalAccessAutomations) ActivityName() string return "disabled_conditional_access_automations" } -func (a ActivityTypeDisabledConditionalAccessAutomations) Documentation() (string, string, string) { - return "Generated when conditional access automations are disabled for a team.", - `This activity contains the following field: -- "team_id": The ID of the team (` + "`null`" + ` for "No team"). -- "team_name": The name of the team (empty for "No team").`, `{ - "team_id": 5, - "team_name": "Workstations" -}` -} - type ActivityTypeUpdateConditionalAccessBypass struct { BypassDisabled bool `json:"bypass_disabled"` } @@ -3065,14 +1652,6 @@ func (a ActivityTypeUpdateConditionalAccessBypass) ActivityName() string { return "update_conditional_access_bypass" } -func (a ActivityTypeUpdateConditionalAccessBypass) Documentation() (activity string, details string, detailsExample string) { - return `Generated when conditional access bypass settings are updated.`, - `This activity contains the following field: -- "bypass_disabled": Whether conditional access bypass was disabled.`, `{ - "bypass_disabled": true, -}` -} - type ActivityTypeHostBypassedConditionalAccess struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -3083,18 +1662,6 @@ func (a ActivityTypeHostBypassedConditionalAccess) ActivityName() string { return "host_bypassed_conditional_access" } -func (a ActivityTypeHostBypassedConditionalAccess) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a host bypasses conditional access.`, - `This activity contains the following fields: -- "host_display_name": The display name of the bypassed host. -- "host_id": ID of the host. -- "idp_full_name": The end user's full name from Okta.`, `{ - "host_display_name": "Anna's Macbook Pro", - "host_id": 123, - "idp_full_name": "Anna Chao" -}` -} - type ActivityTypeEscrowedDiskEncryptionKey struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -3108,16 +1675,6 @@ func (a ActivityTypeEscrowedDiskEncryptionKey) WasFromAutomation() bool { return true } -func (a ActivityTypeEscrowedDiskEncryptionKey) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a disk encryption key is escrowed.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host.`, `{ - "host_id": 123, - "host_display_name": "PWNED-VM-123" -}` -} - type ActivityCreatedCustomVariable struct { CustomVariableID uint `json:"custom_variable_id"` CustomVariableName string `json:"custom_variable_name"` @@ -3127,16 +1684,6 @@ func (a ActivityCreatedCustomVariable) ActivityName() string { return "created_custom_variable" } -func (a ActivityCreatedCustomVariable) Documentation() (activity string, details string, detailsExample string) { - return `Generated when custom variable is added.`, - `This activity contains the following fields: -- "custom_variable_id": the id of the new custom variable. -- "custom_variable_name": the name of the new custom variable.`, `{ - "custom_variable_id": 123, - "custom_variable_name": "SOME_API_KEY" -}` -} - type ActivityDeletedCustomVariable struct { CustomVariableID uint `json:"custom_variable_id"` CustomVariableName string `json:"custom_variable_name"` @@ -3146,16 +1693,6 @@ func (a ActivityDeletedCustomVariable) ActivityName() string { return "deleted_custom_variable" } -func (a ActivityDeletedCustomVariable) Documentation() (activity string, details string, detailsExample string) { - return `Generated when custom variable is deleted.`, - `This activity contains the following fields: -- "custom_variable_id": the id of the custom variable. -- "custom_variable_name": the name of the custom variable.`, `{ - "custom_variable_id": 123, - "custom_variable_name": "SOME_API_KEY" -}` -} - type ActivityEditedSetupExperienceSoftware struct { Platform string `json:"platform"` TeamID uint `json:"team_id" renameto:"fleet_id"` @@ -3166,18 +1703,6 @@ func (a ActivityEditedSetupExperienceSoftware) ActivityName() string { return "edited_setup_experience_software" } -func (a ActivityEditedSetupExperienceSoftware) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user edits setup experience software.`, - `This activity contains the following fields: -- "platform": the platform of the host ("darwin", "android", "windows", or "linux"). -- "team_id": the ID of the team associated with the setup experience (0 for "No team"). -- "team_name": the name of the team associated with the setup experience (empty for "No team").`, `{ - "platform": "darwin", - "team_id": 1, - "team_name": "Workstations" -}` -} - type ActivityTypeCreatedAndroidProfile struct { ProfileName string `json:"profile_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -3188,18 +1713,6 @@ func (a ActivityTypeCreatedAndroidProfile) ActivityName() string { return "created_android_profile" } -func (a ActivityTypeCreatedAndroidProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user adds a new Android profile to a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the profile. -- "team_id": The ID of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the profile applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeDeletedAndroidProfile struct { ProfileName string `json:"profile_name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -3210,18 +1723,6 @@ func (a ActivityTypeDeletedAndroidProfile) ActivityName() string { return "deleted_android_profile" } -func (a ActivityTypeDeletedAndroidProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user deletes an Android profile from a team (or no team).`, - `This activity contains the following fields: -- "profile_name": Name of the deleted profile. -- "team_id": The ID of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team. -- "team_name": The name of the team that the profile applied to, ` + "`null`" + ` if it applied to devices that are not in a team.`, `{ - "profile_name": "Custom settings 1", - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedAndroidProfile struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -3231,16 +1732,6 @@ func (a ActivityTypeEditedAndroidProfile) ActivityName() string { return "edited_android_profile" } -func (a ActivityTypeEditedAndroidProfile) Documentation() (activity, details, detailsExample string) { - return `Generated when a user edits the Android profiles of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the profiles apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedAndroidCertificate struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -3250,16 +1741,6 @@ func (a ActivityTypeEditedAndroidCertificate) ActivityName() string { return "edited_android_certificate" } -func (a ActivityTypeEditedAndroidCertificate) Documentation() (activity, details, detailsExample string) { - return `Generated when a user adds or removes Android certificate templates of a team (or no team) via the fleetctl CLI.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the certificate templates apply to, ` + "`null`" + ` if they apply to devices that are not in a team. -- "team_name": The name of the team that the certificate templates apply to, ` + "`null`" + ` if they apply to devices that are not in a team.`, `{ - "team_id": 123, - "team_name": "Workstations" -}` -} - type ActivityTypeEditedHostIdpData struct { HostID uint `json:"host_id"` HostDisplayName string `json:"host_display_name"` @@ -3270,18 +1751,6 @@ func (a ActivityTypeEditedHostIdpData) ActivityName() string { return "edited_host_idp_data" } -func (a ActivityTypeEditedHostIdpData) Documentation() (activity, details, detailsExample string) { - return `Generated when a user updates a host's IdP data. Currently IdP username can be edited.`, - `This activity contains the following fields: -- "host_id": ID of the host. -- "host_display_name": Display name of the host. -- "host_idp_username": The updated IdP username for this host.`, `{ - "host_id": 1, - "host_display_name": "Anna's MacBook Pro", - "host_idp_username": "anna.chao@example.com" -}` -} - type ActivityTypeAddedCertificate struct { Name string `json:"name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -3292,18 +1761,6 @@ func (a ActivityTypeAddedCertificate) ActivityName() string { return "added_certificate" } -func (a ActivityTypeAddedCertificate) Documentation() (activity string, details string, detailsExample string) { - return `Generated when a user adds a Certificate Template.`, - `This activity contains the following fields: -- "name": Name of the certificate. -- "team_id": The ID of the team where the certificate was added, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team where the certificate was added, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "certificate_name": "WiFi cert", - "team_id": 123, - "team_name": "Mobile devices" -}` -} - type ActivityTypeDeletedCertificate struct { Name string `json:"name"` TeamID *uint `json:"team_id" renameto:"fleet_id"` @@ -3314,18 +1771,6 @@ func (a ActivityTypeDeletedCertificate) ActivityName() string { return "deleted_certificate" } -func (a ActivityTypeDeletedCertificate) Documentation() (activity string, details string, detailsExample string) { - return `Generated when an user deletes a Certificate Template.`, - `This activity contains the following fields: -- "name"": Name of the certificate. -- "team_id": The ID of the team where the certificate was deleted, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team where the certificate was deleted, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "certificate_name": "WiFi cert", - "team_id": 123, - "team_name": "Mobile devices" -}` -} - type ActivityTypeAddedMicrosoftEntraTenant struct { TenantID string `json:"tenant_id"` } @@ -3334,14 +1779,6 @@ func (a ActivityTypeAddedMicrosoftEntraTenant) ActivityName() string { return "added_microsoft_entra_tenant" } -func (a ActivityTypeAddedMicrosoftEntraTenant) Documentation() (activity string, details string, detailsExample string) { - return `Generated when Entra tenant is added.`, - `This activity contains the following field: -- "tenant_id": the ID of the Entra tenant.`, `{ - "tenant_id": "ada00076-06f6-459b-8c45-88a843a2271f" -}` -} - type ActivityTypeDeletedMicrosoftEntraTenant struct { TenantID string `json:"tenant_id"` } @@ -3350,14 +1787,6 @@ func (a ActivityTypeDeletedMicrosoftEntraTenant) ActivityName() string { return "deleted_microsoft_entra_tenant" } -func (a ActivityTypeDeletedMicrosoftEntraTenant) Documentation() (activity string, details string, detailsExample string) { - return `Generated when Entra tenant is deleted.`, - `This activity contains the following field: -- "tenant_id": the ID of the Entra tenant.`, `{ - "tenant_id": "ada00076-06f6-459b-8c45-88a843a2271f" -}` -} - type ActivityTypeEditedEnrollSecrets struct { TeamID *uint `json:"team_id" renameto:"fleet_id"` TeamName *string `json:"team_name" renameto:"fleet_name"` @@ -3366,13 +1795,3 @@ type ActivityTypeEditedEnrollSecrets struct { func (a ActivityTypeEditedEnrollSecrets) ActivityName() string { return "edited_enroll_secrets" } - -func (a ActivityTypeEditedEnrollSecrets) Documentation() (activity, details, detailsExample string) { - return `Generated when global or team enroll secrets are edited.`, - `This activity contains the following fields: -- "team_id": The ID of the team that the enroll secret applies to, ` + "`null`" + ` if it applies to devices that are not in a team. -- "team_name": The name of the team that the enroll secret applies to, ` + "`null`" + ` if it applies to devices that are not in a team.`, `{ - "team_id": 1, - "team_name": "Workstations", -}` -} diff --git a/server/fleet/gen_activity_doc.go b/server/fleet/gen_activity_doc.go deleted file mode 100644 index d71c8fa371..0000000000 --- a/server/fleet/gen_activity_doc.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build ignore -// +build ignore - -package main - -import ( - "fmt" - "os" - "strings" - - "github.com/fleetdm/fleet/v4/server/fleet" -) - -func main() { - var b strings.Builder - - b.WriteString(` -# Audit logs - -Fleet logs activities. - -To see activities in Fleet, select the Fleet icon in the top navigation and see the **Activity** section. - -This page includes a list of activities. - -`) - - activityMap := map[string]struct{}{} - for _, activity := range fleet.ActivityDetailsList { - if _, ok := activityMap[activity.ActivityName()]; ok { - panic(fmt.Sprintf("type %s already used", activity.ActivityName())) - } - activityMap[activity.ActivityName()] = struct{}{} - - fmt.Fprintf(&b, "## %s\n\n", activity.ActivityName()) - activityTypeDoc, detailsDoc, detailsExampleDoc := activity.Documentation() - fmt.Fprintf(&b, activityTypeDoc+"\n\n"+detailsDoc+"\n\n") - if detailsExampleDoc != "" { - fmt.Fprintf(&b, "#### Example\n\n```json\n%s\n```\n\n", detailsExampleDoc) - } - } - b.WriteString(` - - - - -`) - - if err := os.WriteFile(os.Args[1], []byte(b.String()), 0600); err != nil { - panic(err) - } -}