Commit Graph

430 Commits

Author SHA1 Message Date
Austin Burnett
57f65e70b8 Allow host expiry window to be altered (#2121)
Fixes a bug in which the event expiry window would not be properly updated.

Fixes #2122
2019-11-12 14:41:16 -08:00
Lars Lehtonen
0a87bbf496 Fix dropped errors in SSO tests (#2141) 2019-11-11 09:42:31 -08:00
Lars Lehtonen
ed9f890ba0 server/mail: Handle error when write fails (#2132) 2019-11-07 08:34:50 -08:00
Zachary Wasserman
adf87140a7
Add ability to prefix Fleet URLs (#2112)
- Add the server_url_prefix flag for configuring this functionality
- Add prefix handling to the server routes
- Refactor JS to use appropriate paths from modules
- Use JS template to get URL prefix into JS environment
- Update webpack config to support prefixing

Thanks to securityonion.net for sponsoring the development of this feature.

Closes #1661
2019-10-16 16:40:45 -07:00
Austin Burnett
59efb495ca Add automatic host expiration capability (#2117)
When configured, this feature will delete hosts that have not checked in after the specified number of days.

Closes #1860.
2019-10-16 16:35:17 -07:00
Matteo Piano
6439828272 Allow host search by UUID (#2116)
- Update MySQL schema to add fulltext index on UUID
- Support UUID in host search query
2019-10-16 10:12:35 -07:00
William Theaker
a688b5cf5b Allow idp_name to be 4 characters (#2106) 2019-09-25 10:18:30 -07:00
Zachary Wasserman
1eccf9a874
Add warning in query UI when Redis fails (#2086)
- Add warning message when Redis fails
- Disable query button when Redis fails
- Refactor SMTP warning banner into component for reuse

Closes #2073
2019-08-13 09:42:58 -07:00
Zachary Wasserman
363b6157c4
Allow scheduled query shard to be set to empty in frontend (#2093)
Fixes #1452
2019-08-13 09:42:02 -07:00
Zachary Wasserman
fa10dbe0a8
Use Github hosted assets in emails sent by Fleet (#2090)
This change allows the images in Fleet emails to load properly from any
device with connectivity to github.com. Previously, emails might try to
load resources from a Kolide server not accessible from the email
client.

The asset URL will be based on the most recent git tag to accomodate
backwards-compatibility if the assets in the repo change.

Closes #1471
2019-08-02 14:08:42 -07:00
Michael Samuel
969d5f25af Add Google Cloud PubSub logging (#2049)
Adds Google Cloud PubSub logging for status and results.

This also changes the Write interface for logging modules to add a context.Context (only used by pubsub currently).
2019-07-16 15:41:50 -07:00
Zachary Wasserman
c269886389
Fix target search behavior with - and + symbols (#2067)
This PR makes the target search more user-friendly by stripping symbols that
have a special interpretation in MySQL FTS.

Closes #2017
2019-07-03 10:47:43 -07:00
Zachary Wasserman
261b7f916c
Save details provided by host during enrollment (#2066)
When an osqueryd agent sends an enroll request it automatically sends
some details about the system. We now save these details which helps
ensure we send the correct platform config.

Closes #2065
2019-07-01 16:50:04 -07:00
Zachary Wasserman
eb212116dc Merge pull request from GHSA-6g7f-8qm4-f7h8
When LOGIN authentication was used, Fleet would send SMTP credentials
even if the connection the SMTP server was not secured via TLS.

Copying the pattern used in the standard library PlainAuth
implementation, we now only send credentials when the connection is
secure or the server is localhost.
2019-05-30 15:02:17 -04:00
Zachary Wasserman
caae22593f
Add 'id' prefix to generated SAML IDs (#2046)
Though the SAML spec does not specify what the contents of the ID must
be, the Azure IdP implementation prohibits it beginning with a number.
We follow their suggestion to prefix with 'id'.

See https://docs.microsoft.com/en-us/azure/active-directory/develop/single-sign-on-saml-protocol.

Fixes #2044.
2019-05-16 13:51:42 -07:00
Eduardo Lopez
ad12ee4db4 Allow Firehose authentication using sts credentials (#2034) 2019-04-24 16:30:16 -07:00
Zachary Wasserman
75868a7005
Do not panic after error reading config file (#2033)
Fixes #1445
2019-04-23 15:59:02 -07:00
Zachary Wasserman
5b486a1849
Update logic for setting primary NIC (#2032)
- The most active NIC will be picked even if a formerly more active
  interface still exists (previously, a NIC would stay primary as long
  as it existed).
- Ignore link-local and loopback interfaces when choosing the primary.
- Fix bugs in which update status of the primary interface could be
  reported incorrectly.

Fixes #2020
2019-04-23 15:58:45 -07:00
Zachary Wasserman
1f7cffba11
Fix newlines in log output (#2029)
Fixes a regression introduced in 2.1.0 in which separate log lines are
no longer output separated by a newline. Now log lines in both output
plugins will do so.
2019-04-17 15:55:31 -07:00
Zachary Wasserman
955972e1a1
Cleanup incoming hosts that do not complete enrollment (#2026)
Deletes hosts that have enrolled but never updated their details (these
hosts show up as "incoming host" in the UI).

Closes #1438
2019-04-09 11:11:11 -07:00
Zachary Wasserman
1acebec4b6
Close flate writer before base64 encoding SAML authorization request (#2025)
Fixes an issue in which the requests are not able to be read by some SAML
request decoders.

Fixes #2024
2019-04-09 09:23:22 -07:00
Zachary Wasserman
e59714242e
Add Firehose logging capabilities for result and status logs (#2022)
- Refactor configuration for logging to use separate plugins
- Move existing filesystem logging to filesystem plugin
- Create new AWS firehose plugin
- Update documentation around logging
2019-04-08 11:47:15 -07:00
Zachary Wasserman
7153e0043c Update email contents and subjects (#2023)
- Refer to "Kolide" as "Fleet"
- Fix link to documentation
- Remove suggestion to email support@kolide.co
2019-04-04 18:56:15 -04:00
Zachary Wasserman
03c23973ca
Small cleanup in live query code (#2011)
- Additional comments
- Fix some cases where websocket may not be closed appropriately
2019-03-10 13:51:11 -07:00
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