fleet/frontend/interfaces/activity.ts

240 lines
9.5 KiB
TypeScript
Raw Normal View History

import { ILabelSoftwareTitle } from "./label";
UI – Add VPP features for iPadOS and iOS (#20755) ## Addresses #20467 – part 2 ### Aggregate software: #### Software titles <img width="1616" alt="sw-titles-updated" src="https://github.com/user-attachments/assets/0b9922c7-e36e-4d2f-b204-95c3cdf9b602"> #### Software versions <img width="1616" alt="Screenshot 2024-07-29 at 6 14 21 PM" src="https://github.com/user-attachments/assets/5a097700-cd6c-45b1-a21f-9d76a733f0ae"> #### Host software <img width="1616" alt="Screenshot 2024-07-29 at 6 23 01 PM" src="https://github.com/user-attachments/assets/84e18695-f47a-4022-bd53-7f5d37ce452a"> ### Add software modal (VPP) _screenshots use mocked data - UI is flexible enough to display cleanly before and after backend is in place:_ <img width="1339" alt="happy" src="https://github.com/user-attachments/assets/8900aa93-316c-4a09-8e5a-1a1e45b0c458"> #### No apps: <img width="1572" alt="Screenshot 2024-07-29 at 6 35 03 PM" src="https://github.com/user-attachments/assets/466b9b6c-4d3d-49dd-94a9-94e395d89cb7"> #### Not enabled: <img width="1572" alt="Screenshot 2024-07-29 at 6 37 45 PM" src="https://github.com/user-attachments/assets/9bcfd480-8741-4d95-ba3b-550dee4dc673"> #### Error: <img width="1572" alt="Screenshot 2024-07-29 at 6 39 39 PM" src="https://github.com/user-attachments/assets/e944dd40-676e-4aba-9cd9-49ff319bf402"> ### Vuln support – Not supported for now: _see above screenshots for `list` endpoints_ #### Software title detail <img width="1616" alt="Screenshot 2024-07-29 at 6 47 29 PM" src="https://github.com/user-attachments/assets/2e30fd0a-21e4-4d19-bf9b-71a994bfd0e7"> #### Software version and OS detail: <img width="1616" alt="Screenshot 2024-07-29 at 6 48 28 PM" src="https://github.com/user-attachments/assets/e8fec769-ba97-4b6b-b10c-9bb4c973c732"> <img width="1616" alt="Screenshot 2024-07-29 at 6 50 25 PM" src="https://github.com/user-attachments/assets/0ac15727-e0cb-447c-8758-c58b79656d1a"> - [x] Changes file added for user-visible changes in `changes/`, - [x] Added/updated tests - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-07-30 17:14:25 +00:00
import { Platform } from "./platform";
import { IPolicy } from "./policy";
import { IQuery } from "./query";
import { ISchedulableQueryStats } from "./schedulable_query";
import { ITeamSummary } from "./team";
import { UserRole } from "./user";
export enum ActivityType {
CreatedPack = "created_pack",
DeletedPack = "deleted_pack",
EditedPack = "edited_pack",
CreatedPolicy = "created_policy",
DeletedPolicy = "deleted_policy",
EditedPolicy = "edited_policy",
CreatedSavedQuery = "created_saved_query",
DeletedSavedQuery = "deleted_saved_query",
DeletedMultipleSavedQuery = "deleted_multiple_saved_query",
EditedSavedQuery = "edited_saved_query",
CreatedTeam = "created_team",
DeletedTeam = "deleted_team",
LiveQuery = "live_query",
AppliedSpecPack = "applied_spec_pack", // fleetctl
AppliedSpecPolicy = "applied_spec_policy", // fleetctl
AppliedSpecSavedQuery = "applied_spec_saved_query", // fleetctl
AppliedSpecSoftware = "applied_spec_software", // fleetctl
AppliedSpecTeam = "applied_spec_team", // fleetctl
EditedAgentOptions = "edited_agent_options",
UserAddedBySSO = "user_added_by_sso",
UserLoggedIn = "user_logged_in",
Log failed login attempts as activities (#9430) #9119 To test the SSO changes locally you can use: https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Testing-and-local-development.md#testing-sso @RachelElysia Please take a look at the UI changes (All I did was copy/paste and amend the changes for the new activity type.) IMO we shouldn't display an avatar because there's no "actual user" involved in these failed login attempts activities (by "actual user" I mean the user attributed to the activity): <img width="446" alt="Screenshot 2023-01-19 at 10 41 05" src="https://user-images.githubusercontent.com/2073526/213524771-b85901ce-eec0-4cf3-919c-73162285e20b.png"> - [X] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - ~[ ] Documented any permissions changes~ - ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)~ - ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.~ - [X] Added/updated tests - [X] Manual QA for all new/changed functionality - ~For Orbit and Fleet Desktop changes:~ - ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.~ - ~[ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-01-20 15:43:22 +00:00
UserFailedLogin = "user_failed_login",
UserCreated = "created_user",
UserDeleted = "deleted_user",
UserChangedGlobalRole = "changed_user_global_role",
UserDeletedGlobalRole = "deleted_user_global_role",
UserChangedTeamRole = "changed_user_team_role",
UserDeletedTeamRole = "deleted_user_team_role",
FleetEnrolled = "fleet_enrolled",
MdmEnrolled = "mdm_enrolled",
MdmUnenrolled = "mdm_unenrolled",
EditedMacosMinVersion = "edited_macos_min_version",
EditedIosMinVersion = "edited_ios_min_version",
EditedIpadosMinVersion = "edited_ipados_min_version",
ReadHostDiskEncryptionKey = "read_host_disk_encryption_key",
/** Note: BE not renamed (yet) from macOS even though activity is also used for iOS and iPadOS */
CreatedAppleOSProfile = "created_macos_profile",
/** Note: BE not renamed (yet) from macOS even though activity is also used for iOS and iPadOS */
DeletedAppleOSProfile = "deleted_macos_profile",
/** Note: BE not renamed (yet) from macOS even though activity is also used for iOS and iPadOS */
EditedAppleOSProfile = "edited_macos_profile",
2024-10-17 14:21:26 +00:00
AddedNdesScepProxy = "added_ndes_scep_proxy",
DeletedNdesScepProxy = "deleted_ndes_scep_proxy",
EditedNdesScepProxy = "edited_ndes_scep_proxy",
AddedDigicert = "added_digicert",
DeletedDigicert = "deleted_digicert",
EditedDigicert = "edited_digicert",
AddedCustomScepProxy = "added_custom_scep_proxy",
DeletedCustomScepProxy = "deleted_custom_scep_proxy",
EditedCustomScepProxy = "edited_custom_scep_proxy",
CreatedWindowsProfile = "created_windows_profile",
DeletedWindowsProfile = "deleted_windows_profile",
EditedWindowsProfile = "edited_windows_profile",
// Note: Both "enabled_disk_encryption" and "enabled_macos_disk_encryption" display the same
// message. The latter is deprecated in the API but it is retained here for backwards compatibility.
EnabledDiskEncryption = "enabled_disk_encryption",
EnabledMacDiskEncryption = "enabled_macos_disk_encryption",
// Note: Both "disabled_disk_encryption" and "disabled_macos_disk_encryption" display the same
// message. The latter is deprecated in the API but it is retained here for backwards compatibility.
DisabledDiskEncryption = "disabled_disk_encryption",
DisabledMacDiskEncryption = "disabled_macos_disk_encryption",
AddedBootstrapPackage = "added_bootstrap_package",
DeletedBootstrapPackage = "deleted_bootstrap_package",
ChangedMacOSSetupAssistant = "changed_macos_setup_assistant",
DeletedMacOSSetupAssistant = "deleted_macos_setup_assistant",
EnabledMacOSSetupEndUserAuth = "enabled_macos_setup_end_user_auth",
DisabledMacOSSetupEndUserAuth = "disabled_macos_setup_end_user_auth",
TransferredHosts = "transferred_hosts",
EnabledWindowsMdm = "enabled_windows_mdm",
DisabledWindowsMdm = "disabled_windows_mdm",
UI - GitOps Mode: Core abstractions, first batch of applications (#26401) ## For #26229 – Part 1 ![ezgif-6bbe6d60c12ed4](https://github.com/user-attachments/assets/37a04b64-abd7-4605-b4ac-9542836ff562) - This PR contains the core abstractions, routes, API updates, and types for GitOps mode in the UI. Since this work will touch essentially every part of the Fleet UI, it is ripe for merge conflicts. To mitigate such conflicts, I'll be merging this work in a number of iterative PRs. ~To effectively gate any of this work from showing until it is all merged to `main`, [this commit](feedbb2d4c25ec2e304e1f18d409cee62f6752ed) hides the settings section that allows enabling/disabling this setting, effectively feature flagging the entire thing. In the last of these iterative PRs, that commit will be reverted to engage the entire feature. For testing purposes, reviewers can `git revert feedbb2d4c25ec2e304e1f18d409cee62f6752ed` locally~ The new settings section for this feature is feature flagged until all PRs are merged - to show the setting section while testing, run `ALLOW_GITOPS_MODE=true NODE_ENV=development yarn run webpack --progress --watch` in place of `make generate-dev` - Changes file will be added and feature flag removed in the last PR - [x] Settings page with routing, form, API integration (hidden until last PR) - [x] Activities - [x] Navbar indicator - Apply GOM conditional UI to: - [x] Manage enroll secret modal: .5 - Controls > - [x] Scripts: - Setup experience > - [x] Install software > Select software modal - [x] OS Settings > - [x] Custom settings - [x] Disk encryption - [x] OS Updates 2/18/25, added to this PR: - [x] Controls > Setup experience > Run script - [x] Software > - [x] Manage automations modal - [x] Add software > - [x] App Store (VPP) - [x] Custom package - [x] Queries - [x] Manage - [x] Automations modal - [x] New - [x] Edit - [x] Policies - [x] Manage - [x] New - [x] Edit - Manage automations - [x] Calendar events - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-02-20 16:41:07 +00:00
EnabledGitOpsMode = "enabled_gitops_mode",
DisabledGitOpsMode = "disabled_gitops_mode",
EnabledWindowsMdmMigration = "enabled_windows_mdm_migration",
DisabledWindowsMdmMigration = "disabled_windows_mdm_migration",
RanScript = "ran_script",
RanScriptBatch = "ran_script_batch",
ScheduledScriptBatch = "scheduled_script_batch",
CanceledScriptBatch = "canceled_script_batch",
2023-10-10 22:00:45 +00:00
AddedScript = "added_script",
UpdatedScript = "updated_script",
2023-10-10 22:00:45 +00:00
DeletedScript = "deleted_script",
EditedScript = "edited_script",
EditedWindowsUpdates = "edited_windows_updates",
LockedHost = "locked_host",
UnlockedHost = "unlocked_host",
WipedHost = "wiped_host",
CreatedDeclarationProfile = "created_declaration_profile",
DeletedDeclarationProfile = "deleted_declaration_profile",
EditedDeclarationProfile = "edited_declaration_profile",
ResentConfigurationProfile = "resent_configuration_profile",
ResentConfigurationProfileBatch = "resent_configuration_profile_batch",
AddedSoftware = "added_software",
EditedSoftware = "edited_software",
DeletedSoftware = "deleted_software",
InstalledSoftware = "installed_software",
UninstalledSoftware = "uninstalled_software",
2024-07-16 17:16:57 +00:00
EnabledVpp = "enabled_vpp",
DisabledVpp = "disabled_vpp",
AddedAppStoreApp = "added_app_store_app",
EditedAppStoreApp = "edited_app_store_app",
2024-07-16 17:16:57 +00:00
DeletedAppStoreApp = "deleted_app_store_app",
InstalledAppStoreApp = "installed_app_store_app",
EnabledActivityAutomations = "enabled_activity_automations",
EditedActivityAutomations = "edited_activity_automations",
DisabledActivityAutomations = "disabled_activity_automations",
CanceledRunScript = "canceled_run_script",
CanceledInstallAppStoreApp = "canceled_install_app_store_app",
CanceledInstallSoftware = "canceled_install_software",
CanceledUninstallSoftware = "canceled_uninstall_software",
2025-02-27 14:07:34 +00:00
EnabledAndroidMdm = "enabled_android_mdm",
DisabledAndroidMdm = "disabled_android_mdm",
Microsoft Compliance Partner backend changes (#29540) For #27042. Ready for review, just missing integration tests that I will be writing today. - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [X] If database migrations are included, checked table schema to confirm autoupdate - For new Fleet configuration settings - [X] Verified that the setting can be managed via GitOps, or confirmed that the setting is explicitly being excluded from GitOps. If managing via Gitops: - [X] Verified that the setting is exported via `fleetctl generate-gitops` - [X] Added the setting to [the GitOps documentation](https://github.com/fleetdm/fleet/blob/main/docs/Configuration/yaml-files.md#L485) - [X] Verified that the setting is cleared on the server if it is not supplied in a YAML file (or that it is documented as being optional) - [x] Verified that any relevant UI is disabled when GitOps mode is enabled - For database migrations: - [X] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [X] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [X] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [x] Added/updated automated tests - [X] Manual QA for all new/changed functionality --------- Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com> Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-06-11 17:22:46 +00:00
ConfiguredMSEntraConditionalAccess = "added_conditional_access_integration_microsoft",
DeletedMSEntraConditionalAccess = "deleted_conditional_access_integration_microsoft",
UI: Conditional access - Microsoft Entra (#27982) _Note - currently feature flagged. Build frontend with `ALLOW_CONDITIONAL_ACCESS=true NODE_ENV=development yarn run webpack --progress --watch` to enable this feature. Also, all of this functionality depends on the new `config.license.managed_cloud` being true, so you'll need to mock that data somehow. [This branch](https://github.com/fleetdm/fleet/tree/27043-fake-data) has the appropriate fake data for testing_ ## For #27043, #27864 ### Build front end for Fleet's integration with Microsoft Entra, allowing conditional preventtion of single sign-on for hosts failing any policies on a team #### Trigger the integration ![trigger](https://github.com/user-attachments/assets/4578568a-f64a-4390-83d9-fbec751d4b14) #### Triggered, but configuration still not verified <img width="1348" alt="√ not-verified-return-to-prefilled-form" src="https://github.com/user-attachments/assets/44d0c21f-2554-40a8-9158-d1107cff2d09" /> #### Verified, short and long tenant ids: ![ezgif-75f82492180d28](https://github.com/user-attachments/assets/015f3605-81e8-463a-be74-07bab99d9724) #### Verified –> Deleted ![√ verified - delete - deleted](https://github.com/user-attachments/assets/44b8ba70-49c9-43e7-be54-8474756a5b50) #### Enable for policies of a team ![√ enable-for-team](https://github.com/user-attachments/assets/9454b0da-059d-4991-a3ff-14e74257a3a7) #### Activities <img width="886" alt="√ activities" src="https://github.com/user-attachments/assets/d21e6185-c2f2-40b2-9c69-9b92fab58766" /> #### Unavailable for self-hosted Fleet instances: ![no-access-self-hosted](https://github.com/user-attachments/assets/56213522-b721-472f-9174-c8dac0df61f3) #### Premium only ![√ premium-only](https://github.com/user-attachments/assets/97373960-6b38-458b-be37-4c3868469182) - [x] Changes file added for user-visible changes in `changes/` - [x] Added/updated automated tests - [x] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it) - [ ] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-04-15 20:55:07 +00:00
// enable/disable above feature for a team
EnabledConditionalAccessAutomations = "enabled_conditional_access_automations",
DisabledConditionalAccessAutomations = "disabled_conditional_access_automations",
EscrowedDiskEncryptionKey = "escrowed_disk_encryption_key",
CreatedCustomVariable = "created_custom_variable",
DeletedCustomVariable = "deleted_custom_variable",
}
/** This is a subset of ActivityType that are shown only for the host past activities */
export type IHostPastActivityType =
| ActivityType.RanScript
| ActivityType.LockedHost
| ActivityType.WipedHost
| ActivityType.ReadHostDiskEncryptionKey
| ActivityType.UnlockedHost
2024-07-16 17:16:57 +00:00
| ActivityType.InstalledSoftware
| ActivityType.UninstalledSoftware
| ActivityType.InstalledAppStoreApp
| ActivityType.CanceledRunScript
| ActivityType.CanceledInstallAppStoreApp
| ActivityType.CanceledInstallSoftware
| ActivityType.CanceledUninstallSoftware;
/** This is a subset of ActivityType that are shown only for the host upcoming activities */
export type IHostUpcomingActivityType =
| ActivityType.RanScript
2024-07-16 17:16:57 +00:00
| ActivityType.InstalledSoftware
| ActivityType.UninstalledSoftware
2024-07-16 17:16:57 +00:00
| ActivityType.InstalledAppStoreApp;
export interface IActivity {
created_at: string;
id: number;
actor_full_name: string;
actor_id: number;
actor_gravatar: string;
actor_email?: string;
actor_api_only: boolean;
type: ActivityType;
fleet_initiated: boolean;
details?: IActivityDetails;
}
export type IHostPastActivity = Omit<IActivity, "type" | "details"> & {
type: IHostPastActivityType;
details: IActivityDetails;
};
export type IHostUpcomingActivity = Omit<
IActivity,
"id" | "type" | "details"
> & {
uuid: string;
type: IHostUpcomingActivityType;
details: IActivityDetails;
};
export interface IActivityDetails {
/** Useful for passing this data into an activity details modal */
created_at?: string;
app_store_id?: number;
bootstrap_package_name?: string;
batch_execution_id?: string;
command_uuid?: string;
deadline_days?: number;
deadline?: string;
Log failed login attempts as activities (#9430) #9119 To test the SSO changes locally you can use: https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Testing-and-local-development.md#testing-sso @RachelElysia Please take a look at the UI changes (All I did was copy/paste and amend the changes for the new activity type.) IMO we shouldn't display an avatar because there's no "actual user" involved in these failed login attempts activities (by "actual user" I mean the user attributed to the activity): <img width="446" alt="Screenshot 2023-01-19 at 10 41 05" src="https://user-images.githubusercontent.com/2073526/213524771-b85901ce-eec0-4cf3-919c-73162285e20b.png"> - [X] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [X] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - ~[ ] Documented any permissions changes~ - ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)~ - ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.~ - [X] Added/updated tests - [X] Manual QA for all new/changed functionality - ~For Orbit and Fleet Desktop changes:~ - ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.~ - ~[ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-01-20 15:43:22 +00:00
email?: string;
enrollment_id?: string | null; // unique identifier for MDM BYOD enrollments; null for other enrollments
global?: boolean;
grace_period_days?: number;
host_display_name?: string;
host_display_names?: string[];
host_id?: number;
host_ids?: number[];
host_count?: number;
canceled_count?: number;
host_platform?: string;
host_serial?: string;
install_uuid?: string;
installed_from_dep?: boolean;
labels_exclude_any?: ILabelSoftwareTitle[];
labels_include_any?: ILabelSoftwareTitle[];
location?: string; // name of location associated with VPP token
mdm_platform?: "microsoft" | "apple";
minimum_version?: string;
name?: string;
pack_id?: number;
pack_name?: string;
platform?: Platform; // software platform
policy_id?: number;
policy_name?: string;
profile_identifier?: string;
profile_name?: string;
public_ip?: string;
query_id?: number;
query_ids?: number[];
query_name?: string;
query_sql?: string;
role?: UserRole;
script_execution_id?: string;
2023-10-10 22:00:45 +00:00
script_name?: string;
self_service?: boolean;
software_package?: string;
software_title_id?: number;
software_title?: string;
specs?: IQuery[] | IPolicy[];
stats?: ISchedulableQueryStats;
status?: string;
targets_count?: number;
team_id?: number | null;
team_name?: string | null;
teams?: ITeamSummary[];
user_email?: string;
user_id?: number;
webhook_url?: string;
custom_variable_name?: string;
}