Commit Graph

406 Commits

Author SHA1 Message Date
Zachary Wasserman
c8229cc0d6
Replace uses of the term "Kolide" with "Fleet" (#1999)
Almost two years ago, we began referring to the project as Fleet, but there are
many occurences of the term "Kolide" throughout the UI and documentation. This
PR attempts to clear up those uses where it is easily achievable.

The term "Kolide" is used throughout the code as well, but modifying this would
be more likely to introduce bugs.
2019-01-24 09:39:32 -08:00
Zachary Wasserman
6ec951ab73
Default scheduled query name if not specified (#1995)
Brings the behavior of the server in line with the documentation, by using the
query name if the scheduled query name is not specified in a pack spec.

Closes #1990
2019-01-17 15:59:42 -08:00
James Thomas
5e5e4f3918 Add Support for SMTP LOGIN Authentication Method (#1988)
This PR adds support for the SMTP LOGIN authentication method. Office 365 Exchange removed support for PLAIN authentication some time ago, and only supports LOGIN and an OAuth2 authentication method. This patch has been tested with a licensed O365 account. This method should also be usable with any other email server that advertises LOGIN in its 250-AUTH response.

Note: If using this with O365, the account used must not have MFA enabled.

Closes #1663
2019-01-14 12:35:23 -08: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
Zachary Wasserman
0f99b454a0
Add username support to fleetctl setup (#1971)
Username continues to default to email if not specified in the options.

Closes #1970
2019-01-02 15:27:37 -08:00
Zachary Wasserman
b752073d05
Fix slow return of results in fleetctl query with high host count (#1965)
Prior to this change, the live query status was calculated after each retrieved
result. This was fine at a low host count, but when more hosts are added, doing
this calculation becomes slower.

Now, the status is only calculated every 5 seconds, while results can be
streamed continuously.

Fixes #1895
2018-12-20 17:44:49 -08:00
Zachary Wasserman
0b21a3d42c
Delete soft-deleted entities (#1959)
Avoids potential bugs in which soft-deleted entities are returned from database
queries (soft-deletion is now deprecated), but some records may still exist.

Fixes #1956
2018-11-20 17:41:55 -08:00
Zachary Wasserman
051d3c8b07
Fix errors when trying to retrieve specs with spaces in name (#1957)
We need to properly escape and unescape the name parameter.

Fixes #1948
2018-11-20 17:19:24 -08:00
Blake Atkinson
510ec10769 Documentation: Add mysql conn limits (#1947) 2018-11-01 17:43:24 -04:00
Zachary Wasserman
e6f4dd54bb
Fix loading of network interfaces with high host counts (#1942)
This should fix the loading of the all hosts page in cases where there are many
hosts and it overwhelms the number of parameters allowed in a prepared
statement. May also make that page load slightly quicker as it removes the
constraint from the query, but should return the same number of results.

Fixes #1939
2018-10-16 11:13:55 -07:00
Zachary Wasserman
be6a16959a Fix error messages related to null users as creators of queries. (#1928)
Ensure that the queries page still loads even when users are deleted manually
in the DB.

Fixes #1911
2018-10-11 13:22:43 -07:00
Zachary Wasserman
3fa3fe7fdc
Use errors.Wrapf instead of nested fmt.Sprintf (#1933) 2018-10-02 15:19:50 -07:00
adamenger
a99313533d Added custom CA support to fleetctl client (#1931) 2018-10-01 15:23:46 -07:00
Zachary Wasserman
66e720d34d Reduce port scanning possibilities via SMTP configuration
The SMTP configuration could be used by an admin user to port scan the network
the Fleet server was running on. This commit reduces the information possible
to determine via this technique. A malicious admin can no longer determine
whether any TCP server is listening on a given port/address. They can only
determine ports and addresses where SMTP servers are running.

Thanks to 'quikke' for reporting this vulnerability.
2018-09-18 14:56:25 -04:00
Zachary Wasserman
7e26b915c5 Refactoring and fixes in user authorization
- Simplify/fix logic for authorization
- Rename/refactor for clarity
- Add tests for auth related code
2018-09-18 14:56:25 -04:00
Zachary Wasserman
5cbaa9cb9f Prevent non-admin users from modifying other users
An incorrect authorization check allowed non-admin users to modify the details of other users. We now enforce the appropriate authorization so that unprivileged users can only modify their own details.

Thanks to 'Quikke' for the report.
2018-09-18 14:56:25 -04:00
Zachary Wasserman
21269b1dd8 Prevent escalation of user privileges via ModifyUser method
The ability to modify a users admin and enabled status was erroneously left in
place during development of https://github.com/kolide/fleet/pull/959. To
mitigate a privilege escalation vulnerability we need to ensure those values
can only be modified through the explicit methods.

This patch includes a unit test and fix for the vulnerability.

Thanks to 'Quikke' for submitting this vulnerability.
2018-09-18 14:56:25 -04:00
Zachary Wasserman
e011cfc464
Delete packs that have already been soft-deleted (#1924)
We no longer use soft deletion, so this commit introduces a migration that hard
deletes existing deleted packs.

Fixes #1923
2018-09-12 17:50:30 -07:00
Zachary Wasserman
94f5ee7832
Fix bug preventing rename of queries scheduled in packs (#1921)
Change the foreign key constraint to automatically update the query name as
appropriate.

Fixes #1917
2018-09-12 11:25:35 -07:00
Zachary Wasserman
79b2249e69
Allow update of settings page without enabling SMTP (#1903)
Fixes #1871
2018-09-07 15:37:35 -07:00
Zachary Wasserman
dfac039422
Fix targeting packs to individual hosts (#1897)
Packs can be targeted to individual hosts through the UI. This was supported
previously and was broken with refactoring in Fleet 2.0.

There is currently no support in the fleetctl format for targeting individual
hosts, but this could be added at a later date.

Fixes #1878
2018-08-13 10:07:10 -07:00
Chris Helming
4729789943 Trim whitespace from X509 certificate (#1900) 2018-08-10 12:42:35 -07:00
Zachary Wasserman
293ca56040
Fix error when migrating packs and scheduled query has been deleted. (#1851)
Fixes #1850
2018-06-26 09:54:45 -07:00
Zachary Wasserman
06832697d0
Fix deletion of labels in UI (#1848)
- Add endpoint for deletion of label by ID
- Use ID endpoint from frontend JS

Fixes #1847
2018-06-25 13:56:59 -07:00
Zachary Wasserman
08a2dc73cd
Fix bugs with packs created in UI (#1843)
- Delete duplicate queries in packs created by the UI (because the duplicates
  were causing undefined behavior). Now it is not possible to schedule
  duplicates in the UI (but is in fleetctl).
- Fix bug in which packs created in UI could not be loaded by fleetctl.
2018-06-21 17:06:44 -07:00
Zachary Wasserman
4ade65b4c1
Fix deletion of queries referenced by foreign key (#1842)
- Add cascading deletes for scheduled_queries when queries are deleted
- Also add cascading deletes for scheduled_queries when packs are deleted

Fixes #1837
2018-06-20 17:32:43 -07:00
Zachary Wasserman
6424a029ee
Fix labels UI issues in Fleet 2.0 (#1830)
Replaces the UI endpoints for creating and modifying labels. These were removed
in #1686 because we thought we were killing the UI.

Now labels can be created and edited in the UI again.
2018-06-18 10:09:08 -07:00
Zachary Wasserman
0b7747bef0
Fix pack and query UI issues in Fleet 2.0 (#1829)
Replaces (and appropriately refactors) a number of endpoints that were removed long ago when we decided to kill the UI with the fleetctl release. We turned out not to do this, and now need to restore these missing endpoints.

This is not a straight up replacement of the existing code because of refactoring to the DB schemas that was also done in the migration.

Most of the replaced code was removed in #1670 and #1686.

Fixes #1811, fixes #1810
2018-06-15 10:13:11 -04:00
Zachary Wasserman
6eecaa1019
Update redigo import (#1821)
- Use new repo path (old repo archived)
- Update version to 2.0.0

Closes #1820
2018-06-11 12:14:21 -07:00
Mike Arpaia
c91a031d3e
Attempt 2 at returning a serializable config (#1819) 2018-06-11 11:34:05 -06:00
Zachary Wasserman
f8796bc55b
Fix timezone in MySQL connection string (#1818)
Fixes #1643
2018-06-11 07:31:39 -07:00
Thordur Bjornsson
71217e6c52 server/service, livequery: Check totals Load for nil (#1802)
Matches status, if there are no results (yet) this bombs as the
the interface value is nil.
2018-06-04 09:40:41 -06:00
Alex Flores
56a2b81579 Set allowNativePasswords DSN setting to true (#1805) 2018-06-01 14:29:24 -07:00
Mike Arpaia
1d70b082a5
Add a setup guide for new CLI users (#1798) 2018-05-22 17:57:56 -06:00
Mike Arpaia
abab0d4691
Add fleetctl convert command for migrating packs to Fleet's format (#1790) 2018-05-21 10:26:22 -06:00
Zachary Wasserman
e626d5d060 Add options clients and commands (#1791) 2018-05-21 10:25:58 -06:00
Zachary Wasserman
b80e0a102d
Add fleetctl query command (#1784)
Allow queries targeted by hostname and label name.
2018-05-17 15:54:34 -07:00
Thordur Bjornsson
6a4d50c7a6 ensure email and passwords are set during setup (#1786) 2018-05-17 08:29:04 -06:00
Thordur Bjornsson
929000ba28 server: formatting (#1788) 2018-05-16 23:52:24 -06:00
Thordur Bjornsson
d7e1462d10 Check if the jwtToken is valid in authViewer. (#1785)
Closes #1514
2018-05-16 09:36:35 -06:00
Mike Arpaia
b42e4bacf2
Add name not empty validation for spec types (#1783) 2018-05-14 12:23:38 -06:00
Zachary Wasserman
87331b47e2
Return 404 errors where appropriate in spec endpoints (#1777) 2018-05-09 16:54:42 -07:00
Zachary Wasserman
4dfc1ca25e
Improve client error messages with unexpected server errors (#1776) 2018-05-09 16:54:23 -07:00
Zachary Wasserman
bef7a99160
Add logging middleware for spec endpoints (#1774) 2018-05-09 11:00:48 -07: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
2f997b7f22
Merge master 2018-05-07 22:57:08 -06:00
Mike Arpaia
20fb50a7a6
Add fleetctl delete command (#1765) 2018-05-07 20:07:00 -06:00
Zachary Wasserman
d146412364 Implement Get methods for single entities of label, pack and query specs (#1766)
- Datastore methods (where necessary)
- Service methods
- Endpoints/Handlers
2018-05-07 19:54:29 -06:00
Zachary Wasserman
0f00c70606
Fixes in query, pack and label clients (#1763)
- Use authenticated requests
- Don't take a parameter for the Get*Specs methods
2018-05-07 16:30:52 -07:00
Zachary Wasserman
3d1d088be9
Implement clients for labels, packs and queries (#1760)
Go client methods for making get, set and delete requests on label, pack and
query entities.
2018-05-07 12:44:40 -07:00