Commit Graph

336 Commits

Author SHA1 Message Date
Tharun Rajendran
2084b7d310
feat(api): add endpoint to get team by id (#4018)
* feat(api): add endpoint to get team by id

* fix review feedbacks

* add integration test in enterprise suite
2022-02-04 14:33:22 -03:00
Tomas Touceda
656ef07df1
Move ApplyTeamSpec to ee (#4011)
* Move ApplyTeamSpec to ee

* Update test now that apply team specs is behind premium

* Check all auth first

* Change auth call for team creation
2022-02-03 16:24:03 -03:00
gillespi314
dc8eacc95c
Add AvailableTeams to loginResponse and getUserResponse (#3585) 2022-01-13 13:57:44 -06:00
Martin Angers
69a4985cac
Use new error handling approach in other packages (#2954) 2021-11-22 09:13:26 -05:00
Zach Wasserman
f885522628
Fix missing import on Windows (#3035) 2021-11-18 18:37:29 -08:00
gillespi314
bfdedd65e8
Allow API user to delete all team secrets (#2941) 2021-11-17 10:26:24 -06:00
Martin Angers
678d986a4a
Fix call to renamed func (#2932)
* Fix call to renamed func

* Remove unused function

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2021-11-15 17:54:31 -03:00
Zach Wasserman
e279dc1682
Implement fleetctl updates rotate (#2831)
Add support for updating keys used in the TUF update system.
2021-11-15 10:01:48 -08:00
Martin Angers
3ae57a0242
Create errors with ctxerr, add the call to store them in redis (#2786) 2021-11-15 09:11:38 -05:00
gillespi314
229b91b530
Add endpoint for management of team enroll secrets (#2849) 2021-11-11 10:45:39 -06:00
Tomas Touceda
0510075398
Issue 2134 add team admin role (#2499)
* wip

* Add team admin role and tests

* Revert change in invites

* Update permission doc

* Fix lint
2021-10-13 12:34:59 -03:00
Martin Angers
4f4185372d
Add support for context in datastore/mysql layer (#1962)
This is just to pass down the context to the datastore layer, it doesn't
use it just yet - this will be in a follow-up PR.
2021-09-14 08:11:07 -04:00
Tomas Touceda
6d2ae02efd
Rename core->free and basic->premium (#1870)
* Rename core->free and basic->premium

* Fix lint js

* Comment out portion of test that seems to timeout

* Rename tier  to premium if basic is still loaded
2021-09-03 13:05:23 -03:00
Martin Angers
d1a0ea3881
Reintroduce conversion required for Windows (#1868) 2021-08-31 09:24:28 -04:00
Tomas Touceda
d6d53acda5
Issue 1600 fleetctl license expiration (#1800)
* Show banner in fleet and fleetctl if license expired

* Ignore if license is nil or tier is core

* Address review comments
2021-08-26 10:28:53 -03:00
Martin Angers
e61cb7e0db
Configure golangci-lint for the whole repository
Add a relatively minimal set of linters that raise safe and 
mostly un-opinionated issues with the code. It runs 
automatically on CI via a github action.
2021-08-24 13:35:03 -04:00
Martin Angers
a3714d2ed9
Add fleetctl debug connection command (#1706)
Adds the `fleetctl debug connection` command to investigate
connection issues to the fleet server.

Closes #1579 .
2021-08-24 08:50:03 -04:00
Zach Wasserman
cd2c881ae9
Add location of licensing credentials (#1765) 2021-08-23 09:53:18 -07:00
Tomas Touceda
989e638cc0
Make creating dirs and files more secure by checking permissions (#1566)
* Add safe mkdirall and open

* Use secure as much as possible and merge gomodules for orbit to fleet

* Improve openfile and mkdirall to check for permissiveness instead of equality

* Don't shift

* Fix links

* Address review comments
2021-08-11 11:02:22 -03:00
Zach Wasserman
e8652dfc42
Improve handling of empty passphrase and initialized updates repo (#1538)
- Prevent usage of initialized keys.
- Reject empty passphrase.
- Add testing for updates commands.
2021-08-09 10:31:04 -07:00
Zach Wasserman
9db49a1128
Update JWT library to github.com/golang-jwt/jwt (#1568)
- The former repo has been migrated (see
  https://github.com/dgrijalva/jwt-go/issues/462).

- Dependabot alerted on a security issue in the old
  version (https://github.com/advisories/GHSA-w73w-5m7g-f7qc). This issue
  should not effect Fleet due to no use of `aud` claims.
2021-08-06 08:49:38 -07:00
Tomas Touceda
5859db36bb
Move logger up to the HTTP layer and make it generic (#1439)
* Add basic idea

* Implement the new logging strategy everywhere

* Remove unused const

* Add tests and fix error cases

* Fix logging in osquery service

* If there are extras, log info unless force debug

* Change to info

* Fix test

* Make logging context more chainable and force info for sessions
2021-08-02 19:06:27 -03:00
Tomas Touceda
8f854144c5
Return email as well in activities (#1466)
* Return email as well in activities

* Add team name
2021-07-23 17:00:26 -03:00
Tomas Touceda
29570bd860
Issue 1278 select leader (#1367)
* Add leader selection

* remove comment

* Address review comments

* Add changes file

* Simplify implementation

* Simplify further

* Whoops, removed a little too much
2021-07-19 15:08:41 -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
Zach Wasserman
c5280c0517
Add v4 suffix in go.mod (#1224) 2021-06-25 21:46:51 -07:00
Zach Wasserman
763e69bc81
Use global options as default for new teams (#1184)
When creating a new Team, copy the global options so that the Team is
not initialized with null options.
2021-06-23 17:32:31 -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
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
9876dbe6b6
Implement license loading and validation (#908)
- Load license from ES256 signed JWT key.
- Parse license claims into LicenseInfo struct.
- Update contribution documentation with sample license key.

Closes #816.
2021-05-31 11:35:15 -07:00
Zach Wasserman
7971209fed
Implement license key generation (#906)
Adds a Node script for generating JWT license keys.

See the included README.md for details on usage and implementation.
2021-05-30 19:36:12 -07:00
Zach Wasserman
83b7f79699
Stub out licensing API (#810)
- Add config option for license key.
- Define license details data structure.
- Include license details in app config API responses.

Currently any non-empty value for `--license_key` behaves as though the
installation is licensed for `basic`. If the license key is empty,
`core` is returned.

Still to come is the appropriate parsing for the license key.
2021-05-19 17:29:38 -07:00
Zach Wasserman
49c669a38f
Support .exe files in fleetctl updates command (#631)
Properly handle the .exe extension that is required on Windows for a
file to be executable.
2021-04-12 09:55:36 -07:00
Zach Wasserman
d621650b78
Initial implementation of agent update management (#516)
This PR contains the initial implementation of the fleetctl updates commands, along with documentation on using this to self-host an agent update server.

Co-authored-by: Noah Talerman <noahtal@umich.edu>
Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
2021-03-26 10:46:51 -07:00
Zach Wasserman
d091be79eb
Introduce ee directory and license (#460)
This is where paid features will live, separate from the MIT licensing of the open core.

Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
2021-03-12 15:20:50 -08:00