Commit Graph

61 Commits

Author SHA1 Message Date
Martin Angers
c1d3f67e6f
Add fleetctl get mdm-commands command and supporting API endpoint (#11163) 2023-04-17 11:45:16 -04:00
Roberto Dip
77e5c004f4
implement bootstrap packages during DEP enrollment (#11052)
#10213
2023-04-07 17:31:02 -03:00
Martin Angers
4ed50185c0
Add clearer message when mdm-command-results fails due to authz (#10997) 2023-04-05 11:57:31 -04:00
Martin Angers
741a7aa5d0
Finalize MDM commands part 3: add the fleetctl get mdm-command-results command (#10964) 2023-04-05 10:50:36 -04:00
Martin Angers
e0e547f1a2
Finalize MDM commands part 2: implement fleetctl mdm run-command (#10866) 2023-04-03 14:25:49 -04:00
Martin Angers
0e2c9bb873
finalize mdm commands part 1: support fleetctl get hosts --mdm and --mdm-pending (#10796) 2023-03-29 08:30:49 -04:00
Noah Talerman
4372b5b2b5
Update broken links to MDM docs (#10789)
- At some point we updated how we generate anchor links on
fleetdm.com/docs. PR is here: #10657
  - For example:
-
`https://fleetdm.com/docs/using-fleet/mdm-setup#apple-push-notification-service-ap-ns`
is now
`https://fleetdm.com/docs/using-fleet/mdm-setup#apple-push-notification-service-apns`
(apns doesn't have a hyphen)
2023-03-27 17:14:20 -07:00
Mo Zhu
e632725a44
Break up MDM docs to be smaller articles for improved readability. (#10538)
- Broke up the single MDM doc into multiple ones organized by category
- Changed any links to point to the new docs

---------

Co-authored-by: Noah Talerman <noahtal@umich.edu>
Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
2023-03-17 12:34:35 -07:00
Lucas Manuel Rodriguez
dfe6b53963
Make fleetctl get teams --yaml output compatible with fleetctl apply -f (#9626)
#9535

- [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.
- ~[ ] 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-02-02 14:46:50 -03:00
Martin Angers
84717de461
Document APNs and ABM setup and renewal (#9471) 2023-01-24 15:20:41 -05:00
Martin Angers
f18a320bd5
Add command get mdm-apple-bm to fleetctl (#8949) 2022-12-12 15:45:53 -05:00
Roberto Dip
e68535d468
report errors that can occur during file carving (#8972)
related to https://github.com/fleetdm/fleet/issues/8117
2022-12-09 13:21:30 -03:00
Martin Angers
d4a3730610
Add new configuration options for Apple Business Manager (#8886) 2022-12-06 15:50:56 -05:00
gillespi314
6fb3a87ae9
Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
Martin Angers
866829dbfa
Implement fleetctl get mdm-apple (#8786) 2022-12-05 11:35:45 -05:00
Frank Sievertsen
e54f066266
Add display_name to more results (#8204)
* Make HostResponses with one dedicated function only
* more display_name for Hosts
2022-10-14 11:14:18 -03:00
Lucas Manuel Rodriguez
6dcff28be0
Move specs parsing functionality to a new pkg/spec package (#7050) 2022-08-05 19:07:32 -03:00
Michal Nicpon
d4be5ad2a1
add upgrade tests (#6596)
* add upgrade tests

* fix lint issues

go.mod

* remove req.cnf

* revert unrelated changes

* make version configurable in test

* fix golangci-lint ruleguard issue

Related to https://github.com/go-critic/go-critic/issues/1152
Need to have github.com/quasilyte/go-ruleguard/dsl

* fix lint issues

* fix

* clean up docker-compose.yml

* fix http request

* add readme

* fix lint issues

* address feedback

* fix

* add platform

* address feedback

* run go fmt
2022-07-19 15:11:51 -06:00
Roberto Dip
33a482448b
improve messaging of fleetctl debug errors and archive commands (#5590)
Related to https://github.com/fleetdm/fleet/issues/5504, this change attempts to improve the output of the `fleetctl debug errors` command by:

- Adding a warning message to redact sensitive data
- Adding a `json` extension to the output file
- Allowing to stream the output to stdout via the `-stdout` flag or the `STDOUT` env var

The output after this changes is:

```
~/projects/fleet $ ./build/fleetctl debug errors
################################################################################
# WARNING:
#   The generated file may contain sensitive data.
#   Please review the file before sharing.
#
#   Output written to: fleet-errors-2022-05-05T12:46:42-03:00.json
################################################################################
```

It also modifies the output of `fleetctl debug archive`

```
################################################################################
# WARNING:
#   The files in the generated archive may contain sensitive data.
#   Please review them before sharing.
#
#   Archive written to: fleet-profiles-archive-2022-05-05T12:46:59-03:00.tar.gz
################################################################################
```
2022-05-10 10:44:06 -03:00
Juan Fernandez
3228e1b5dc
Humanize duration values returned by fleetctl (#5123)
* Bug 5066: Format config durations

Change duration values returned by 'fleetctl get config --include-server-config' from nanoseconds to a human readable format.
2022-04-19 09:29:50 -04:00
Michal Nicpon
15fef92c6e
fix format uint (#4221) 2022-02-15 15:03:27 -07:00
Michal Nicpon
9009857022
Add get team by name to fleetctl (#4202) 2022-02-15 11:48:09 -07:00
Martin Angers
69a4985cac
Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
Martin Angers
3aef96e15c
Add test for fleetctl preview (#2388)
* Start a fleetctl preview test

* Add tests for fleetctl preview

* Fix setting of fleetctl auth token in test

* Add fleet instance vulnerabilities config to response of GetAppConfig

* Add checks that fleetctl preview enables vulnerability detection

* Adjust doc for get config API response

* Add the include-server-config flag to fleetctl get config

* Update test now that some of the PRs have been merged

Co-authored-by: Tomas Touceda <chiiph@gmail.com>
2021-10-07 10:19:10 -03:00
Tomas Touceda
28c3e64e41
Expose additional queries in fleetctl get hosts (#2349) 2021-10-04 15:18:02 -03:00
Tomas Touceda
176037cad2
Implement fleetctl get software and the underlying API (#1999)
* Implement fleetctl get software and the underlying API

* Add documentation

* Simplify list software implementation

* Lint fixes

* Make team name unique

* Address review comments

* Fix lint

* Fix tests
2021-09-14 10:58:48 -03:00
Benjamin Edwards
047dc5ac62
fix get hosts command to properly output json/yaml (#1774)
* fix get hosts command to properly output json/yaml based on command line flag

* add changes file

* added tests for get hosts when specifiying host

* added additional hosts to be returned in test cases

* go fmt
2021-08-31 11:37:03 -04:00
Martin Angers
a3714d2ed9
Add fleetctl debug connection command (#1706)
Adds the `fleetctl debug connection` command to investigate
connection issues to the fleet server.

Closes #1579 .
2021-08-24 08:50:03 -04:00
Tomas Touceda
c6c63ab12a
Refactor app config (POC, for now) (#1685) 2021-08-20 12:27:41 -03:00
Benjamin Edwards
8bdad712d8
add team_id filter to fleetctl & api (#1596)
* add team_id filter to fleetctl via get hosts --team flag & api via api/v1/fleet/hosts and api/v1/fleet/labels/id/hosts

* update tests & add changes file
2021-08-11 10:40:56 -04:00
Tomas Touceda
989e638cc0
Make creating dirs and files more secure by checking permissions (#1566)
* Add safe mkdirall and open

* Use secure as much as possible and merge gomodules for orbit to fleet

* Improve openfile and mkdirall to check for permissiveness instead of equality

* Don't shift

* Fix links

* Address review comments
2021-08-11 11:02:22 -03:00
Benjamin Edwards
5a606422f7
update printHost to serialize HostResponse rather than just Host (#1440)
* update printHost to serialize HostResponse rather than just Host
* added change log file
* Update changes/issue-1373-add-status-to-fleetctl-get-command
Co-authored-by: Tomas Touceda <chiiph@gmail.com>
2021-07-23 10:48:40 -04:00
Tomas Touceda
9863b0f4bb
Issue 1361 fleetctl teams (#1405)
* WIP

* Add get user_roles and apply for a user_roles spec to fleetctl

* Uncomment other tests

* Update test to check output

* Update test with the new struct

* Mock token so that it doesn't pick up the one in the local machine

* Address review comments

* Fix printJSON and printYaml

* Fix merge conflict error

* WIP

* wip

* wip

* Finish implementation

* Address review comments

* Fix flaky test
2021-07-19 16:48:49 -03:00
Tomas Touceda
545b3f396e
Issue 1362 fleetctl user roles (#1397)
* WIP

* Add get user_roles and apply for a user_roles spec to fleetctl

* Uncomment other tests

* Update test to check output

* Update test with the new struct

* Mock token so that it doesn't pick up the one in the local machine

* Address review comments

* Fix printJSON and printYaml

* Fix merge conflict error

* If both roles are specified, fail

* Fix test

* Switch arguments around

* Update test with the new rule

* Fix other tests that fell through the cracks
2021-07-16 15:28:13 -03:00
Zach Wasserman
c5280c0517
Add v4 suffix in go.mod (#1224) 2021-06-25 21:46:51 -07:00
Zach Wasserman
fb32f0cf40
Remove kolide types and packages from backend (#974)
Generally renamed `kolide` -> `fleet`
2021-06-06 15:07:29 -07:00
Zach Wasserman
64f2cfc9cd
Refactor enroll secrets to support Teams (#903)
- Add `team_id` field to secrets.
- Remove secret `name` and `active` fields (migration deletes inactive secrets).
- Assign hosts to Team based on secret provided.
- Add API for retrieving secrets by Team.
2021-05-31 09:02:05 -07:00
Zach Wasserman
0e9eb920d4
Refactor struct slices for consistent pointer use (#864)
Some datastore and service methods would return slices of structs,
rather than slices to pointers of structs (which most methods used).
Make this more consistent.
2021-05-25 18:53:22 -07:00
Zach Wasserman
b1a98a6e91
Update agent options storage for teams (#754)
- Allow agent options to be set on per-team basis.
- Move global agent options into app configs.
- Update logic for calculating agent options for hosts.
- Updates to relevant testing.
2021-05-11 18:15:16 -07:00
Zach Wasserman
4cfcb1b084
Upgrade fleetctl github.com/urfave/cli to v2 (#471)
This is intended to upgrade to the new API without changing fleetctl
functionality.
2021-03-12 16:42:38 -08:00
Zach Wasserman
22d9205d35
Add debug flag to fleetctl (#266)
This flag enables logging of HTTP requests and responses to stderr.

Closes #187
2021-02-02 18:55:16 -08:00
Zach Wasserman
0bb9d69ece
Add debug endpoints and associated fleetctl commands (#45)
Adds endpoints and fleetctl commands to retrieve various debug profiles
from the Fleet server.

The best summary is from the help text:

```
fleetctl debug
NAME:
   fleetctl debug - Tools for debugging Fleet

USAGE:
   fleetctl debug command [command options] [arguments...]

COMMANDS:
   profile    Record a CPU profile from the Fleet server.
   cmdline    Get the command line used to invoke the Fleet server.
   heap       Report the allocated memory in the Fleet server.
   goroutine  Get stack traces of all goroutines (threads) in the Fleet server.
   trace      Record an execution trace on the Fleet server.
   archive    Create an archive with the entire suite of debug profiles.

OPTIONS:
   --config value   Path to the Fleet config file (default: "/Users/zwass/.fleet/config") [$CONFIG]
   --context value  Name of Fleet config context to use (default: "default") [$CONTEXT]
   --help, -h       show help
```
2020-11-17 17:12:37 -08:00
Mike Arpaia
af96e52a00
Update the Go import paths to new repo name (#27) 2020-11-11 09:59:12 -08:00
Zachary Wasserman
e452cc6a8a
Add file carving support (#15)
- Add endpoints for osquery to register and continue a carve.
- Implement client functionality for retrieving carve details and contents in fleetctl.
- Add documentation on using file carving with Fleet.

Addresses kolide/fleet#1714
2020-11-04 20:45:16 -08:00
Brendan Shaklovitz
8246b4d1f8
fleetctl: allow disabling packs via apply (#2325)
Closes issue #2240
2020-10-21 16:29:27 -07:00
Brendan Shaklovitz
59ba129718
Consistent use of constants in fleetctl (#2320)
Refactor fleetctl get & apply to use constants for spec kinds

Closes #2283
2020-10-08 10:16:07 -07:00
James Alseth
1d5f5d7eac
Add osquery_version to the table in fleetctl get hosts (#2304) 2020-09-25 10:15:42 -07:00
Brendan Shaklovitz
0cf47bf233
Fix fleetctl get options typo (#2281)
Fixes issue where `fleetctl get options` returns `option` (singular)
as `kind` instead of `options` (plural). This would cause `fleetctl
apply -f options.yml` to fail on options yaml generated by `fleetctl get
options` with this error: `unknown kind "option"`.
2020-08-07 15:28:24 -07:00
Zachary Wasserman
0619581b03
Print single secret value if name specified (#2274)
Closes #2272
2020-08-03 11:51:29 -07:00
Zachary Wasserman
fcb8418b2f Add fleetctl get host capability to get single host with labels
Getting a single host with `fleetctl get host foobar` will look up the
host with the matching hostname, uuid, osquery identifier, or node key,
and provide the full host details along with the labels the host is a
member of.
2020-07-21 14:05:46 -07:00