Commit Graph

446 Commits

Author SHA1 Message Date
Mike Stone
39c9c6b0da Manage queries page (#762)
* renders ManageQueriesPage at /queries/manage

* Renames QueriesList components to ScheduledQueriesList components

* creates QueriesList component

* Adds side panel component to display query details

* Adds KolideAce editor to Query Details side panel

* Handle Edit Query button click

* Change text of the Delete Query button

* Show confirmation modal before deleting queries
2017-01-06 15:57:44 -05:00
Zachary Wasserman
5371647d2c Add builtin labels via migration (#728)
Changing from the existing method of adding built in labels at server startup.
This new method should be friendlier to long term changes, and falls in line
with the new pattern established for osquery options.

Fixes #702
2017-01-06 12:30:43 -08:00
Mike Stone
a9cfd5b641 Adds API client to destroy queries (#784) 2017-01-06 15:26:58 -05:00
Kyle Knight
8647d9c669 404 & 500 Error pages (#780)
* Adding in favicons

* Helps if i add the images

* Updating apple icon names

* 404 Page

* 500 Page

* Cleaning up linting issues
2017-01-06 13:25:48 -07:00
Mike Stone
e9cc3e3a13 Only re-render the org logo when src is changed (#779) 2017-01-06 13:45:37 -05:00
Kyle Knight
3a6a32a645 Favicons (#778)
* Adding in favicons

* Helps if i add the images

* Updating apple icon names
2017-01-06 10:28:34 -07:00
Kyle Knight
eaf0105c6c Some additional stylings to make New Packs a little more bester (#679) 2017-01-06 09:36:51 -06:00
Kyle Knight
a8947adf36 min-height on manage pages (#770) 2017-01-06 09:31:14 -06:00
Kyle Knight
d6a7fd1e3a Moving buttons to be inline with SMTP Options (#768) 2017-01-06 09:30:31 -06:00
Kyle Knight
e5a2f42f4b Fixing Manage User cards (#767) 2017-01-06 09:30:06 -06:00
Mike Arpaia
23c86f6c12 Ensure author name and packs are set in NewQuery response (#774) 2017-01-05 18:48:56 -07:00
Mike Stone
1c2d243cc8 Validate presence of the organization name in settings (#773) 2017-01-05 19:41:32 -05:00
Mike Stone
f532c2fd70 Fixes bug for undefined ID when revoking invites (#771) 2017-01-05 19:13:28 -05:00
Mike Stone
92d91fdebc Handle server errors (#730)
* consistent error handling

* Display server errors in InviteUserForm

* Handle errors in Form component

* Refactors query form

* creates KolideAce component

* Renders QueryForm from query page and manage hosts page

* Moves ace editor and select targets dropdown to query form

* Render base errors in Form HOC

* LoginPage and ForgotPasswordPage server errors

* Ensure unique key for user blocks

* Adds base error to login form and forgot password form

* Adds base error to query form

* Adds base error to Pack Form

* Adds errors to confirm invite form

* Adds clearErrors action

* clear errors when confirm invite page unmounts

* Handle errors in the App Setting page

* Handle server errors in the User Settings Page

* Handle server errors in the User Management Page
2017-01-05 19:01:17 -05:00
Kyle Knight
1d560c004e Host Details cards cleanup (#700) 2017-01-05 12:08:50 -06:00
Kyle Knight
cff7d19ad5 Updating FlashMessage styles (#684) 2017-01-05 12:08:19 -06:00
Zachary Wasserman
35806f1442 Separate tables from data migrations (#745)
This PR separates the table migrations from the data population migrations. Table migrations run before data migrations.

Now, we have the ability to create the database tables without populating them with data. This can be useful for running "unit" tests against a MySQL store that doesn't have any pre-populated data. When performing real migrations, or for more "integration" style testing, the data migrations can also be executed.

Note there are some special cases that must be observed with these migrations, and the README is updated to reflect those.
2017-01-05 09:27:56 -08:00
Kyle Knight
413789386a Updating styles for Accept Invite page (#747) 2017-01-05 09:53:41 -06:00
Kyle Knight
87edc9c238 Updated User Menu Design (#749) 2017-01-05 09:41:53 -06:00
Kyle Knight
ab540cdfb5 Dropdown Button (#744) 2017-01-05 09:26:10 -06:00
John Murphy
f4ae2c1446 Added make task with coverage and race analysis (#754)
* Added make task with coverage and race analysis

* removed coverage and race conditons from test task

* changed test-analyze-go to analyze-go
2017-01-04 15:59:17 -06:00
Jason Meller
4a7e74fdfa Add Contrived Documentation (#736)
* Add some contrived documentation for testing

* Fix broken images
2017-01-04 14:22:38 -07:00
Mike Arpaia
704ddd424b Host summary endpoint (#742)
* Initial scaffolding of the host summary endpoint

* inmem datastore implementation of GenerateHostStatusStatistics

* HostSummary docstring

* changing the url of the host summary endpoint

* datastore tests for GenerateHostStatusStatistics

* MySQL datastore implementation of GenerateHostStatusStatistics

* <= and >= to catch exact time edge case

* removing clock interface method

* lowercase error wraps

* removin superfluous whitespace

* use updated_at

* adding a seen_at column to the hosts table

* moving the update of seen_time to the caller

* using db.Get instead of db.Select
2017-01-04 14:16:17 -07:00
Victor Vrantchan
046f75295e consolidate delete operations in mysql store (#746)
Adds a helper method which soft deletes entities from the database.
2017-01-04 13:18:21 -05:00
Mike Stone
4ba3ad51f0 All packs page (#709)
* Display packs page at /packs/manage

* Adds NumberPill component

* Filter packs list

* Render the pack info side panel when no packs are selected

* Adds packs list

* Moves state management to page component

* Display selected pack count

* Render bulk action buttons

* API client - update pack

* API client - destroy pack

* Adds update/destroy functions to packs redux config

* Bulk actions (enable, disable, delete)

* Selecting a pack updates state

* PackDetailsSidePanel updates pack status

* Link to edit pack on side panel

* sets selected pack in URL

* Sets color for unsettled buttons

* Loads scheduled queries for selected pack in All Packs Page

* PackDetailsSidePanel component

* PackDetailsSidePanel styles

* styles PacksList component

* Stop rendering flash when pack status is updated

* Makes full row clickable

* highlight selected pack
2017-01-03 15:56:50 -05:00
Mike Arpaia
0122f6cb0a Add host_ids and label_ids fields to the packs API (#737)
This PR adds the `host_ids` and `label_ids` field to the packs HTTP API so that one can operate on the hosts/labels which a pack is scheduled to be executed on. This replaces (and deletes) the `/api/v1/kolide/packs/123/labels/456` API in favor of `PATCH /api/v1/packs/123` and specifying the `label_ids` field. This also allows for bulk operations.

Consider the following API examples:

## Creating a pack with a known set of hosts and labels

The key addition is the `host_ids` and `label_ids` field in both the request and the response.

### Request

```
POST /api/v1/kolide/packs
```

```json
{
	"name": "My new pack",
	"description": "The newest of the packs",
	"host_ids": [1, 2, 3],
	"label_ids": [1, 3, 5]
}
```

### Response

```json
{
	"pack": {
		"id": 123,
		"name": "My new pack",
		"description": "The newest of the packs",
		"platform": "",
		"created_by": 1,
		"disabled": false,
		"query_count": 0,
		"total_hosts_count": 5,
		"host_ids": [1, 2, 3],
		"label_ids": [1, 3, 5]
	}
}
```

## Modifying the hosts and/or labels that a pack is scheduled to execute on

### Request

```
PATCH /api/v1/kolide/packs/123
```

```json
{
	"host_ids": [1, 2, 3, 4, 5],
	"label_ids": [1, 3, 5, 7]
}
```

### Response

```json
{
	"pack": {
		"id": 123,
		"name": "My new pack",
		"description": "The newest of the packs",
		"platform": "",
		"created_by": 1,
		"disabled": false,
		"query_count": 0,
		"total_hosts_count": 5,
		"host_ids": [1, 2, 3, 4, 5],
		"label_ids": [1, 3, 5, 7]
	}
}
```

close #633
2017-01-03 10:32:06 -07:00
Mike Arpaia
b03e504a80 MySQL's datastore.Drop should drop all tables (#738)
* MySQL's datastore.Drop should drop all tables

* Use the database name as a parameter

* tx.Exec instead of tx.MustExec
2017-01-03 09:54:24 -07:00
John Murphy
d1ef37b92c Osquery Options - /config/osquery-options #365 (#729) 2016-12-31 11:56:54 -06:00
Mike Arpaia
e4fa278f59 Removing unused webpack aliases (#734) 2016-12-31 01:41:01 -07:00
Mike Arpaia
9a146c5f92 Renaming targets_count to be more clear (#733) 2016-12-30 12:30:34 -07:00
Mike Arpaia
e9aa5bcc8c Return query_count and targets_count in all pack responses (#731) 2016-12-30 12:06:54 -07:00
Victor Vrantchan
154200db8a Add endpoint to retrieve an invite with the invite token. (#719)
Closes #579
2016-12-29 20:58:12 -05:00
Victor Vrantchan
6cb1026d86 always return errors to the client as a map slice (#724)
keep the format for error returns consistent by always returning a
[]map[string]string for json errors. This simplifies the error handling
on the frontend.

Use "name":"base" as the name field for errors which do not have
a specific or known form field.
2016-12-29 19:40:12 -05:00
Victor Vrantchan
a13042e11b Redirect frontend routes to setup if setup is not configured. (#721)
Closes #617
2016-12-29 18:36:36 -05:00
Mike Stone
448e806c36 374 confirm invite (#583)
* ConfirmInviteForm

* Render ConfirmInvitePage at /invites/:invite_token

* Add email, pre-fill name, and handle successful submit

* Fix button text
2016-12-29 15:27:43 -05:00
Zachary Wasserman
ca72a5c67a Add check for all platforms in label query retrieval (#705)
Fixes #703
2016-12-29 12:11:26 -08:00
Mike Stone
cba01cd052 Handle invalid delete requests (#699)
* Handle delete responses like other responses

* Render error flash if an invite can't be deleted
2016-12-29 12:04:03 -07:00
John Murphy
eec835a07a Osquery options 365 (#657) 2016-12-29 12:32:28 -06:00
Mike Stone
fc6a7a7921 Redirect to manage hosts page after login (#715) 2016-12-29 13:14:26 -05:00
Mike Stone
a6d6b20484 Use org logo url (#686)
* Sets config's org logo url in site nav header

* Site nav header cleanup

* Use default image for org logo
2016-12-29 09:40:08 -05:00
Victor Vrantchan
52580ff872 Add invite email template and use the new invite mailer pattern (#711)
Closes #693
Closes #581
2016-12-28 11:55:03 -05:00
Mike Stone
7fa60d0724 Change Button component to take children instead of text prop (#710) 2016-12-28 10:24:52 -05:00
Zachary Wasserman
39ebd81dc5 Close orphaned distributed query campaign after failed publish attempt (#707)
A distributed query campaign can be "orphaned" (left in the QueryRunning state)
if the Kolide server restarts while it is running, or other weirdness occurs.
When this happens, no subscribers are waiting to read results written by
osqueryd agents, but the agents continue to receive the query. Previously, this
would cause us to error on ingestion.

The new behavior will instead set the campaign to completed when it detects
that it is orphaned. This should prevent sending queries for which there is no
subscriber.

- New NoSubscriber error interface in pubsub
- Detect NoSubscriber errors and close campaigns
- Tests on pubsub and service methods

Fixes #695
2016-12-27 10:35:19 -05:00
Kyle Knight
6f90e51bc7 Style App settings form (#701) 2016-12-27 10:32:30 -05:00
Victor Vrantchan
6b41d2b3f0 always print email messages in dev mode (#698) 2016-12-24 10:41:59 -05:00
Mike Stone
ee6832c743 App settings page (#615)
* AppSettingsPage at /admin/settings

* Adds App Settings to site nav items

* SMTP not configured warning

* Creates AppConfigForm

* Avatar preview

* API client to update app config

* Creates OrgLogoIcon component

* Hide username/password when no auth type
2016-12-23 13:40:16 -05:00
Victor Vrantchan
f092c614cf add error logging to distributed query campaign handler (#694) 2016-12-22 20:31:45 -05:00
Zachary Wasserman
2c7fc2a6f2 Minor refactoring in HostStatus function (#692)
- Refactor function
- Add test
2016-12-22 13:32:40 -08:00
Kyle Knight
5ec95a5a3b Integrating PlatformIcon component (#687) 2016-12-22 13:35:24 -06:00
Mike Arpaia
ef22d81b50 Return query and name after creating a scheduled query (#690) 2016-12-22 14:29:29 -05:00