Commit Graph

37 Commits

Author SHA1 Message Date
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
Zachary Wasserman
b0595748f1 Implement pagination of hosts in the web UI
This commit takes advantage of the existing pagination APIs in the Fleet
server, and provides additional APIs to support pagination in the web
UI. Doing this dramatically reduces the response sizes for requests from
the UI, and limits the performance impact of UI clients on the Fleet and
MySQL servers.
2020-07-21 14:05:46 -07:00
grantseltzer
755f63f8c0
Refactor fleetctl get subcommands so that they all have json and yaml output options (#2244) 2020-06-23 08:11:47 -07:00
Zachary Wasserman
c1aa8355cb
Add support for multiple enroll secrets (#2238)
- Support multiple enroll secrets
- Record name of enroll secret used when host enrolls
- Update fleetctl and UI to support these features
2020-05-29 09:12:39 -07:00
billcobbler
a856fd5c0b Add fleetctl get/apply config (#2143)
Implements #1953
2019-11-19 21:13:15 -08:00
Michael Samuel
523967bd74 Add --with-queries flag to get packs (#2095)
Closes #2052 #1975
2019-08-14 10:44:23 -07:00
Michael Samuel
bdeea59c73 fleetctl: add --yaml flag to get command for labels, packs, and queries (#2092)
Closes #1813
2019-08-13 09:41:40 -07:00
blaedj
be85377326
Add 'get hosts' command to fleetctl (#1977)
This commit:
 - adds a new sub-command for fetching hosts to `fleetctl get` command.

Why?
 - this allows for listing of all hosts via the fleetctl interface.
 There may be additional attributes of the host that we'd like to
 display, but this should be a good start.

Closes #1962
2019-01-03 16:19:23 -06:00
Mike Arpaia
1d70b082a5
Add a setup guide for new CLI users (#1798) 2018-05-22 17:57:56 -06:00
Zachary Wasserman
e626d5d060 Add options clients and commands (#1791) 2018-05-21 10:25:58 -06:00
Mike Arpaia
ab23e60a98
Add fleetctl get label, pack, query for individual items by name (#1768)
This PR adds support for getting resources by name.

```
$ fleetctl get queries
no queries found

$ fleetctl apply -f ./query.yaml
[+] applied 1 queries

$ fleetctl get queries
+-----------------+--------------------------------+--------------------------------+
|      NAME       |          DESCRIPTION           |             QUERY              |
+-----------------+--------------------------------+--------------------------------+
| osquery_version | The version of the Launcher    | select launcher.version,       |
|                 | and Osquery process            | osquery.version from           |
|                 |                                | kolide_launcher_info launcher, |
|                 |                                | osquery_info osquery;          |
+-----------------+--------------------------------+--------------------------------+

$ fleetctl get query osquery_version
apiVersion: v1
kind: query
spec:
  description: The version of the Launcher and Osquery process
  name: osquery_version
  query: select launcher.version, osquery.version from kolide_launcher_info launcher,
    osquery_info osquery;
```
2018-05-08 18:10:01 -06:00
Mike Arpaia
64a75c3b57
fleetctl get labels, queries, and packs (#1764) 2018-05-07 20:09:37 -06:00