mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 00:18:27 +00:00
> Related issue: #9956 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [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 --------- Co-authored-by: Martin Angers <martin.n.angers@gmail.com> Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com> Co-authored-by: Roberto Dip <rroperzh@gmail.com> Co-authored-by: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com> Co-authored-by: Dante Catalfamo <43040593+dantecatalfamo@users.noreply.github.com> Co-authored-by: Roberto Dip <dip.jesusr@gmail.com> |
||
|---|---|---|
| .. | ||
| main.go | ||
| README.md | ||
MDM asset manager
The MDM Asset Manager is a tool designed to manage MDM assets in a Fleet database. The assets are exported unencrypted and imported encrypted; hence, the key used for encrypting the assets must be provided.
Usage
Export
To export all MDM assets:
go run tools/mdm/assets/main.go export -key=E6Ow1t2dbKARxEF6O9GFI3DDQRMROhI8 -dir=mdm_assets
You can also specify the asset you want:
go run tools/mdm/assets/main.go export -key=E6Ow1t2dbKARxEF6O9GFI3DDQRMROhI8 -dir=mdm_assets -name=vpp_token
Supported flags are:
-db-address string
Address used to connect to the MySQL instance (default "localhost:3306")
-db-name string
Name of the database with the asset information in the MySQL instance (default "fleet")
-db-password string
Password used to connect to the MySQL instance (default "insecure")
-db-user string
Username used to connect to the MySQL instance (default "fleet")
-dir string
Directory to put the exported assets
-key string
Key used to encrypt the assets
-name string
Name of the MDM asset to export
Import
To import an MDM asset:
go run tools/mdm/assets/main.go import -key=E6Ow1t2dbKARxEF6O9GFI3DDQRMROhI8 -name=vpp_token -value='{"foo": "bar"}'
Supported flags are:
-db-address string
Address used to connect to the MySQL instance (default "localhost:3306")
-db-name string
Name of the database with the asset information in the MySQL instance (default "fleet")
-db-password string
Password used to connect to the MySQL instance (default "insecure")
-db-user string
Username used to connect to the MySQL instance (default "fleet")
-key string
Key used to encrypt the assets
-name string
Name of the MDM asset to import
-value string
Value to be set for the asset