Commit Graph

446 Commits

Author SHA1 Message Date
Marcos Oviedo
424baf431b
Pusing pending CIS items (#11511)
This relates to #11312 

This completes the last 20 pending CIS policies [here
](https://docs.google.com/spreadsheets/d/1HZn7e4zpd5nfxY0MhSdX8MkGpdpxyLdSZjk0Auo1WaQ/edit#gid=1819959040)
2023-05-12 11:38:17 -03:00
RachelElysia
2523ae39aa
CIS - Windows - Fix CIS_bullet_18.9.85.1.1 (#11650) 2023-05-12 09:41:40 -04:00
gillespi314
a9584dc32f
Allow end user authentication during automatic MDM enrollment to be enabled on a per-team basis (#11566) 2023-05-10 15:22:08 -05:00
Martin Angers
70f18dda4a
Apply custom setup assistants (if present) when ingesting new devices (#11563) 2023-05-09 13:00:18 -04:00
Roberto Dip
33d788caed
add support for displaying EULA during ADE/DEP (#11532)
Related to #11350 and the sub-tasks for stuff that happens in setup
assistant: #11477 and #11479

This adds back-end and UI logic to show an EULA during DEP enrollment if
one was uploaded via the UI, if an EULA wasn't uploaded, we just proceed
to enroll the device right after authentication.


https://user-images.githubusercontent.com/4419992/236316655-282ee74a-5f79-4095-a950-82b77b80a5c0.mov
2023-05-05 14:36:13 -03:00
Sharon Katz
c3d960a036
start (#11503) 2023-05-05 12:19:20 -04:00
RachelElysia
bb3b788ce0
CIS - WIN10 - 18.9.81 to 18.9.83 (#11523) 2023-05-04 11:52:32 -04:00
Sharon Katz
a819a16fc4
17.8.1 (#11347)
Tested for Positive and Negative cases on my Win 10 Pro.
2023-05-04 10:44:26 -04:00
Martin Angers
b3993ebda4
Allow "not_before" timestamp for worker jobs, schedule more quickly (#11512) 2023-05-03 16:25:36 -04:00
RachelElysia
8389531e3b
CIS - WIN10 - 18.9.72 to 18.9.75 (#11510) 2023-05-03 14:45:20 -04:00
Roberto Dip
11356b2f15
add CRUD for EULA (#11274)
https://github.com/fleetdm/fleet/issues/10741
2023-05-02 10:09:33 -03:00
Roberto Dip
a23d208b1d
gate DEP enrollment behind SSO when configured (#11309)
#10739

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
2023-04-27 09:43:20 -03:00
gillespi314
003e208e4d
Update CLI flow to manage adding and deleting MDM bootstrap packages by applying config and team specs (#11349) 2023-04-26 16:09:21 -05:00
gillespi314
8df5f26bea
Add user activity logs for MDM bootstrap package endpoints (#11302) 2023-04-26 13:40:14 -05:00
Martin Angers
77855a5e1d
Add activities for macOS setup assistant. (#11310) 2023-04-26 10:37:03 -04:00
Artemis Tosini
eb8de78a62
Add Windows 10 CIS 18.9.66-67 (#11143)
This is all 6 queries referenced in #10361. I've tested all queries on
Windows 10 Pro.

- [x] Manual QA for all new/changed functionality
2023-04-25 13:04:38 -04:00
Martin Angers
582e85c876
Add support for the mdm.macos_setup.macos_setup_assistant key in fleetctl, API (#11296) 2023-04-25 09:36:01 -04:00
RachelElysia
1fb9eeec64
CIS - WIN10 18.9.11.3.x (#11289) 2023-04-25 08:53:22 -04:00
Roberto Dip
5c487890ca
add an endpoint to get an aggregate summary of bootstrap packages (#11156)
Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2023-04-22 10:23:38 -05:00
Zach Wasserman
cda88779c1
Add note about ee license in ee directory (#11252) 2023-04-21 14:55:38 -07:00
Roberto Dip
ddb5894709
remove unused logic specific to DEP+Okta+ROP (#11261)
In #10338 we introduced logic to gate DEP profiles behind Okta auth
using the ROP flow.

We're not going to use that, and instead we're going to gate profiles
behind SSO, which can be used from multiple providers and supports SSO
(the initial motivation behind the ROP flow was to create a local user
account.)

This removes some of the old code, which was never used in
production/documented for the public to use.

At the moment I'm leaving the `mdm_idp_accounts` table and related
methods untouched, as it's unclear yet if we're going to need a similar
auxiliar table, and I would rather deal with the migrations all at once.
2023-04-21 14:57:52 -03:00
RachelElysia
3d78751875
CIS - WIN10 18.9.11.2.x (#11254) 2023-04-20 15:54:53 -04:00
Sharon Katz
ab572553c6
CIS_WIN_19.1-6 (#10988) 2023-04-17 15:24:00 -04:00
RachelElysia
3bd1a77716
CIS - WIN10 - 18.9.47.13 - 18.9.48.x (#11170) 2023-04-17 15:07:33 -04:00
RachelElysia
627ae5bf23
CIS - WIN10 - 17.5.x (Unable to audit/query) (#11166) 2023-04-17 14:52:46 -04:00
Lucas Manuel Rodriguez
1ebfbb14eb
New gitops role (#10850)
#8593

This PR adds a new role `gitops` to Fleet.
MDM capabilities for the role coming on a separate PR. We need this
merged ASAP so that we can unblock the UI work for this.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- [X] Documented any permissions changes
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [x] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-04-12 16:11:04 -03:00
RachelElysia
3c177aa928
CIS - WIN10 - 18.9.10 to 18.9.11 (#11101) 2023-04-12 12:47:35 -04:00
Artemis Tosini
d1cf7e5a44
Add Windows 10 CIS 18.9.65.3.9-11 (#11067)
I've tested all queries on my system. I'm not quite sure if the cast is
necessary but it was common other queries so I used it. This adds the
queries referenced in #10360

- [x] Manual QA for all new/changed functionality
2023-04-11 16:39:29 -04:00
Zach Wasserman
8118bc77f1
Update fleetd chrome install instructions (#11150) 2023-04-11 12:34:36 -07:00
Artemis Tosini
62b4627f29
Add Windows 10 CIS 18.9.65.3.x (#11007)
This adds all queries referenced in #10359. Some are in the
non-completed since I couldn't test. The referenced UI path didn't exist
on the latest version if Wondows 10 and the ADMX is supposed to be built
in on recent version of Windows.

# Checklist for submitter
- [x] Manual QA for all new/changed functionality
2023-04-11 15:26:27 -04:00
Sharon Katz
e76adbecc8
CIS_WIN_18.5.9.2-BUG-FIX (#10955)
1. FIX for **18.5.9.2** - successfully tested for positive/negative
cases.

2. BUG in **18.5.11.3** and **18.5.11.4** - Registry keys do not appear.
Moved to **`NON-COMPLETED`**
2023-04-11 13:35:32 -04:00
Roberto Dip
a59b8a5096
various profile fixes (#11084)
### Related tickets

https://github.com/fleetdm/fleet/issues/10775
https://github.com/fleetdm/fleet/issues/10678
https://github.com/fleetdm/fleet/issues/11024
https://github.com/fleetdm/fleet/issues/11026

### What's happening

- Implemented the hashing mechanism defined by @mna in #10678, however
this mechanism is mainly relevant for batch profile updates via the CLI,
we can't leverage it when a host switches teams.
- Modified `BulkSetPendingMDMAppleHostProfiles` so when two profiles
with the same identifier are sheduled both for removal and update, the
function will now mark only the `install` as `pending` so it's picked by
the cron, and will `DELETE` the `remove` entry from the database so it's
not picked by the cron and never sent to the user.
- `GetHostMDMProfiles` and consequently the profiles returned in `GET
/api/_version_/fleet/hosts` return `host_mdm_apple_profiles.state =
NULL` as "Enforcing (pending", the distinction between `status =
'pending'` and `status IS NULL` is only useful for the cron, for users
both mean the same thing, and all our profile aggregations already
behave this way.
- Using the solution implemented by @gillespi314 in
https://github.com/fleetdm/fleet/pull/10998 we're now deleting the host
row from `host_disk_encryption_keys` if a host is moved from a team that
enforces disk encryption to a team that doesn't.


# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-04-08 23:23:36 -03:00
Roberto Dip
77e5c004f4
implement bootstrap packages during DEP enrollment (#11052)
#10213
2023-04-07 17:31:02 -03:00
Marcos Oviedo
a576668cad
Pushing CIS policies from 18.9.103.1 to 18.9.105.2.1 (#10759)
This relates to #10366
2023-04-06 17:53:16 -03:00
Marcos Oviedo
4419820707
Pushing CIS policies for bullets 18.9.108.x.x (#10742)
This relates to #10367
2023-04-06 17:27:20 -03:00
Marcos Oviedo
242716c905
Adding COLLATE NOCASE to address case insesitive registry behavior (#11011)
It relates to bugs found in #9922
2023-04-05 17:22:07 -03:00
Sharon Katz
cea358f53a
CIS WIN 18.2 (#10876)
18.2.1 - successfully Tested for negative and positive cases
18.2.2 - successfully Tested for negative and positive cases
18.2.3 - successfully Tested for negative and positive cases
18.2.4 - successfully Tested for negative and positive cases
18.2.5 - successfully Tested for negative and positive cases
18.2.6 - successfully Tested for negative and positive cases
2023-04-05 10:52:24 -04:00
Artemis Tosini
0b6313bd6b
CIS win10 18.9.46-47 (#10916)
Many of these queries reference registry keys that do not exist so I
moved them to the NON-COMPLETED file. However, all queries name in
#10355 are included in either the main or non completed file.

- [x] Manual QA for all new/changed functionality
2023-04-04 15:41:19 -04:00
Roberto Dip
77d63f12dd
fix TestGroupFromBytesWithWin10CISQueries (#10953)
Go tests are failing in main with:

```
=== RUN   TestGroupFromBytesWithWin10CISQueries
    spec_test.go:69:
        	Error Trace:	/Users/roperzh/fleet/pkg/spec/spec_test.go:69
        	Error:      	Received unexpected error:
        	            	failed to unmarshal spec item error converting YAML to JSON: yaml: line 20: mapping values are not allowed in this context:
        	            	apiVersion: v1
        	            	kind: policy
        	            	spec:
        	            	  name: CIS - Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'
        	            	  platforms: win10
        	            	  platform: windows
        	            	  description: |
        	            	    This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects.
        	            	    For scheduler jobs, the following are audited:
        	            	      -  Job created.
        	            	      -  Job deleted.
        	            	      -  Job enabled.
        	            	      -  Job disabled.
        	            	      -  Job updated.
        	            	    For COM+ objects, the following are audited:
        	            	      -  Catalog object added.
        	            	      -  Catalog object updated.
        	            	      -  Catalog object deleted.
        	            	The recommended state for this setting is: Success and Failure.
        	            	  resolution: |
        	            	    Automatic method:
        	            	    Ask your system administrator to establish the recommended configuration via GP, set the following UI path to Success and Failure:
        	            	    'Computer Configuration\Policies\Windows Settings\Security Settings\Advanced Audit Policy Configuration\Audit Policies\Object Access\Audit Other Object Access Events'
        	            	  query: |
        	            	    SELECT 1 FROM mdm_bridge where mdm_command_input = "<SyncBody><Get><CmdID>1</CmdID><Item><Target><LocURI>./Device/Vendor/MSFT/Policy/Result/Audit/ObjectAccess_AuditOtherObjectAccessEvents</LocURI></Target></Item></Get></SyncBody>"
        	            	    AND mdm_command_output = 3;
        	            	  purpose: Informational
        	            	  tags: compliance, CIS, CIS_Level1, CIS_win10_enterprise_1.12.0, CIS_bullet_17.6.3
        	            	  contributors: sharon-fdm
        	Test:       	TestGroupFromBytesWithWin10CISQueries
--- FAIL: TestGroupFromBytesWithWin10CISQueries (0.31s)
```

This adds a missing indentation to make them pass.
2023-04-04 08:39:35 -03:00
gillespi314
750d64ccca
Add dontAllowFDEDisable to FileVault config profile template (#10941) 2023-04-03 14:22:41 -05:00
Sharon Katz
992a68c435
WIN CIS 17.6.1 (#10912) 2023-04-03 15:09:26 -04:00
Sharon Katz
ba290ffbb7
move-18.9.47.9.4-to-not-completed (#10938)
18.9.47.9.4 needs to be tested then moved back to the main .yml
2023-04-03 15:06:59 -04:00
Sharon Katz
f42ea50cff
18.9.57.1 (#10861) 2023-03-30 13:31:55 -04:00
Sharon Katz
5f42f39019
CIS_WIN_18.9.47.9.x (#10791) 2023-03-29 16:10:15 -04:00
RachelElysia
a21c96330b
CIS - WIN10 - 19.7.28 to 19.7.47 (#10781) 2023-03-29 12:53:55 -04:00
Lucas Manuel Rodriguez
22774243e2
Delete cis-policy-query-verify-iCloud-Keychain-disabled.yml (#10851)
We already have 2.1.1.1 with the `enable`/`disable` approach in the main
yaml.
2023-03-29 13:29:10 -03:00
Artemis Tosini
1e976f0d25
Add Windows 10 CIS 17.1-17.3 queries (#10522)
These 6 queries are extremely similar so I just put them in a single
commit. These issues are tracked in #10139.
2023-03-29 11:01:05 -04:00
Sharon Katz
d54e354022
CIS MAC 1.1 fix (#10619) 2023-03-29 09:24:33 -04:00
Juan Fernandez
aecc2fed75
Feature 9834: Add published date to vulnerability object (#10434)
This only applies to Premium users, we want to show the vulnerabilities' published date anywhere vulnerabilities are shown including API endpoints and third party integrations.
2023-03-28 16:11:31 -04:00
Lucas Manuel Rodriguez
40265d0e6f
Fix SMTP e-mail send when SMTP server has credentials (#10758)
#9609

This PR also fixes #10777.

The issue is: We were using `svc.AppConfig` instead of
`svc.ds.AppConfig` to retrieve the SMTP credentials.
`svc.AppConfig` obfuscates credentials, whereas `svc.ds.AppConfig` does
not.
To help prevent this from happening again I've renamed `svc.AppConfig`
to `svc.AppConfigObfuscated`.
I've also added a new test SMTP server
(https://github.com/axllent/mailpit) that supports Basic Authentication
and tests that make use of it to catch these kind of bugs (the tests are
executed when running `go test` with `MAIL_TEST=1`).

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-28 15:23:15 -03:00
Artemis Tosini
1d2ae58d5f
Add macOS CIS 5.3.2 (#10726)
Add 2 new tables: corestorage_logical_volumes and corestorage_logical_volume_families.
Add a query that uses these tables
2023-03-28 11:57:38 -04:00
Roberto Dip
98845f03a6
remove feature flags to enable MDM (#10746)
https://github.com/fleetdm/fleet/issues/10025
2023-03-27 16:30:29 -03:00
Martin Angers
b6e10eb6da
Update host MDM profile status to pending in response to triggering events (#10443) 2023-03-27 14:43:01 -04:00
Marcos Oviedo
518cbecfbf
cis18.9.100.x to cis18.9.102.x (#10717)
This relates to #10365
2023-03-23 17:54:16 -03:00
RachelElysia
ee116d14ca
CIS - WIN10 - 19.7.4 to 19.7.8 (#10715)
## Issue 
Cerra #10369

## Description
- Lots of trial and error to get the wild card to work (only works with
single \ in the path)
- 6 of 7 tested and working
- Final policy is intended for Windows 11
2023-03-23 17:08:00 -03:00
RachelElysia
1256d1d4b6
CIS - WIN10 - 18.4.1 - 18.4.13 (#10707) 2023-03-23 11:34:48 -04:00
Martin Angers
2fb5aa629d
Normalize the naming of mdm settings, update docs and document missing ones (#10681)
#10408
2023-03-23 07:30:28 -03:00
Josh Brower
c83bc3dd68
CIS WIN10 - 18.5.4.1 - 18.2.11.4 (#10686) 2023-03-22 16:39:10 -04:00
RachelElysia
01e5742d60
CIS - WIN10 - 18.9.89 to 18.9.91 (#10641) 2023-03-21 14:23:00 -04:00
RachelElysia
45bc73be3c
CIS - WIN10 - 18.9.18 to 18.9.27 (#10633) 2023-03-21 11:25:24 -04:00
RachelElysia
c82026e930
CIS - WiN10 - 18.9.31 to 18.9.45 (#10632) 2023-03-21 09:51:26 -04:00
RachelElysia
f6741a43ec
CIS - WIN10 - 18.3.X policies (#10336) 2023-03-20 16:40:04 -04:00
Roberto Dip
61a8a80514
allow to rotate disk encryption key from My Device (#10592)
Related to https://github.com/fleetdm/fleet/issues/8961

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2023-03-20 16:14:07 -03:00
Sharon Katz
535ea715a4
Reformat MAC CIS 6.3.5 queries (#10560) 2023-03-20 11:50:35 -04:00
RachelElysia
95fb828a03
CIS - WIN10 - 18.8.17 - 18.8.27 (#10430) 2023-03-20 09:41:11 -04:00
Roberto Dip
f04ff27180
Prevent user action in profiles managed by Fleet (#10559)
related to https://github.com/fleetdm/fleet/issues/10547,
https://github.com/fleetdm/fleet/issues/10549,
https://github.com/fleetdm/fleet/issues/10550 and
https://github.com/fleetdm/fleet/issues/10552 this prevents user
interaction with fleet-managed profiles, including:

- batch actions
- individual POST/UPDATE/DELETE actions
- listing

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] Added/updated tests
2023-03-17 18:52:30 -03:00
RachelElysia
0614a8543f
CIS - WIN10 - 18.9.17.x (#10529) 2023-03-17 14:53:41 -04:00
RachelElysia
5af7aaf12a
CIS - WIN10 - 18.8.38+ (#10449) 2023-03-17 11:41:19 -04:00
Zach Wasserman
42b3e5602e
Fleetd for Chrome (#10281)
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2023-03-16 09:01:10 -03:00
Zach Wasserman
05d8f5dbbd
Fix indentation typo in CIS yaml (#10525)
Caused a failure in
b7ebddcd66/pkg/spec/spec_test.go (L64)
2023-03-15 17:05:31 -07:00
Sharon Katz
58b8d65b6f
MAC CIS 13 2.5.1 (#10168) 2023-03-15 16:40:54 -04:00
RachelElysia
b49c6c82c3
CIS - WIN10 - Move approved policies to correct file (#10509) 2023-03-15 11:33:30 -04:00
RachelElysia
3a170a8df0
CIS - WIN10 - 18.8.28 to 18.8.37 (#10452) 2023-03-15 09:28:54 -04:00
Lucas Manuel Rodriguez
d09252e1ea
Fix YAML and add item to error (#10503) 2023-03-15 08:50:13 -03:00
Martin Angers
276c767ab9
Update aggregated_stats to support "no team" in addition to "all teams" (#10466) 2023-03-14 17:01:16 -04:00
RachelElysia
7fe196304c
CIS - WIN10 - 18.9.12 to 18.9.16 (#10465) 2023-03-14 16:36:34 -04:00
Lucas Manuel Rodriguez
6d918d1366
Add enable_jit_role_sync config (#10478)
#8411

We decided to only update roles for existing accounts if enabled by a
new setting (disabled by default) `sso_settings.enable_jit_role_sync`.

- ~[ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.~
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-14 17:17:08 -03:00
Sharon Katz
c4fa0393af
Audit Location Services Access (#10459)
Tested on my Mac
2023-03-14 12:53:32 -04:00
Marcos Oviedo
a8282864e3
CIS 18.9.4.x to cis 18.9.8.x (#10451)
This relates to #10347
2023-03-13 17:19:21 -03:00
Artemis Tosini
924206982b
Fix indentation issue in macOS 13 CIS (#10448) 2023-03-13 14:19:48 -04:00
Lucas Manuel Rodriguez
3757aace08
Add UUID to Fleet errors and clean up error msgs (#10411)
#8129 

Apart from fixing the issue in #8129, this change also introduces UUIDs
to Fleet errors. To be able to match a returned error from the API to a
error in the Fleet logs. See
https://fleetdm.slack.com/archives/C019WG4GH0A/p1677780622769939 for
more context.

Samples with the changes in this PR:
```
curl -k -H "Authorization: Bearer $TEST_TOKEN" -H 'Content-Type:application/json' "https://localhost:8080/api/v1/fleet/sso" -d ''
{
  "message": "Bad request",
  "errors": [
    {
      "name": "base",
      "reason": "Expected JSON Body"
    }
  ],
  "uuid": "a01f6e10-354c-4ff0-b96e-1f64adb500b0"
}
```
```
curl -k -H "Authorization: Bearer $TEST_TOKEN" -H 'Content-Type:application/json' "https://localhost:8080/api/v1/fleet/sso" -d 'asd'
{
  "message": "Bad request",
  "errors": [
    {
      "name": "base",
      "reason": "json decoder error"
    }
  ],
  "uuid": "5f716a64-7550-464b-a1dd-e6a505a9f89d"
}
```
```
curl -k -X GET -H "Authorization: Bearer badtoken" "https://localhost:8080/api/latest/fleet/teams"
{
  "message": "Authentication required",
  "errors": [
    {
      "name": "base",
      "reason": "Authentication required"
    }
  ],
  "uuid": "efe45bc0-f956-4bf9-ba4f-aa9020a9aaaf"
}
```
```
curl -k -X PATCH -H "Authorization: Bearer $TEST_TOKEN" "https://localhost:8080/api/latest/fleet/users/14" -d '{"name": "Manuel2", "password": "what", "new_password": "p4ssw0rd.12345"}'
{
  "message": "Authorization header required",
  "errors": [
    {
      "name": "base",
      "reason": "Authorization header required"
    }
  ],
  "uuid": "57f78cd0-4559-464f-9df7-36c9ef7c89b3"
}
```
```
curl -k -X PATCH -H "Authorization: Bearer $TEST_TOKEN" "https://localhost:8080/api/latest/fleet/users/14" -d '{"name": "Manuel2", "password": "what", "new_password": "p4ssw0rd.12345"}'
{
  "message": "Permission Denied",
  "uuid": "7f0220ad-6de7-4faf-8b6c-8d7ff9d2ca06"
}
```

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [X] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-13 13:44:06 -03:00
Artemis Tosini
ec746374d3
Add macOS CIS 6.3.5 (Safari Hide IP Addresses) (#10316)
This adds two conflicting checks for macOS CIS 6.3.5. Proxying requests
to 3rd party trackers may protect private information but it may also be
against company policy as it routes data throught a 3rd party service.

There's no documentation about now to set this through a policy or
script, and in fact I can find no information about what this bitfield
means, except the incorrect and conflicting documentation in the CIS
pdf.

Co-authored-by: Sharon Katz <sharon@fleetdm.com>
2023-03-13 12:24:00 -04:00
Marcos Oviedo
9cb2ef14ff
CIS 5.23 to CIS 5.45 (#10410)
This relates to #9926
2023-03-13 10:49:33 -03:00
Roberto Dip
a1ca172c95
allow to set up a DEP flow gated by Okta auth (#10338)
#10271
2023-03-13 10:33:32 -03:00
RachelElysia
f97b13d8c0
CIS - WIN10 - 18.8.1. - 18.8.16 (#10407) 2023-03-13 09:25:04 -04:00
Roberto Dip
bf776536ca
add PoC for puppet + fleet MDM (#10424) 2023-03-10 16:06:40 -06:00
RachelElysia
3ee113911c
CIS - WIN10 - 18.6.x and 18.7.x policies (#10344) 2023-03-10 14:29:26 -05:00
Artemis Tosini
af4c3f7061
Add macOS CIS 5.3.1 (#10397)
This adds a new check about whether all APFS volumes are encrypted. I
needed to add a new table, and I took that opportunity to add another so
that osquery has all information from `diskutil apfs list -plist`.

Note that it is somewhat unclear whether to use the `encryption` or
`filevault` field in the query. FileVault is about whether the volume is
encrypted with a password and Encryption is about whether it is
encrypted at all, since all modern macs have hardware-backed disk
encryption.
2023-03-10 12:29:14 -05:00
Sharon Katz
8c04711f60
add minimumMixedCaseCharacters (#10401) 2023-03-09 15:44:28 -05:00
Marcos Oviedo
469ce0f841
Fixing CIS testcases (#10296)
This relates to #9848
2023-03-09 11:33:20 -03:00
Sharon Katz
312ad09e6d
Separate YMLs (#10386) 2023-03-08 13:55:55 -05:00
Sharon Katz
eae7ca23fa
empty non-complited yml (#10389) 2023-03-08 13:46:23 -05:00
Martin Angers
765c8754b6
Add enabled/disabled disk encryption activities and trigger profiles generation (#10319) 2023-03-08 08:31:53 -05:00
Josh Brower
4316fe945f
Initial cut for CIS 9.1.x (#10307) 2023-03-07 17:30:12 -05:00
Martin Angers
50a2739609
Allow updating enable_disk_encryption via the Modify Team endpoint (#10208) 2023-03-06 09:54:51 -05:00
Artemis Tosini
07a045301b
Add macOS CIS 2.6.7 (Administrator password for preferences) (#10259)
This adds a test for if passwords are required are required to access
some system-wide preferences on macOS. It's marked as "Manual" in the
CIS pdf but I wasn't sure how to copy that into here.
2023-03-03 15:41:51 -05:00
Sharon Katz
cf18f1f79f
CIS_MAC13_5.2.5 (#10251) 2023-03-03 15:14:00 -05:00
Sharon Katz
2295575fdb
CIS_MAC13_2.8.1 (#10192) 2023-03-03 15:12:23 -05:00
Marcos Oviedo
a2e8a787c9
Pushing CIS policies check for 2.2.8 to 2.2.39 (#10283)
This relates to #9848
2023-03-03 17:05:07 -03:00
Marcos Oviedo
aafc59bd7e
CIS policies for 2.3.14.x-2.3.15.x (#10211)
This relates to #9923
2023-03-03 16:56:11 -03:00
Marcos Oviedo
83fb9d312c
CIS policies for 2.3.11.x (#10167)
This relates to #9851
2023-03-03 16:42:22 -03:00
Sharon Katz
0867679eeb
CIS_MAC13_6.3.2 (#10258) 2023-03-03 14:15:03 -05:00
Lucas Manuel Rodriguez
e0cbc3aad7
Add automation for win-10 cis policies and fix yaml (#10289) 2023-03-03 16:11:04 -03:00
Sharon Katz
1741c4ddd3
CIS_MAC13_5.2.3_5.2.4 (#10248) 2023-03-03 14:06:15 -05:00
Marcos Oviedo
f7c1cc0c87
Pushing changes for cis2.3.8 to cis2.3.9 compliance checks (#10115)
This relates to #9851
2023-03-03 15:49:53 -03:00
RachelElysia
db9ed90b0c
CIS - WIN10 - 9.3.X policies (#10253) 2023-03-03 13:37:03 -05:00
RachelElysia
82e81a7b06
CIS - WIN10 - 9.2.X policies (#10254) 2023-03-03 13:13:09 -05:00
RachelElysia
0b4ae4f621
CIS - WIN10 - 18.X.X policies (#10286) 2023-03-03 12:52:18 -05:00
Artemis Tosini
1dcced4554
Add Windows 10 CIS 2.3.6.x (#10036)
This adds CIS 2.3.6.x items from Windows 10 Enterprise. I tested all of
these on Windows Server 2019 as my Windows 10 machine hasn't arrived
yet, but they should be identical.

I originally thought this was not possible but I did not realize that
the GPO always seems to change the registry key and does not act as the
single source of truth, unlike profiles on macOS.
2023-03-03 10:47:10 -05:00
Benjamin Edwards
1fb1870ca7
add tier trial that behaves the same as premium (#10157) 2023-03-03 10:46:50 -05:00
RachelElysia
6b2cebd4f1
CIS - WIN10 - 2.3.17.X (#10275) 2023-03-02 17:18:02 -05:00
Sharon Katz
8c9d33f455
MAC CIS 13_2.1.1.2 (#10161) 2023-03-02 10:04:27 -05:00
Sharon Katz
a19d73511e
MAC CIS 13_2.1.1.1 (#10120) 2023-03-02 09:54:37 -05:00
Lucas Manuel Rodriguez
9864048ee9
Allow setting user roles during JIT provisioning (#10193)
#8411

PS: I've opened #10209 to solve the issue with Golang Code Coverage CI
checks.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- ~[] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [x] Manual QA for all new/changed functionality
  - ~For Orbit and Fleet Desktop changes:~
- ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.~
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-03-01 20:18:40 -03:00
RachelElysia
4c80e1808b
CIS - WIN10 - 2.3.10.X policies (#10178) 2023-03-01 10:28:45 -05:00
Roberto Dip
164bb4bf5c
add logic to configure FileVault + escrow (#10160)
Related to #9495, this adds the underlying methods to send a
configuration profile that enables FileVault and FileVault Escrow, so we
can fetch and decrypt the encryption key later on.

These methods still need to be called somewhere, and they might need to
be moved outside of `Service`, but at least this gives us a start.
2023-03-01 10:43:15 -03:00
Martin Angers
4593c49ec4
Add disk_encryption option to config and team YAML (#10185) 2023-02-28 15:34:46 -05:00
dependabot[bot]
5f95975a05
Bump jsonwebtoken from 8.5.1 to 9.0.0 in /ee/tools/license (#9109)
Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) from
8.5.1 to 9.0.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md">jsonwebtoken's
changelog</a>.</em></p>
<blockquote>
<h2>9.0.0 - 2022-12-21</h2>
<p><strong>Breaking changes: See <a
href="https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v8-to-v9">Migration
from v8 to v9</a></strong></p>
<h3>Breaking changes</h3>
<ul>
<li>Removed support for Node versions 11 and below.</li>
<li>The verify() function no longer accepts unsigned tokens by default.
([834503079514b72264fd13023a3b8d648afd6a16]<a
href="8345030795</a>)</li>
<li>RSA key size must be 2048 bits or greater.
([ecdf6cc6073ea13a7e71df5fad043550f08d0fa6]<a
href="ecdf6cc607</a>)</li>
<li>Key types must be valid for the signing / verification
algorithm</li>
</ul>
<h3>Security fixes</h3>
<ul>
<li>security: fixes <code>Arbitrary File Write via verify
function</code> - CVE-2022-23529</li>
<li>security: fixes <code>Insecure default algorithm in jwt.verify()
could lead to signature validation bypass</code> - CVE-2022-23540</li>
<li>security: fixes <code>Insecure implementation of key retrieval
function could lead to Forgeable Public/Private Tokens from RSA to
HMAC</code> - CVE-2022-23541</li>
<li>security: fixes <code>Unrestricted key type could lead to legacy
keys usage</code> - CVE-2022-23539</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e1fa9dcc12"><code>e1fa9dc</code></a>
Merge pull request from GHSA-8cf7-32gw-wr33</li>
<li><a
href="5eaedbf2b0"><code>5eaedbf</code></a>
chore(ci): remove github test actions job (<a
href="https://github-redirect.dependabot.com/auth0/node-jsonwebtoken/issues/861">#861</a>)</li>
<li><a
href="cd4163eb14"><code>cd4163e</code></a>
chore(ci): configure Github Actions jobs for Tests &amp; Security
Scanning (<a
href="https://github-redirect.dependabot.com/auth0/node-jsonwebtoken/issues/856">#856</a>)</li>
<li><a
href="ecdf6cc607"><code>ecdf6cc</code></a>
fix!: Prevent accidental use of insecure key sizes &amp;
misconfiguration of secr...</li>
<li><a
href="8345030795"><code>8345030</code></a>
fix(sign&amp;verify)!: Remove default <code>none</code> support from
<code>sign</code> and <code>verify</code> met...</li>
<li><a
href="7e6a86b1c2"><code>7e6a86b</code></a>
Upload OpsLevel YAML (<a
href="https://github-redirect.dependabot.com/auth0/node-jsonwebtoken/issues/849">#849</a>)</li>
<li><a
href="74d5719bd0"><code>74d5719</code></a>
docs: update references vercel/ms references (<a
href="https://github-redirect.dependabot.com/auth0/node-jsonwebtoken/issues/770">#770</a>)</li>
<li><a
href="d71e383862"><code>d71e383</code></a>
docs: document &quot;invalid token&quot; error</li>
<li><a
href="37650031fd"><code>3765003</code></a>
docs: fix spelling in README.md: Peak -&gt; Peek (<a
href="https://github-redirect.dependabot.com/auth0/node-jsonwebtoken/issues/754">#754</a>)</li>
<li><a
href="a46097e962"><code>a46097e</code></a>
docs: make decode impossible to discover before verify</li>
<li>Additional commits viewable in <a
href="https://github.com/auth0/node-jsonwebtoken/compare/v8.5.1...v9.0.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~julien.wollscheid">julien.wollscheid</a>, a
new releaser for jsonwebtoken since your current version.</p>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jsonwebtoken&package-manager=npm_and_yarn&previous-version=8.5.1&new-version=9.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/fleetdm/fleet/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 18:23:18 -08:00
Sharon Katz
5603190d6a
CIS Win10 1.2.1-1.2.3 + 2.2.1-2.2.7 (Some empty queries) (#9839) 2023-02-24 09:20:27 -05:00
Marcos Oviedo
7e95c52213
Pushing CIS policy checks for 2.3.1.x to 2.3.7.x (#9902)
This relates to #9850
2023-02-23 14:04:23 -03:00
Lucas Manuel Rodriguez
f4df9b58a4
Add docs for cis benchmarks macOS 13 (#9987)
See #9974.

---------

Co-authored-by: Mo Zhu <mo@fleetdm.com>
2023-02-22 18:07:36 -03:00
Roberto Dip
8284274c3b
incomplete implementation of device wipe and lock (#9947) 2023-02-22 17:11:44 -03:00
Martin Angers
4a1f3988f0
Add "edited macos profiles" activity when applying custom settings via fleetctl (#9862)
#9587 and #9639
2023-02-16 13:53:26 -03:00
Martin Angers
33f33163a9
Add macos custom profiles support via fleetctl apply (#9824) 2023-02-15 13:01:44 -05:00
Sharon Katz
4c22fbffd6
rename cis label to win10-stand-alone (#9816) 2023-02-14 14:52:15 -05:00
Sharon Katz
9125263c14
add details to CIS label (#9811) 2023-02-14 10:05:44 -05:00
Sharon Katz
0ddd0d64f7
CIS_fix_desc_errors (#9789) 2023-02-10 12:48:44 -05:00
Artemis Tosini
d36e89a0ef
Add macOS CIS 6.3.3 (Safari Safe Browsing) (#9778) 2023-02-09 13:46:42 -05:00
Lucas Manuel Rodriguez
4a5ce51d49
CIS yaml fixes (#9775) 2023-02-09 15:28:47 -03:00
Sharon Katz
1fc799577d
CIS 6.4.1 (#9773) 2023-02-09 13:22:36 -05:00
Sharon Katz
c7827cf5b1
CIS 6.3.7 (#9767) 2023-02-09 13:15:21 -05:00
Artemis Tosini
6b50914500
Add macOS CIS 2.3.3.10 (Media Sharing) (#9666) 2023-02-09 12:55:22 -05:00
Lucas Manuel Rodriguez
9fa2be0a86
Add check for CIS 5.10 (#9755)
#9260

- ~[ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.~
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- ~[ ] Added/updated tests~
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-09 14:28:22 -03:00
Lucas Manuel Rodriguez
399a6f53e7
Add check for CIS 6.3.4 (#9766)
#9261
2023-02-09 14:28:02 -03:00
Lucas Manuel Rodriguez
4638e8564f
Add check for CIS 5.6 (#9756)
#9260

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-09 14:27:40 -03:00
Lucas Manuel Rodriguez
8af2b56cd5
Add check for macOS CIS 5.9 (#9765)
#9260

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- ~[ ] Added/updated tests~
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-09 14:05:55 -03:00
Artemis Tosini
a92b311030
Add macOS CIS 6.3.1 (Safari Automatic Opening) (#9759) 2023-02-09 11:41:18 -05:00
Artemis Tosini
6d82515b02
Add macOS CIS 2.3.3.8 (Internet Sharing) (#9663) 2023-02-09 11:15:40 -05:00
Lucas Manuel Rodriguez
c6e1447084
Add check for CIS 6.3.6 (#9768)
#9261
2023-02-09 12:36:40 -03:00
Lucas Manuel Rodriguez
7fc3613dc5
Add CIS checks for 5.4 and 5.5 (#9747)
#9260

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-09 12:35:43 -03:00
Sharon Katz
c248968ba3
CIS 2.3.3.9 (#9752) 2023-02-08 15:43:03 -05:00
Artemis Tosini
9fd70ee9e0
Add macOS CIS 2.3.3.7 (Remote Apple Events) (#9751) 2023-02-08 14:13:11 -05:00
Lucas Manuel Rodriguez
2265c84b2a
Add CIS check for 5.8 (#9750)
#9260

- ~[ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.~
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- ~[ ] Added/updated tests~
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-08 13:38:17 -03:00
Lucas Manuel Rodriguez
d4a1b4d218
Add CIS checks for 2.9.X and add pmset table to fleetd (#9470)
#9253

- ~[ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.~
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~

---------

Co-authored-by: Sharon Katz <121527325+sharon-fdm@users.noreply.github.com>
2023-02-08 13:08:17 -03:00
Artemis Tosini
b6968892b0
Add macOS CIS 6.1.1 (Show All Filename Extensions) (#9740)
This adds CIS 6.1.1
---------
Co-authored-by: Sharon Katz <sharon@fleetdm.com>
Approved by: Sharon Katz <sharon@fleetdm.com>
2023-02-08 10:51:42 -05:00
Lucas Manuel Rodriguez
086ec05ca7
Add CIS check for 5.7 (#9748)
#9260

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
2023-02-08 12:30:55 -03:00
Sharon Katz
9672f03d37
CIS 5.1.5/5.1.6/5.1.7 (#9726) 2023-02-08 10:11:20 -05:00
Sharon Katz
84fcee9130
CIS 5.1.3+5.1.4 (#9642) 2023-02-07 13:26:05 -05:00
Artemis Tosini
61da4d3331
Add macOS CIS 2.3.3.4 (Printer Sharing) (#9665)
This makes sure printer sharing is disabled on macOS using the CUPS
configuration file. This script makes a change that both works and is
reflected in the macOS UI, unlike many of the scripts
2023-02-06 17:12:17 -05:00
Artemis Tosini
857e6830d8
Add macOS CIS 2.3.3.11 (Bluetooth Sharing) (#9688)
This adds a test for 2.3.3.11, which verifies that all users have
Bluetooth sharing disabled.

It's not possible to create a profile and it's challenging to write a
script, so testing must be done manually.
As with all sharing tests, the machine will be compliant out of the box.
For QA you should open the sharing preference pane (System Settings >
General > Sharing) and then enable Bluetooth sharing and this test
should fail. Switching bluetooth sharing back off will fix it.
2023-02-06 15:29:47 -05:00
Artemis Tosini
21428cb6a6
Add the first queries of CIS 2.3.3 looking at launchd overrides (#9619)
This adds all the CIS 2.3.3.x queries that are nearly identical and
based on launch agent overrides
2023-02-06 15:27:42 -05:00
Artemis Tosini
985c051ebb
Add macOS CIS 2.3.3.6 (Remote Management) (#9664)
I can't find any way of adding a policy to remove ARD but this uses an
officially documented script to disable it which works on my mac.
2023-02-06 13:13:38 -05:00
Sharon Katz
7aefd5c73b
Cis 3.4 (#9554) 2023-02-06 13:13:11 -05:00
Marcos Oviedo
18592d17ad
Adding CIS checks for for Win10 benchmark - Password policies 1.1.x (#9634)
This relates to #9581
2023-02-03 14:11:22 -03:00
Sharon Katz
aae824804b
Cis 3.3 (#9578) 2023-02-02 13:16:45 -05:00
Sharon Katz
d33b8e6e05
CIS 3.5 (#9592) 2023-02-02 13:13:20 -05:00
Sharon Katz
16d7091600
CIS_3.2 (#9522) 2023-02-02 13:08:02 -05:00
Sharon Katz
647c15a909
CIS 5.1.1 (#9617) 2023-02-02 12:50:01 -05:00
Sharon Katz
2957ea9bf4
CIS 5.1.2 (#9623) 2023-02-02 10:22:22 -05:00
Sharon Katz
b60f063e09
CIS 3.6 (#9582) 2023-02-01 17:35:50 -05:00
Martin Angers
c805ea2154
Record activity when the macos minimum version requirement is edited (#9594) 2023-01-31 16:36:18 -06:00
Roberto Dip
4c4c114e96
add mocks + tests and move things around (#9574)
#8948

- Add more go:generate commands for MDM mocks
- Add unit and integration tests for MDM code
- Move interfaces from their PoC location to match existing patterns
2023-01-31 11:46:01 -03:00
Zach Wasserman
7531ac20db
Use stricter file permissions in fleetctl updates add (#9516)
This resolves an issue with adding updates on a macOS 13 machine. It
seems like macOS may have changed the default directory permissions and
these new stricter permissions are compatible with that default.

This is the error that was encountered before these changes:

```
Error: create dst dir for copy: Path staged/targets already exists with
mode 20000000700 instead of the expected 20000000755
```

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Manual QA for all new/changed functionality
2023-01-30 17:28:56 -08:00
Sharon Katz
ed314592c3
CIS 5.2 fixes (#9549) 2023-01-30 12:52:33 -05:00
Lucas Manuel Rodriguez
bfe27475c1
Fix cis yaml (#9531)
The PR fixes the broken yaml in main and adds checks so that it doesn't
happen again.
2023-01-27 14:58:00 -03:00
Sharon Katz
218f10eefe
Cis 2.12.2 (#9525) 2023-01-27 11:16:41 -05:00
Sharon Katz
aa513e722c
CIS 3.1 (#9510) 2023-01-26 16:53:58 -05:00
Sharon Katz
3aa2a607e7
CIS 5.2.x queries (#9501) 2023-01-26 16:22:21 -05:00
Lucas Manuel Rodriguez
91c93285d8
Add WIP macOS 13 CIS policy queries (#9497)
#9429
2023-01-25 16:15:12 -03:00
Roberto Dip
2d25a3f48d
add mdm root key and macos_updates to app and team configs (#9442)
Related to https://github.com/fleetdm/fleet/issues/9345,
https://github.com/fleetdm/fleet/issues/9358 and
https://github.com/fleetdm/fleet/issues/9346 this adds:

1. The ability to configure `mdm.macos_updates` via `PATCH /config` and
`PATCH /teams/{id}`
3. The ability to configure `mdm.macos_updates` by using `fleetctl apply
-f` for teams and global config.
2023-01-24 13:20:02 -03:00
Martin Angers
656e5bfc70
Flag when the Apple BM terms have expired (#9091)
#8862 

Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
2023-01-06 17:44:20 -03:00
Zach Wasserman
d5e4a9a66f
Signing tool for MDM Push CSRs (#8884)
This PR provides the tooling that fleetdm.com will use to sign MDM Push
CSRs.

This was tested against the output of #8812, and the resulting requests
were validated to be accepted by Apple.

Co-authored-by: Roberto Dip <me@roperzh.com>
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2023-01-06 08:25:54 -08:00
Frank Sievertsen
91c90b4caa
Add new configuration option to set default team for Apple Business Manager (#9062) 2023-01-03 16:14:18 -06:00
Lucas Manuel Rodriguez
e1bbcfcfda
Generate audit logs for activities (#9001)
* Generate audit logs for activities

* Fix config tests

* Fix TestGetConfig/IncludeServerConfig

* Fix use of AddAttributes in results only

* Stream activities asynchronously

* Fix index and add logging

* Revert change

* Documentation fixes
2022-12-23 19:04:13 -03:00
Lucas Manuel Rodriguez
39f1029390
Make activities typed and auto-generate docs for each type (#9069)
* Make activities type and auto-generate docs for each type

* Add pageOrderInSection to not break site

* Add do not edit note to generated file

* Add make generate-doc step

* Fix main merge
2022-12-23 13:05:16 -03:00
Sharvil Shah
f1577de0ac
Orbit extensions autoupdate (#8906) 2022-12-21 01:00:55 +05:30
Martin Angers
f18a320bd5
Add command get mdm-apple-bm to fleetctl (#8949) 2022-12-12 15:45:53 -05:00
Martin Angers
472c8bafb3
Refactor license so it is stored in the context (#8544) 2022-11-15 09:08:05 -05:00
Martin Angers
8f21e026e3
Fix bug with fleetctl apply for teams, clear agent options only if key is present (#8508) 2022-11-01 15:22:45 -04:00
Martin Angers
fae8e4ca2c
Translate the AppConfig and Team validation messages to be more user-friendly (#8171) 2022-10-12 17:10:50 -04:00
Lucas Manuel Rodriguez
832b29f8c7
Update go-tuf to v0.5.0 (bis) (#8112)
* Update go-tuf to v0.5.0

This was triggered by the security advisory
[GHSA-3633-5h82-39pq](https://github.com/theupdateframework/go-tuf/security/advisories/GHSA-3633-5h82-39pq).
Fleet's use of go-tuf is not vulnerable to this issue due to not using
key thresholds greater than 1.

There were some API changes that necessitate changing the initialization
code for the TUF client. See
https://github.com/theupdateframework/go-tuf/issues/379 for further
discussion.

* Add changes file

* Update default root metadata

* Add review changes to update-go-tuf branch

* Update tests

* Add more checks to roots output

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2022-10-07 17:03:39 -03:00
Martin Angers
c23a15394e
Keep created_at timestamp of existing enroll secrets (#8062) 2022-10-05 08:35:36 -04:00
Roberto Dip
cd2ab6b17c
add server side validation for emails (#8022)
related to https://github.com/fleetdm/fleet/issues/7199, this adds email validation to the `verifyCreateShared` which is used for user creation in the server.

validation messages come directly from Go's `net/mail` package.

```
~/fleet $ curl 'https://localhost:8080/api/latest/fleet/users/admin' -X POST -H 'Authorization: Bearer $TOKEN' --data-raw '{"email":"asdf","name":"asdf@asd.com","password":"as;lkdfjasdlk;fja3234@","global_role":"observer","teams":[]}'
{
  "message": "Validation Failed",
  "errors": [
    {
      "name": "email",
      "reason": "mail: missing '@' or angle-addr"
    }
  ]
}
```
2022-10-03 13:29:01 -03:00
Martin Angers
478b4d3f69
Validate team and appconfig payloads, with dry-run and force modes (#7731) 2022-09-19 13:53:44 -04:00
Juan Fernandez
765031d962
Bug 6717: Duplicate calls on vulnerability third party integrations. (#7698)
If the same vulnerability was present in more than one software, then duplicated third party integration calls were being issued.
2022-09-13 10:41:52 -04:00
Juan Fernandez
b60d535d4a
Feature 7084: Add new EE endpoint for Fleet Desktop (#7530)
Added new EE endpoint, that is meant to be used by Fleet Desktop only. The new endpoint will return the number of failed policies.
2022-09-12 15:37:38 -04:00
Martin Angers
988f50fa34
Document all keys in config and team YAML documents (#7449)
- Add a new "Configuration for contributors" doc page. Move settings that are not recommended for production use
- Remove settings modified in the `config` YAML document from the deploying/configuration doc page
- Document all keys in `config` and `teams` YAML documents
- Add comments to several `.go` files and remove unused struct
2022-09-08 17:57:38 -04:00
Juan Fernandez
b6d084deec
Feature 7559: Include 3rd party severity scores in the vulnerability web-hook payload (#7581)
Premium users should receive vulnerability scores as part of the web-hook payload.
2022-09-06 15:12:17 -04:00
Roberto Dip
9dfd903c3a
set defaults for team spec configs related to features (#7476)
This adjusts functions related to applying team specs to make sure the `features` key works as expected, this is:

1. Create Team flow
    1. if no features are provided, we copy whatever features are set in the global config
    2. otherwise, we generate a new config merging whatever is provided with the defaults for new installs.
2. Edit Team flow: we always generate a new config merging whatever is provided with the defaults for new installs.
2022-08-31 17:30:46 -03:00
Roberto Dip
eeefe2fab9
enable controlled rollout of features by teams (#7408) 2022-08-30 08:13:09 -03:00
Martin Angers
dfd7d3f244
Add activity types for applied team spec and edited agent options (#7355) 2022-08-24 08:32:45 -04:00
Roberto Dip
05ddeade90
add back-end implementation for SSO JIT provisioning (#7182)
Related to #7053, this uses the SSO config added in #7140 to enable JIT provisioning for premium instances.
2022-08-15 14:42:33 -03:00
Martin Angers
c1d38598e2
Prevent removing team enroll secrets when applying team specs without new secrets (#6890) 2022-08-02 09:51:03 -04:00
Eng Zer Jun
1ab171faf3
test: use T.Setenv to set env vars in tests (#6714)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-07-18 14:22:28 -03:00
Martin Angers
7f9bb6431e
Update team integrations to reference global integrations (part of failing policies automation support) (#6156) 2022-06-13 10:04:47 -04:00
Roberto Dip
19f995d3b5
only include policies in device endpoints for premium users (#6077)
This removes policy information from `GET /api/_version_/fleet/device/{token}` from non-premium Fleet instances.

Starting the server with `./build/fleet serve --dev --dev_license`

```bash
$ curl -s https://localhost:8080/api/latest/fleet/device/1804e808-171f-4dda-9bec-f695b2f2371a | jq '.host.policies // "not present"'
[
  {
    "id": 3,
    "name": "Antivirus healthy (Linux)",
    "query": "SELECT score FROM (SELECT case when COUNT(*) = 2 then 1 ELSE 0 END AS score FROM processes WHERE (name = 'clamd') OR (name = 'freshclam')) WHERE score == 1;",
    "description": "Checks that both ClamAV's daemon and its updater service (freshclam) are running.",
    "author_id": 1,
    "author_name": "Roberto",
    "author_email": "test@example.com",
    "team_id": null,
    "resolution": "Ensure ClamAV and Freshclam are installed and running.",
    "platform": "darwin,linux",
    "created_at": "2022-05-23T20:53:36Z",
    "updated_at": "2022-06-03T13:17:42Z",
    "response": ""
  }
]
```

Starting the server with `./build/fleet serve --dev`

```bash
$ curl -s https://localhost:8080/api/latest/fleet/device/1804e808-171f-4dda-9bec-f695b2f2371a | jq '.host.policies // "not present"'
"not present"
```
2022-06-07 13:27:13 -03:00
Martin Angers
a23e0c41ff
Support failing policies integrations (#5973) 2022-06-06 10:41:51 -04:00
Lucas Manuel Rodriguez
1406e186be
Orbit: Add early update checks before starting sub-systems (#5885)
* Make orbit do a early check of updates

* Support orbit dev-mode

* Add test for NewRunner and Runner.UpdateAction

* Remove unnecessary parallel test
2022-06-01 14:47:04 -03:00
Michal Nicpon
30a864c8d2
Sync CVE scores periodically (#5838) 2022-06-01 10:06:57 -06:00
Roberto Dip
eb8defdcbe
add premium, device authed endpoint to retrieve policies (#5967)
This adds a new device authenticated endpoint, `/api/_version_/fleet/device/{token}/policies` to retrieve the device policies.

An example request / response looks like:

```bash
curl  https://localhost:8080/api/latest/fleet/device/1804e808-171f-4dda-9bec-f695b2f2371a/policies
```

```json
{
  "policies": [
    {
      "id": 3,
      "name": "Antivirus healthy (Linux)",
      "query": "SELECT score FROM (SELECT case when COUNT(*) = 2 then 1 ELSE 0 END AS score FROM processes WHERE (name = 'clamd') OR (name = 'freshclam')) WHERE score == 1;",
      "description": "Checks that both ClamAV's daemon and its updater service (freshclam) are running.",
      "author_id": 1,
      "author_name": "Admin",
      "author_email": "admin@example.com",
      "team_id": null,
      "resolution": "Ensure ClamAV and Freshclam are installed and running.",
      "platform": "darwin,windows,linux",
      "created_at": "2022-05-23T20:53:36Z",
      "updated_at": "2022-05-23T20:53:36Z",
      "response": "fail"
    }
  ]
}
```

Related to [#5685](https://github.com/fleetdm/fleet/issues/5685), in another changeset I will be adding "client" endpoints so we can consume this endpoint from Fleet Desktop
2022-05-31 14:54:43 -03:00
Zach Wasserman
632ed6a7c4
Fix lint issue in Orbit test (#5929)
Fixes issue introduced by #5894.

This was missed due to distraction from other (typical) CI failures on dependabot PRs.
2022-05-26 16:44:49 -07:00
gillespi314
b4ffec10db
Remove skipLoadingExtras and includeCVEScores from GetHost and HostByIdentifier methods (#5874) 2022-05-25 11:30:03 -05:00
Michal Nicpon
983f9e59b3
Include CVE scores when listing software (#5673) 2022-05-20 10:58:40 -06:00
Lucas Manuel Rodriguez
b6bbbbe186
Add (beta) support for Fleet Desktop to linux (#5221)
* Add (beta) support for Fleet Desktop to linux

* Add dependency for linux desktop

* Amend makefile uname check

* Clarify env vars used for linux in execuser

* Add final set of fixes

* Remove -it from docker run

* Add desktop to the update runner for Linux

* Re-arrange tag.gz and fix upgrade check for linux desktop
2022-05-04 11:14:12 -03:00
dependabot[bot]
0bca26be03
Bump ansi-regex from 5.0.0 to 5.0.1 in /ee/tools/license (#4839)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 11:48:31 -07:00
Lucas Manuel Rodriguez
c82c580716
Orbit: Add Fleet Desktop support to Windows (#4873)
* Orbit: Add Fleet Desktop support to Windows

* Rename workflow, fix linux build

* Do not compile systray on linux

* nolint on unused

* Fix lint properly

* nolint both checkers

* Fix monitor logic in desktopRunner

* Fix interrupt and execute order
2022-04-01 17:28:51 -03:00
Michal Nicpon
7b671ac2a3
Add team failing policies webhook (#4633)
* add config to teams
* update api docs
* update tests
2022-03-21 13:16:47 -06:00
Lucas Manuel Rodriguez
ecdfd627b6
Fleet Desktop MVP (#4530)
* WIP

* WIP2

* Fix orbit and fleetctl tests

* Amend macos-app default

* Add some fixes

* Use fleetctl updates roots command

* Add more fixes to Updater

* Fixes to app publishing and downloading

* Add more changes to support fleetctl cross generation

* Amend comment

* Add pkg generation to ease testing

* Make more fixes

* Add changes entry

* Add legacy targets (until our TUF system exposes the new app)

* Fix fleetctl preview

* Fix bool flag

* Fix orbit logic for disabled-updates and dev-mode

* Fix TestPreview

* Remove constant and fix zip-slip attack (codeql)

* Return unknown error

* Fix updater's checkExec

* Add support for executable signing in init_tuf.sh

* Try only signing orbit

* Fix init_tuf.sh targets, macos-app only for osqueryd

* Specify GOARCH to support M1s

* Add workflow to generate osqueryd.app.tar.gz

* Use 5.2.2 on init_tuf.sh

* Add unit test for tar.gz target

* Use artifacts instead of releases

* Remove copy paste residue

* Fleet Desktop Packaging WIP

* Ignore gosec warning

* Trigger on PR too

* Install Go in workflow

* Pass url parameter to desktop app

* Fix fleetctl package

* Final set of changes for v1 of Fleet Desktop

* Add changes

* PR fixes

* Fix CI build

* add larger menu bar icon

* Add transparency item

* Delete host_device_auth entry on host deletion

* Add SetTargetChannel

* Update white logo and add desktop to update runner

* Add fleet-desktop monitoring to orbit

* Define fleet-desktop app exec name

* Fix update runner creation

* Add API test before enabling the My device menu item

Co-authored-by: Zach Wasserman <zach@fleetdm.com>
2022-03-21 14:53:53 -03:00
Lucas Manuel Rodriguez
f4d3159cc9
Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393)
* WIP

* WIP2

* Fix orbit and fleetctl tests

* Amend macos-app default

* Add some fixes

* Use fleetctl updates roots command

* Add more fixes to Updater

* Fixes to app publishing and downloading

* Add more changes to support fleetctl cross generation

* Amend comment

* Add pkg generation to ease testing

* Make more fixes

* Add changes entry

* Add legacy targets (until our TUF system exposes the new app)

* Fix fleetctl preview

* Fix bool flag

* Fix orbit logic for disabled-updates and dev-mode

* Fix TestPreview

* Remove constant and fix zip-slip attack (codeql)

* Return unknown error

* Fix updater's checkExec

* Add support for executable signing in init_tuf.sh

* Try only signing orbit

* Fix init_tuf.sh targets, macos-app only for osqueryd

* Specify GOARCH to support M1s

* Add workflow to generate osqueryd.app.tar.gz

* Use 5.2.2 on init_tuf.sh

* Add unit test for tar.gz target

* Use artifacts instead of releases

* Remove copy paste residue

* Trigger workflow on PR

* Fixes to ease handling of artifact

* Fix, do not use target name as dir

* Remove workaround
2022-03-15 16:04:12 -03:00
Zach Wasserman
1b1d3f8a61
Update go-tuf dependency (#3837)
Resolves the warning described in #3699 by updating to the latest
version of the dependency with the warning fixed.

The warning should go away on all clients after new metadata is 
generated with these changes.
2022-02-10 08:16:36 -08:00
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