fleet/cmd/fleetctl
Lucas Manuel Rodriguez 9191f4ce66
Add Apple MDM functionality (#7940)
* WIP

* Adding DEP functionality to Fleet

* Better organize additional MDM code

* Add cmdr.py and amend API paths

* Fix lint

* Add demo file

* Fix demo.md

* go mod tidy

* Add munki setup to Fleet

* Add diagram to demo.md

* Add fixes

* Update TODOs and demo.md

* Fix cmdr.py and add TODO

* Add endpoints to demo.md

* Add more Munki PoC/demo stuff

* WIP

* Remove proposals from PoC

* Replace prepare commands with fleetctl commands

* Update demo.md with current state

* Remove config field

* Amend demo

* Remove Munki setup from MVP-Dogfood

* Update demo.md

* Add apple mdm commands (#7769)

* fleetctl enqueue mdm command

* fix deps

* Fix build

Co-authored-by: Lucas Rodriguez <lucas@fleetdm.com>

* Add command to upload installers

* go mod tidy

* fix subcommands help

There is a bug in urfave/cli where help text is not generated properly when subcommands
are nested too deep.

* Add support for installing apps

* Add a way to list enrolled devices

* Add dep listing

* Rearrange endpoints

* Move DEP routine to schedule

* Define paths globally

* Add a way to list enrollments and installers

* Parse device-ids as comma-separated string

* Remove unused types

* Add simple commands and nest under enqueue-command

* Fix simple commands

* Add help to enqueue-command

* merge apple_mdm database

* Fix commands

* update nanomdm

* Split nanomdm and nanodep schemas

* Set 512 MB in memory for upload

* Remove empty file

* Amend profile

* Add sample commands

* Add delete installers and fix bug in DEP profile assigning

* Add dogfood.md deployment guide

* Update schema.sql

* Dump schema with MySQL 5

* Set default value for authenticate_at

* add tokens to enrollment profiles

When a device downloads an MDM enrollment profile, verify the token passed
as a query parameter. This ensures untrusted devices don't enroll with
our MDM server.

- Rename enrollments to enrollment profiles. Enrollments is used by nano
  to refer to devices that are enrolled with MDM
- Rename endpoint /api/<version>/fleet/mdm/apple/enrollments to ../enrollmentprofiles
- Generate a token for authentication when creating an enrollment profile
- Return unauthorized if token is invalid when downloading an enrollment profile from /api/mdm/apple/enroll?token=

* remove mdm apple server url

* update docs

* make dump-test-schema

* Update nanomdm with missing prefix table

* Add docs and simplify changes

* Add changes file

* Add method docs

* Fix compile and revert prepare.go changes

* Revert migration status check change

* Amend comments

* Add more docs

* Clarify storage of installers

* Remove TODO

* Remove unused

* update dogfood.md

* remove cmdr.py

* Add authorization tests

* Add TODO comment

* use kitlog for nano logging

* Add yaml tags

* Remove unused flag

* Remove changes file

* Only run DEP routine if MDM is enabled

* Add docs to all new exported types

* Add docs

* more nano logging changes

* Fix unintentional removal

* more nano logging changes

* Fix compile test

* Use string for configs and fix config test

* Add docs and amend changes

* revert changes to basicAuthHandler

* remove exported BasicAuthHandler

* rename rego authz type

* Add more information to dep list

* add db tag

* update deps

* Fix schema

* Remove unimplemented

Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>
Co-authored-by: Michal Nicpon <michal@fleetdm.com>
2022-10-05 19:53:54 -03:00
..
testdata Include MIA hosts under total count for Offline hosts (#5854) 2022-05-23 14:11:02 -05:00
api.go Add support for custom headers in fleetctl (#6118) 2022-06-07 16:00:09 -04:00
apple_mdm.go Add Apple MDM functionality (#7940) 2022-10-05 19:53:54 -03:00
apply.go Validate team and appconfig payloads, with dry-run and force modes (#7731) 2022-09-19 13:53:44 -04:00
apply_test.go Add validations for agent options' command-line flags section. (#7979) 2022-10-03 08:29:41 -04:00
config.go Add support for custom headers in fleetctl (#6118) 2022-06-07 16:00:09 -04:00
config_test.go test: use T.Setenv to set env vars in tests (#6714) 2022-07-18 14:22:28 -03:00
convert.go Move specs parsing functionality to a new pkg/spec package (#7050) 2022-08-05 19:07:32 -03:00
convert_test.go Add team targets to pack spec (#4272) 2022-02-21 09:18:58 -07:00
debug.go fix fleetctl debug commands on Windows (#6186) 2022-06-10 21:59:44 -03:00
debug_test.go test: use T.Setenv to set env vars in tests (#6714) 2022-07-18 14:22:28 -03:00
delete.go Move specs parsing functionality to a new pkg/spec package (#7050) 2022-08-05 19:07:32 -03:00
delete_test.go Simplify fleetctl implementation and improve testing (#3830) 2022-01-24 16:40:51 -03:00
flags.go improve messaging of fleetctl debug errors and archive commands (#5590) 2022-05-10 10:44:06 -03:00
fleetctl.go Add Apple MDM functionality (#7940) 2022-10-05 19:53:54 -03:00
get.go Move specs parsing functionality to a new pkg/spec package (#7050) 2022-08-05 19:07:32 -03:00
get_test.go improve vuln cpe matching on macos (#6985) 2022-09-01 10:02:07 -06:00
goquery.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
hosts.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
hosts_test.go Refactor integration tests (#1821) 2021-09-15 16:27:53 -03:00
kill_process.go Download and launch orbit for the current device when starting preview (#2437) 2021-10-15 18:23:06 -03:00
kill_process_windows.go Download and launch orbit for the current device when starting preview (#2437) 2021-10-15 18:23:06 -03:00
login.go Tweak output for fleetctl login --help (#4776) 2022-03-23 16:40:16 -04:00
logout.go Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
logout_test.go Simplify fleetctl implementation and improve testing (#3830) 2022-01-24 16:40:51 -03:00
package.go Implement retries when building MSI on Apple M1 architecture (#7367) 2022-08-24 14:52:32 -04:00
package_test.go implement a docker image to package orbit natively in Linux (#6504) 2022-07-11 09:49:13 -03:00
preview.go Validate team and appconfig payloads, with dry-run and force modes (#7731) 2022-09-19 13:53:44 -04:00
preview_test.go test: use T.Setenv to set env vars in tests (#6714) 2022-07-18 14:22:28 -03:00
query.go fleetctl query improve error message (#5141) 2022-04-20 11:35:46 -06:00
query_output.go Support close the websocket of LiveQueryResultsHandler (#1006) 2021-09-10 16:26:39 -03:00
query_test.go Allow troubleshooting of mocked live query store (#6197) 2022-06-13 10:18:03 -03:00
session_test.go Print version warning when using fleetctl (#4139) 2022-02-14 09:43:34 -07:00
setup.go Fleet Premium: de-anonymize usage stats (#7013) 2022-08-03 14:44:34 -04:00
testing_utils.go Add support for custom headers in fleetctl (#6118) 2022-06-07 16:00:09 -04:00
user.go Create Bulk Users from CSV (#3372) 2022-06-22 13:34:58 -03:00
users_test.go Create Bulk Users from CSV (#3372) 2022-06-22 13:34:58 -03:00
vulnerability_data_stream.go Fixes various bugs with NVD vulnerability detection (#7963) 2022-10-04 07:04:48 -04:00
vulnerability_data_stream_test.go improve vuln cpe matching on macos (#6985) 2022-09-01 10:02:07 -06:00