2021-11-16 02:40:53 +00:00
|
|
|
//go:build darwin
|
|
|
|
|
|
|
|
|
|
package table
|
|
|
|
|
|
|
|
|
|
import (
|
2024-05-08 13:57:16 +00:00
|
|
|
"context"
|
2024-06-06 18:24:43 +00:00
|
|
|
|
2025-06-20 20:01:38 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/app_sso_platform"
|
2023-02-08 15:30:55 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/authdb"
|
Add `team_identifier` to macOS software (#23766)
Changes to add `team_identifier` signing information to macOS
applications on the `/api/latest/fleet/hosts/:id/software` API endpoint.
Docs: https://github.com/fleetdm/fleet/pull/23743
- [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/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)
- [X] Added/updated tests
- [X] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes
- [X] If database migrations are included, checked table schema to
confirm autoupdate
- 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] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [X] Orbit runs on macOS, Linux and Windows. Check if the orbit
feature/bugfix should only apply to one platform (`runtime.GOOS`).
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [X] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Tim Lee <timlee@fleetdm.com>
Co-authored-by: Ian Littman <iansltx@gmail.com>
2024-11-15 17:17:04 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/codesign"
|
2023-02-07 18:26:05 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/csrutil_info"
|
2023-11-02 02:11:35 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/dataflattentable"
|
2023-03-10 17:29:14 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/diskutil/apfs"
|
2023-03-28 15:57:38 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/diskutil/corestorage"
|
2023-02-09 17:27:40 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/dscl"
|
2023-06-15 15:23:59 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/filevault_prk"
|
2023-11-02 02:11:35 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/filevault_status"
|
2023-06-29 19:22:41 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/find_cmd"
|
2023-02-09 17:27:40 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/firmware_eficheck_integrity_check"
|
2023-11-02 02:11:35 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/firmwarepasswd"
|
|
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/ioreg"
|
2025-06-25 13:51:43 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/macos_user_profiles"
|
2023-02-07 18:26:05 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/nvram_info"
|
2023-02-08 16:08:17 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/pmset"
|
2022-11-21 18:56:15 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/privaterelay"
|
2023-01-25 20:53:24 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/pwd_policy"
|
2023-03-29 13:24:33 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/software_update"
|
2023-02-09 15:35:43 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/sudo_info"
|
2024-06-06 20:52:06 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/tcc_access"
|
2023-01-23 20:23:59 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/table/user_login_settings"
|
2024-06-27 17:26:20 +00:00
|
|
|
"github.com/rs/zerolog/log"
|
2023-11-02 02:11:35 +00:00
|
|
|
|
2021-11-18 00:34:31 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/filevaultusers"
|
2021-11-16 02:40:53 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/macos_profiles"
|
2023-05-05 14:02:28 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/macosrsr"
|
2021-11-16 02:40:53 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/mdm"
|
|
|
|
|
"github.com/macadmins/osquery-extension/tables/munki"
|
2024-05-08 13:57:16 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/sofa"
|
2021-11-18 00:34:31 +00:00
|
|
|
"github.com/macadmins/osquery-extension/tables/unifiedlog"
|
2023-11-02 02:11:35 +00:00
|
|
|
|
2023-02-08 15:30:55 +00:00
|
|
|
"github.com/osquery/osquery-go"
|
|
|
|
|
"github.com/osquery/osquery-go/plugin/table"
|
2021-11-16 02:40:53 +00:00
|
|
|
)
|
|
|
|
|
|
2024-06-14 20:56:58 +00:00
|
|
|
func PlatformTables(opts PluginOpts) ([]osquery.OsqueryPlugin, error) {
|
2023-11-02 02:11:35 +00:00
|
|
|
plugins := []osquery.OsqueryPlugin{
|
2022-11-21 18:56:15 +00:00
|
|
|
// Fleet tables
|
|
|
|
|
table.NewPlugin("icloud_private_relay", privaterelay.Columns(), privaterelay.Generate),
|
2023-01-23 20:23:59 +00:00
|
|
|
table.NewPlugin("user_login_settings", user_login_settings.Columns(), user_login_settings.Generate),
|
2023-01-25 20:53:24 +00:00
|
|
|
table.NewPlugin("pwd_policy", pwd_policy.Columns(), pwd_policy.Generate),
|
2023-02-07 18:26:05 +00:00
|
|
|
table.NewPlugin("csrutil_info", csrutil_info.Columns(), csrutil_info.Generate),
|
|
|
|
|
table.NewPlugin("nvram_info", nvram_info.Columns(), nvram_info.Generate),
|
2024-06-06 20:52:06 +00:00
|
|
|
table.NewPlugin("tcc_access", tcc_access.Columns(), tcc_access.Generate),
|
2023-02-08 15:30:55 +00:00
|
|
|
table.NewPlugin("authdb", authdb.Columns(), authdb.Generate),
|
2023-02-08 16:08:17 +00:00
|
|
|
table.NewPlugin("pmset", pmset.Columns(), pmset.Generate),
|
2023-02-09 15:35:43 +00:00
|
|
|
table.NewPlugin("sudo_info", sudo_info.Columns(), sudo_info.Generate),
|
2023-03-29 13:24:33 +00:00
|
|
|
table.NewPlugin("software_update", software_update.Columns(), software_update.Generate),
|
2023-02-09 17:27:40 +00:00
|
|
|
table.NewPlugin("firmware_eficheck_integrity_check", firmware_eficheck_integrity_check.Columns(), firmware_eficheck_integrity_check.Generate),
|
|
|
|
|
table.NewPlugin("dscl", dscl.Columns(), dscl.Generate),
|
2023-03-10 17:29:14 +00:00
|
|
|
table.NewPlugin("apfs_volumes", apfs.VolumesColumns(), apfs.VolumesGenerate),
|
|
|
|
|
table.NewPlugin("apfs_physical_stores", apfs.PhysicalStoresColumns(), apfs.PhysicalStoresGenerate),
|
2023-03-28 15:57:38 +00:00
|
|
|
table.NewPlugin("corestorage_logical_volumes", corestorage.LogicalVolumesColumns(), corestorage.LogicalVolumesGenerate),
|
|
|
|
|
table.NewPlugin("corestorage_logical_volume_families", corestorage.LogicalVolumeFamiliesColumns(), corestorage.LogicalVolumeFamiliesGenerate),
|
2023-06-15 15:23:59 +00:00
|
|
|
table.NewPlugin("filevault_prk", filevault_prk.Columns(), filevault_prk.Generate),
|
2023-06-29 19:22:41 +00:00
|
|
|
table.NewPlugin("find_cmd", find_cmd.Columns(), find_cmd.Generate),
|
2025-06-25 13:51:43 +00:00
|
|
|
table.NewPlugin("macos_user_profiles", macos_user_profiles.Columns(), macos_user_profiles.Generate),
|
2022-11-21 18:56:15 +00:00
|
|
|
|
|
|
|
|
// Macadmins extension tables
|
2021-11-18 00:34:31 +00:00
|
|
|
table.NewPlugin("filevault_users", filevaultusers.FileVaultUsersColumns(), filevaultusers.FileVaultUsersGenerate),
|
2021-11-16 02:40:53 +00:00
|
|
|
table.NewPlugin("macos_profiles", macos_profiles.MacOSProfilesColumns(), macos_profiles.MacOSProfilesGenerate),
|
2021-11-18 00:34:31 +00:00
|
|
|
table.NewPlugin("mdm", mdm.MDMInfoColumns(), mdm.MDMInfoGenerate),
|
2021-11-16 02:40:53 +00:00
|
|
|
table.NewPlugin("munki_info", munki.MunkiInfoColumns(), munki.MunkiInfoGenerate),
|
|
|
|
|
table.NewPlugin("munki_installs", munki.MunkiInstallsColumns(), munki.MunkiInstallsGenerate),
|
2023-05-05 14:02:28 +00:00
|
|
|
table.NewPlugin("macos_rsr", macosrsr.MacOSRsrColumns(), macosrsr.MacOSRsrGenerate),
|
2022-08-19 01:59:14 +00:00
|
|
|
// osquery version 5.5.0 and up ships a unified_log table in core
|
|
|
|
|
// we are renaming the one from the macadmins extension to avoid collision
|
|
|
|
|
table.NewPlugin("macadmins_unified_log", unifiedlog.UnifiedLogColumns(), unifiedlog.UnifiedLogGenerate),
|
2024-05-08 13:57:16 +00:00
|
|
|
table.NewPlugin(
|
|
|
|
|
"sofa_security_release_info", sofa.SofaSecurityReleaseInfoColumns(),
|
|
|
|
|
func(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) {
|
2024-06-06 18:24:43 +00:00
|
|
|
return sofa.SofaSecurityReleaseInfoGenerate(ctx, queryContext, opts.Socket, sofa.WithUserAgent("fleetd"))
|
2024-05-08 13:57:16 +00:00
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
table.NewPlugin(
|
|
|
|
|
"sofa_unpatched_cves", sofa.SofaUnpatchedCVEsColumns(),
|
|
|
|
|
func(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) {
|
2024-06-06 18:24:43 +00:00
|
|
|
return sofa.SofaUnpatchedCVEsGenerate(ctx, queryContext, opts.Socket, sofa.WithUserAgent("fleetd"))
|
2024-05-08 13:57:16 +00:00
|
|
|
},
|
|
|
|
|
),
|
2023-11-02 02:11:35 +00:00
|
|
|
|
2024-06-27 17:26:20 +00:00
|
|
|
filevault_status.TablePlugin(log.Logger), // table name is "filevault_status"
|
|
|
|
|
ioreg.TablePlugin(log.Logger), // table name is "ioreg"
|
2023-11-02 02:11:35 +00:00
|
|
|
|
|
|
|
|
// firmwarepasswd table. Only returns valid data on a Mac with an Intel processor. Background: https://support.apple.com/en-us/HT204455
|
2024-06-27 17:26:20 +00:00
|
|
|
firmwarepasswd.TablePlugin(log.Logger), // table name is "firmwarepasswd"
|
2023-11-02 02:11:35 +00:00
|
|
|
|
|
|
|
|
// Table for parsing Apple Property List files, which are typically stored in ~/Library/Preferences/
|
2024-06-27 17:26:20 +00:00
|
|
|
dataflattentable.TablePlugin(log.Logger, dataflattentable.PlistType), // table name is "parse_plist"
|
Add `team_identifier` to macOS software (#23766)
Changes to add `team_identifier` signing information to macOS
applications on the `/api/latest/fleet/hosts/:id/software` API endpoint.
Docs: https://github.com/fleetdm/fleet/pull/23743
- [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/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)
- [X] Added/updated tests
- [X] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes
- [X] If database migrations are included, checked table schema to
confirm autoupdate
- 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] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [X] Orbit runs on macOS, Linux and Windows. Check if the orbit
feature/bugfix should only apply to one platform (`runtime.GOOS`).
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [X] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
---------
Co-authored-by: Tim Lee <timlee@fleetdm.com>
Co-authored-by: Ian Littman <iansltx@gmail.com>
2024-11-15 17:17:04 +00:00
|
|
|
|
|
|
|
|
table.NewPlugin("codesign", codesign.Columns(), codesign.Generate),
|
2025-06-20 20:01:38 +00:00
|
|
|
|
|
|
|
|
table.NewPlugin("app_sso_platform", app_sso_platform.Columns(), app_sso_platform.Generate),
|
2021-11-18 00:34:31 +00:00
|
|
|
}
|
2023-11-02 02:11:35 +00:00
|
|
|
|
|
|
|
|
// append platform specific tables
|
|
|
|
|
plugins = appendTables(plugins)
|
|
|
|
|
|
2024-06-14 20:56:58 +00:00
|
|
|
return plugins, nil
|
2021-11-16 02:40:53 +00:00
|
|
|
}
|