Commit Graph

420 Commits

Author SHA1 Message Date
Tomas Touceda
2d553db2aa
Issue 1231 add global schedule (#1383)
* Add Global Schedule

* Uncomment tests

* Uncomment integration tests

* Add targets for global schedule

* Add host label

* Simplify implementation

* wip

* Fix mock

* Add missing test

* Further simplify the implementation

* Forgot to remove test name

* Update names
2021-07-16 10:15:15 -03:00
Tomas Touceda
804136127e
Remove repository sources from software inventory (#1387) 2021-07-15 10:23:27 -03:00
Tomas Touceda
82ab0a798e
Add host users (#1334)
* Add host users

* Add changes file and test removing pull_request from the on test

* Remove users and store the removal timestamp

* Improve test yml to allow for PRs from forks
2021-07-13 17:15:38 -03:00
Tomas Touceda
d5e40f329e
Issue 1324 add activity feed (#1343)
* Add activities generation

* Add activities endpoint

* Fix merge error

* Fix indentation issue

* Add changes file

* Address PR review comments

* Add mock activity func

* Address codacy warings

* Set foreign key but on delete set null

* Make user_id set to null if deleted
2021-07-13 16:54:22 -03:00
Tomas Touceda
322ac3c8f6
Make roles for users mandatory (#1338)
* Make roles for users mandatory

* Remove nop migration

* Add missing test for wrong role

* Properly validate global and team roles

* Address codacy issues

* Address codacy review

* No need to check for nil
2021-07-13 16:33:04 -03:00
Tomas Touceda
f534b8b6fe
When creating a pack store team, host, and label ids provided (#1332)
* When creating a pack store team, host, and label ids provided

* Mock store to test only the service
2021-07-12 10:48:50 -03:00
gillespi314
2d16ad1608
Fix asset url for email template images (#1347) 2021-07-09 18:34:08 -05:00
Tomas Touceda
7d3d84faaf
Make it possible to clear host settings from app config (#1339) 2021-07-09 15:13:11 -03:00
Tomas Touceda
39034071ca
Issue 1286 improve errors (#1322)
* Refactor error handling for better extensibility and add more scaffolding for specific db errors

* Add integration tests to check errors from mysql are translated properly

* Address review comments

* Add changes file
2021-07-08 12:50:43 -03:00
Tomas Touceda
64f6a2f790
Return a distinct error when the auth header is not available vs when it's bad (#1294) 2021-07-05 10:17:31 -03:00
Tomas Touceda
05ba38ce2f
Fetch all data for a host when listing it (#1293) 2021-07-02 12:59:42 -03:00
Zach Wasserman
8384034e04
Update create user validation and documentation (#1285)
Closes #1272
2021-07-02 08:35:26 -07:00
Scott Lampert
fee860bc7a
Fix fleetctl setup requiring https for localhost (#1270)
This fixes a reversion with fleetctl setup that requires https even for localhost connections. This was previously fixed in #489.
2021-06-30 15:31:37 -07:00
Zach Wasserman
a7461d3ece
Improvements to fleetctl enroll secret specs (#1244)
- Do not render Team ID if null.
- Make request and response schema consistent (breaking change).

Fixes #186
2021-06-29 10:58:15 -07:00
Zach Wasserman
782020c320
Add logging for Teams endpoints (#1254) 2021-06-29 10:36:49 -07:00
Zach Wasserman
959c1fda81
Allow global maintainer to transfer hosts between Teams (#1243)
Reclassify these operations as "host write" to apply the appropriate permissions.

Fixes #1237
2021-06-28 16:57:56 -07:00
Zach Wasserman
c5280c0517
Add v4 suffix in go.mod (#1224) 2021-06-25 21:46:51 -07:00
RachelElysia
aeb852e168
Remove username from UI (#1168)
* Remove username from UI code
* Remove username from tests
* Remove username from database
* Modify server endpoints for removing username
* Implement backend aspects of removing username
* Update API docs
* Add name to fleetctl
2021-06-24 13:42:29 -07:00
Zach Wasserman
9d5c87ecf2
Fix additional permission error in reset password (#1187) 2021-06-24 08:59:43 -07:00
Zach Wasserman
1417d01407
Make naming of host columns consistent (#1183)
Adding consistency between API and DB helps to make it easier for users
and developers working with the API to correctly order things.

Closes #317
2021-06-23 17:32:19 -07:00
Zach Wasserman
675e551484
Fix authorization check in reset password (#1182)
Improper authorization checks made it so that users could not reset
their password with a reset token.
2021-06-23 15:59:13 -07:00
Zach Wasserman
2b3f968478
Fix forbidden error for password reset (#1171)
Access the app config directly through the data store, skipping the
incorrect permission check on the service method.
2021-06-23 08:45:03 -07:00
Zach Wasserman
0a77f79d22
Backend and fleetctl for usage analytics (#1167)
- Add enable_analytics column to database.
- Allow enable_analytics to be set via API.
- Add messaging in fleetctl setup.

Note that this defaults to off for existing installations, and defaults
on for newly set up installs.

No collection or sending of analytics yet exists, we are strictly
storing the preference at this time.

Part of #454
2021-06-22 18:02:20 -07:00
Zach Wasserman
19e8da177f
Allow Packs to be targeted to Teams (#1130)
- Add additional target type for packs.
- Refactor pack target datastore.
- Fixes for frontend target selector tier logic on packs page.
2021-06-18 09:43:16 -07:00
Zach Wasserman
2ad557e3b3 Merge branch 'main' into teams 2021-06-18 09:42:20 -07:00
dsbaha
47b423ee29
Add Redis cluster support (#1045)
This should support Redis in both cluster and non-cluster modes.

Updates were made separately to github.com/throttled/throttled to support the slight changes in types.

Co-authored-by: Joseph Macaulay <joseph.macaulay@uber.com>
Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2021-06-18 08:51:47 -07:00
Zach Wasserman
4f8ad2daa0
Return license info after app config modified (#1137) 2021-06-18 08:34:49 -07:00
Martavis Parker
5b2cac31d9
Agent options added to organization settings (#1120)
* #511 refactored update options - new params & ts

* updated server to include agent_options for read and update

* added agent options form to org settings

* #511 finished connecting agent form to server

* #511 fixing api to save/read agent options

* #511 linted

* #511 fixed reading & updating agent options

* #511 api fixes to support agent options

* #511 removed log

* Fix json.RawMessage pointers in tests

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2021-06-17 13:47:15 -07:00
Zach Wasserman
d78c5fd124
Clean up service and return license errors (#1097)
- Expose license errors instead of permission errors by adding explicit skip authorization.
- Remove pre-Teams authorization checks from service.

Fixes #964
2021-06-16 10:55:41 -07:00
noahtalerman
3fe13be701
Update links to main branch in email templates (#1086)
- Update links to documentation
- Update link to assets by editing `getAssetURL()`
- Prettier did some reformatting of the email template code which is resulting in a larger amount of lines changed
2021-06-15 14:29:20 -04:00
Zach Wasserman
233cce6120
Handle missing server_url in setup (#1093)
Improve error handling to avoid a nil pointer panic in the setup endpoint.
2021-06-15 11:25:52 -07:00
Zach Wasserman
0a99ec751c
Fix targeting Teams in live queries (#1043)
Properly handle the `TargetTeam` type, allowing live queries to
successfully execute against Teams.

Part of #1022
2021-06-09 18:56:57 -07:00
Zach Wasserman
e8bb0f9eb5
Allow team user to view host details page (#1033)
Fixes #1019
2021-06-09 13:09:43 -07:00
Zach Wasserman
229a9afed2
Change name of localstorage auth token (#980) 2021-06-06 18:28:37 -07:00
Zach Wasserman
0356115b03
Remove JWT in Fleet session management (#979)
See #978 for motivations for this change.

Closes #978.
2021-06-06 18:10:58 -07:00
Zach Wasserman
db459d3363
Continue to update names in backend code and docs (#976) 2021-06-06 16:58:23 -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
ae1f41638c
Log subject/object/action with authz failures (#972) 2021-06-05 06:22:13 -07:00
Zach Wasserman
08d57b40d1
Remove deprecated kolide names from API routes and configuration (#957)
Closes #260
2021-06-04 16:51:18 -07:00
Zach Wasserman
e4358a92bc
Filter hosts and label counts by teams (#949)
- Add TeamFilter to relevant host and label methods.
- Pass appropriate filter in service methods.

The dashboard should now show the appropriate hosts for a user's team membership.
2021-06-03 18:53:43 -07:00
Zach Wasserman
b3bafdce24
Return error messages for authentication errors (#950)
Previously the authorization middleware was masking the error when
authentication failed.
2021-06-03 18:24:23 -07:00
Zach Wasserman
18faa5a06b
Add authorization checks in service (#938)
- Add policy.rego file defining authorization policies.
- Add Go integrations to evaluate Rego policies (via OPA).
- Add middleware to ensure requests without authorization check are rejected (guard against programmer error).
- Add authorization checks to most service endpoints.
2021-06-03 16:24:15 -07:00
Zach Wasserman
417ef2c9b6
Refactor teams service methods (#910)
- Move team-related service methods to `ee/server/service`.
- Instantiate different service on startup based on license key.
- Refactor service errors into separate package.
- Add support for running E2E tests in both Core and Basic tiers.
2021-05-31 17:07:51 -07:00
Zach Wasserman
a5bd03e5d7 Merge branch 'master' into teams 2021-05-31 10:56:50 -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
8ee47f8b23
Add support for Teams in targets and live queries (#880)
- Accept Teams as a searchable target type for the target selection API.
- Accept Teams for targets in running live queries.
- Refactoring to support these changes.
- Update API documentation.
2021-05-27 13:18:00 -07:00
Zach Wasserman
cebd4df0f5
Update live query and targets APIs for Teams (#876)
- Take query_id in live query and target APIs.
- Use query_id to determine observer targets.
- Update documentation.
2021-05-26 20:45:06 -07:00
Zach Wasserman
48c413a254
Split host additional into separate table (#875)
- Move host `additional` into a separate table.
- Join when that data is needed.
- API change: `/api/v1/fleet/hosts` now returns only the requested
  `additional` columns, unless `*` is provided as the sole argument.

Background:

A customer reported that MySQL binlogs grew huge and replication lag
went way up when data was stored in the `additional` column. In this
deployment MySQL was running with ROW replication. This would cause the
entire `additional` data to be copied on each update of the host checkin
time. While switching to STATEMENT or MIXED replication would likely
mitigate the issue, this was not an option in their environment.
2021-05-26 16:24:12 -07:00
Zach Wasserman
a2a7082bd3
Implement add hosts to team by filters API (#866)
- Add hosts to team using label, status, and query filters.
- Documentation (+ docs for regular add hosts to team).
2021-05-25 21:29:52 -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