Commit Graph

790 Commits

Author SHA1 Message Date
Zachary Wasserman
0d11c8a995 Update go get packages in make deps (#1474) 2017-04-06 12:12:20 -07:00
Zachary Wasserman
d7cd91c0e4 Retrieve and store host checkin intervals (#1473)
We now track the `config_tls_refresh`, `distributed_interval` and
`logger_tls_period` flag values for each host. Each value is updated by a
detail query agains the `osquery_flags` table, because they may be specified
outside of Kolide. The flags that can be specified within Kolide are also
updated when a config is returned to the host that changes their value.

This will enable us to do a more accurate per-host online status calculation as
discussed in #1419.
2017-04-06 11:55:24 -07:00
Zachary Wasserman
6a3ea3fc8c Remove remaining uses of golang.org/x/net/context (#1464) 2017-04-05 12:25:34 -07:00
Victor Vrantchan
79d95af7c9 increment version in changelog (#1467) 2017-04-04 10:15:12 -04:00
John Murphy
c90368c4af Changed default osquery logging behavior
Made log rotation for osquery results and status logs optional.  This required writing the logwriter package which is a drop in replacement for lumberjack.  We still use lumberjack if the log rotation flag --osquery_enable_log_rotation flag is set. Note that the performance of the default is quite a bit better than lumberjack.


BenchmarkLogger-8       	 2000000	       747 ns/op
BenchmarkLumberjack-8   	 1000000	      1965 ns/op
PASS
BenchmarkLogger-8       	 2000000	       731 ns/op
BenchmarkLumberjack-8   	 1000000	      2040 ns/op
PASS
BenchmarkLogger-8       	 2000000	       741 ns/op
BenchmarkLumberjack-8   	 1000000	      1970 ns/op
PASS
BenchmarkLogger-8       	 2000000	       737 ns/op
BenchmarkLumberjack-8   	 1000000	      1930 ns/op
PASS
2017-04-03 16:48:50 -05:00
John Murphy
bff737444f Updated CHANGELOG for 1.0.3 release 2017-04-03 11:15:42 -05:00
Zachary Wasserman
38a900dad5 Edits to admin app settings text (#1460) 2017-03-31 10:11:02 -07:00
Zachary Wasserman
3ef2876aab Minor improvements to logger SIGHUP test (#1459)
These should provide a slight reliability improvement for this test.
2017-03-31 09:59:23 -07:00
Zachary Wasserman
be34ecc557 Add a debug endpoint for collecting performance statistics and profiles. (#1461)
When `kolide serve --debug` is used, additional handlers will be started to
 provide access to profiling tools. These endpoints are authenticated with a
 randomly generated token that is printed to the Kolide logs at startup. The
 profiling tools are not intended for general use, but they may be useful when
 providing performance-related bug reports to the Kolide developers.
2017-03-31 09:56:38 -07:00
John Murphy
d533931799 Addresses Issue where the reset button doesn't work on options page (#1447)
Closes issue #1388. The problem here is that previously, the reset button loaded a hard coded list of default options into the component state, instead of the proper behavior which is to reset the options to default values on the back end, and then load them back into the redux store. This PR adds a ResetOptions endpoint on the server, and wires up the UI so that it triggers the endpoint, then loads the default options from the backend server.
2017-03-30 18:56:11 -05:00
John Murphy
f4bee00b01 Fix Issue where saving same option value errs. (#1433)
Closes issue #1390

There were quite a few places where UPDATES could fail silently because we weren't checking target rows where actually found where we expect them to be. In order to address this problem clientFoundRows was set in the sql driver configuration and checks for UPDATES were added to determine if matched rows were found where we expect them to be.
2017-03-30 17:03:48 -05:00
Zachary Wasserman
765b4b207c Update changelog (#1458) 2017-03-30 11:17:38 -07:00
Zachary Wasserman
60607cb366 Speed up manage packs page loading (#1429)
Push the calculation of target counts into the SQL query, rather than loading
all of the targets and then counting them. This provides a dramatic (>100x)
speedup in loading of the manage packs page when large numbers of hosts are
present.

Closes #1426
2017-03-30 08:31:28 -07:00
Zachary Wasserman
6d9085da71 Remove extraneous calls to MarkHostSeen (#1441)
The seen time should only be updated once per request from the osquery agent to
the Kolide server. We now do that only in AuthenticateHost (which every request
besides enrollment must go through).
2017-03-30 08:31:05 -07:00
Zachary Wasserman
06ed4c2771 Only calculate online interval once when retrieving hosts (#1457)
This makes a major perf difference, as it reduces the O(# of hosts) queries
down to constant.
2017-03-30 08:30:05 -07:00
John Murphy
587b6592ff Fixed problem where changed port didn't trigger validation (#1451)
Closes issue #1380

Skipped validation caused garbage data to get sent to the server which caused an error in the transport middleware.
2017-03-29 22:29:08 -05:00
Victor Vrantchan
2522c3c2ea switch testing cluster location (#1453) 2017-03-29 12:09:38 -04:00
Victor Vrantchan
a9f5442cd2 use stdlib context in go-kit methods (#1454) 2017-03-29 11:46:52 -04:00
John Murphy
693600ba2b Decorator support (#1430)
* Added migrations

* Added handler for decorators

* Added logging and metrics for decorators

* WIP decorators

* Wip added decorator service

* Added service implementation

* Added mock decorator

* Added modify decorator

* Added testing

* Addressed code review issues raised by @zwass

* Added logging for missing type per @zwass
2017-03-28 16:45:18 -05:00
John Murphy
039e9e1a98 Add TLS profiles to command line (#1444)
* Add TLS profiles to command line

* Code review changes per @groob

* fixed busted test
2017-03-27 23:21:48 -05:00
John Murphy
1e72c44e49 Fixed sidebar so config item only shows up for admin users. (#1443) 2017-03-23 09:48:48 -05:00
John Murphy
71e66e6d16 Added code to trim whitespace and trim trailing slash from input server url (#1442) 2017-03-22 14:40:01 -05:00
Zachary Wasserman
55a1e3ec63 Bump default SELECT limit in MySQL datastore (#1440)
This is a temporary workaround for #1431.
2017-03-21 12:13:12 -07:00
John Murphy
404afe3e22 Fix issue where config interval can be number or string (#1432)
* Fix issue where config interval can be number or string

* Implemented @groob code review suggestions

* Added type assertions with graceful failure if something slips through validation

* Implemented code review changes per @zwass
2017-03-21 12:02:13 -05:00
Zachary Wasserman
b59cd2b48b Accelerate checkins when hosts enroll (#1423)
Return `accelerate: 10` with distributed queries if we do not have host
details. This facilitates the host quickly joining all expected labels, as
`platform` gated label queries will not be returned until the detail queries
return with the platform.

Fixes #1421.
2017-03-21 09:17:38 -07:00
Zachary Wasserman
07e7d336dd Enable slow query log on dev DBs (#1437)
With this change, MySQL will log "slow" queries to the `mysql.slow_log` table.
2017-03-20 17:02:44 -07:00
Victor Vrantchan
cab8ed7c00 remove references to missing bits (#1434) 2017-03-20 10:42:47 -04:00
Zachary Wasserman
da096d7b50 Fix platform detection for CentOS6 (#1415)
On CentOS6 there is a bug in which osquery incorrectly reports an empty string
for platform. This PR fixes our detection of centos in this case.

Fixes #1339
2017-03-15 15:40:18 -07:00
Zachary Wasserman
715d908613 Update go-kit to 0.4.0 (#1411)
Notable refactoring:
- Use stdlib "context" in place of "golang.org/x/net/context"
- Go-kit no longer wraps errors, so we remove the unwrap in transport_error.go
- Use MakeHandler when setting up endpoint tests (fixes test bug caught during
  this refactoring)

Closes #1411.
2017-03-15 08:55:30 -07:00
Zachary Wasserman
d3bf134c7e Add Ubuntu16.04 host to docker-compose (#1414)
Enables testing Kolide with a Ubuntu16 host running osquery
2017-03-15 08:53:54 -07:00
Jason Meller
da53c534a1 Update CHANGELOG for 1.0.2 release (#1410) 2017-03-14 09:02:14 -04:00
Zachary Wasserman
0263adcd88 Set payload from argument ID in entity delete action (#1404)
This fixes a bug in which the frontend expected the entity ID to be returned in the response body of a deletion request. Because the API does not do this (and we don't want to make it do this), the ID needs to be made available for updating the UI after the request returns.

Fixes #1398
2017-03-14 08:40:53 -04:00
Kyle Knight
a64d88ff67 Update Webpack to v2 (#1393) 2017-03-13 15:13:33 -04:00
Zachary Wasserman
cc99f081fd Add a minimum threshold for the expected host checkin interval (#1397)
Adding this minimum helps prevent flapping of the online status.

Closes #1396.
2017-03-13 08:55:10 -07:00
Kyle Knight
28f0247654 Fix busted scrolling after full screen query results (#1400) 2017-03-13 11:20:34 -04:00
Kyle Knight
8121e7cf3a Add selected styles to Pack Row (#1379) 2017-03-13 09:32:47 -04:00
Zachary Wasserman
5781613249 Minor fixes in email footer (#1394) 2017-03-10 15:18:40 -08:00
Mike Stone
c7535e8d8c Add Front-end Documentation (#1373) 2017-03-10 17:13:29 -05:00
Kyle Knight
9791e85881 Add styles to SMTP setup confirmation email (#1382) 2017-03-10 17:02:45 -05:00
Mike Stone
a853acd172 Fix bug selecting targets when querying a host (#1366) 2017-03-09 13:01:15 -08:00
Zachary Wasserman
b4e40cf466 Warn before running migrations (#1385)
- Refactor MigrationStatus() to return relevant info
- Warn before running migrations

Closes #1368
2017-03-09 10:40:52 -08:00
Mike Arpaia
f510691ad0 Fix host status regression from #1334 (#1383) 2017-03-09 11:36:24 -07:00
Kyle Knight
b23ab83336 Display loading icon until host details are saved (#1376) 2017-03-09 10:50:53 -05:00
Zachary Wasserman
84ffd1d5a3 Update MySQL definitions for Unicode support 🔥 (#1360)
- Set default database character set to utf8mb4
- Convert character sets for each table to utf8mb4
- Use utf8mb4 as charset in connection string

Closes #1268
2017-03-08 09:29:25 -08:00
Zachary Wasserman
343262b799 Warn on startup if migrations not completed (#1353)
- Add datastore method to check migration status.
- Print a warning on startup if migrations are not completed.

Fixes #1279
2017-03-08 09:17:07 -08:00
Kyle Knight
14fa984bd3 Update All platform text to use Icon (#1363) 2017-03-08 08:40:02 -08:00
Kyle Knight
b875c05f4d Update Pack schedule query Platform to allow All or OSes (#1361) 2017-03-08 08:11:47 -08:00
Mike Arpaia
64e73ef357 Harden TLS server settings (#1367)
* Lower HTTP timeout settings.

  In an effort to provide a more resilient web server, timeouts are more strictly enforced by the Kolide HTTP server (regardless of whether or not you're using the built-in TLS termination). If your Kolide environment is particularly latent and you observe requests timing out, contact us at [help@kolide.co](mailto:help@kolide.co).

* Harden TLS server settings.

  For customers using Kolide's built-in TLS server (if the `server.tls` configuration is `true`), the server was hardened to only accept modern cipher suites as recommended by [Mozilla](https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility).
2017-03-07 19:59:34 -07:00
Mike Arpaia
e4db95d2b5 More sensible online status calculation (#1334)
Improve the mechanism used to calculate whether or not hosts are online.

Previously, hosts were categorized as "online" if they had been seen within the past 30 minutes. To make the "online" status more representative of reality, hosts are marked "online" if the Kolide server has heard from them within two times the lowest polling interval as described by the Kolide-managed osquery configuration. For example, if you've configured osqueryd to check-in with Kolide every 10 seconds, only hosts that Kolide has heard from within the last 20 seconds will be marked "online".
2017-03-07 19:47:51 -07:00
Mike Arpaia
8e61bfb945 Update changelog markdown format (#1372) 2017-03-07 14:30:00 -07:00