Commit Graph

1674 Commits

Author SHA1 Message Date
Roberto Dip
ec33f9e66f
account for possible NULL values in profile description (#12937)
in previous releases we weren't setting the value of description in some
of our `INSERT ON DUPLICATE KEY UPDATE` clauses, which caused some
queries to fail.

we could additionally add a migration to set all NULL values to '' and
make the column non-nullable, but as a first step I'm fixing this at the
application logic level.

related to: https://github.com/fleetdm/fleet/issues/12923

# 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-07-24 16:48:47 -03:00
Marcos Oviedo
501ef480b0
Windows mdm TOS endpoint (#12900)
This relates to https://github.com/fleetdm/fleet/issues/12604 and
https://github.com/fleetdm/fleet/issues/12600

# 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-07-21 14:36:26 -03:00
Roberto Dip
ee461bac2e
optimizations to profile delivery (#12808)
for #12481
2023-07-20 18:11:45 -03:00
Marcos Oviedo
2c02ab3be5
Adding temporary MS-MDM implementation (#12852)
This is the prototype implementation for MS-MDM. Most of the code here
will change in the upcoming sprints once
https://github.com/fleetdm/fleet/issues/12839,
https://github.com/fleetdm/fleet/issues/12840,
https://github.com/fleetdm/fleet/issues/12841 get implemented.

- [ ] 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-07-20 11:54:04 -03:00
gillespi314
b8ab1fb183
Update ingestion of host detail queries for MDM so hosts that report empty results are counted as "Off" (#12700) 2023-07-19 12:38:42 -05:00
Marcos Oviedo
f429c6db49
12613 Azure AD JWT Auth token support (#12817)
This PR adds support to parse Azure JWT tokens, and it also adds the STS
endpoint ([Section
3.2](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-mde2/27ed8c2c-0140-41ce-b2fa-c3d1a793ab4a)
on the MS-MDE2 spec)

This relates to #12614 and #12613 

# 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-07-19 13:30:24 -03:00
Noah Talerman
e51ff9aa16
Audit activities (#12807)
- Add note about Windows MDM features being in production
- Update doc generator to generate new title and meta tag
2023-07-18 09:25:19 -04:00
Roberto Dip
e8070e0bd8
properly report changed profiles in the Puppet module (#12719)
For #12480
2023-07-14 12:53:03 -03:00
gillespi314
e716406ed5
Mask URL params in server logs for webhook POSTs (#12761) 2023-07-13 17:47:34 -05:00
Roberto Dip
09e407f5c0
hide microsoft/windows MDM flags in the fleet binary (#12712) 2023-07-13 15:43:39 -03:00
Gabriel Hernandez
9aa7c0c714
add dark and light background logo colors and show them on mdm migrat… (#12681) 2023-07-13 19:35:25 +01:00
Juan Fernandez
bfe6a5c3ad
Invalid policies should be ignored in the desktop endpoint (#12523)
Updated the `/desktop` endpoint to ignore invalid policies
2023-07-13 14:13:36 -04:00
Roberto Dip
eb75e303ec
change how team assignment works for the Puppet module (#12566)
For #12532, all details of how this works/why is done are in the issue
description.
2023-07-13 15:00:45 -03:00
Roberto Dip
666ae8d787
ensure ds.TeamByName returns a 4xx response if no team is found (#12620)
this helps consumer of the datastore method handle the not found
scenario better and ensures we always return a 4xx code by default if we
can't find a matching team.

seems like calls to this method were special-cased everywhere except in
the apply user roles endpoint, where we returned a `500` status code if
we couldn't find a team.
2023-07-13 11:55:05 -03:00
Roberto Dip
53f0e281bf
set DeferForceAtUserLoginMaxBypassAttempts in FV profile (#12729)
Related to #12608, this automatically sets the
`DeferForceAtUserLoginMaxBypassAttempts` property to `1` on the
FileVault profile that's generated by Fleet.

This changeset also includes a migration to modify old FileVault
profiles that already exist in the database, and by virtue of that a
`InstallProfile` command will be issued to hosts that already have FV
enabled. During testing we found:

1. This doesn't affect users with FV already installed, they silently
get the profile updated without any changes.
2. Since the profile needs to be re-delivered, it'll go through the full
"pending" -> "verifying" -> "verified" cycle.
2023-07-13 11:54:05 -03:00
Marcos Oviedo
a49e980394
Windows MDM identity certs missing check (#12702)
This is related #12701 

# 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/`.
- [X] Manual QA for all new/changed functionality
2023-07-10 17:36:17 -03:00
Roberto Dip
2b4798c4ab
add activity items when a Windows host turns MDM on (#12635)
For #12427, and its sub-tasks #12288 and #12612



![image](https://github.com/fleetdm/fleet/assets/4419992/b4c019dd-fbd3-4c1d-a2ad-a0bb4ebac817)
2023-07-06 15:33:40 -03:00
Marcos Oviedo
96449dd47b
Adding support for RequestSecurityToken messages - Windows MDM enroll endpoint (#12555)
This relates to #12263 

# 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] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [X] Added/updated tests

---------

Co-authored-by: Roberto Dip <me@roperzh.com>
2023-07-05 10:06:37 -03:00
Juan Fernandez
91f048e98a
Fixed iCloud false positives (#12551)
Added new type `CPEMatchingRule` used for fixing false positives caused by 'bad' entries in the NVD dataset.
2023-06-30 13:05:34 -04:00
Roberto Dip
5ddd940cb8
ensure profiles and commands are delivered when MDM is turned on (#12580)
Related to #12482 and #12453, this cleans up Fleet tables that track
profile and bootstrap package status on re-enrollment.
2023-06-30 12:30:49 -03:00
Roberto Dip
4b139245cb
only show Nudge to hosts with MDM features turned on (#12588)
For #12582
2023-06-30 12:29:27 -03:00
gillespi314
410cbc3972
Add certificate management for Microsoft MDM (WSTEP) (#12543)
Issue #12261

# Checklist for submitter

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

- [ ] 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
- [ ] 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-06-29 19:31:53 -03:00
Martin Angers
f641c3ec57
Add activities when Windows MDM is turned on/off (#12533) 2023-06-28 12:53:46 -04:00
Roberto Dip
78cc59e690
lowercase DisplayName attributes when reading SSO response (#12545)
this is to accommodate providers like [Okta][1] that send the user's
full name as an attribute named `displayName`

[1]:
https://developer.okta.com/docs/reference/api/users/#default-profile-properties
2023-06-28 12:19:13 -03:00
Martin Angers
1db2f7646a
Implement Windows MDM programmatic unenrollment (notification + orbit trigger) (#12505) 2023-06-28 09:13:37 -04:00
Martin Angers
e323a3d881
Consider an empty EULA pdf file the same as an invalid one, returning 400 Bad Request (#12542) 2023-06-28 08:19:42 -04:00
Marcos Oviedo
821f6b064f
Adding support for GetPolicies message (#12477)
This relates to #12262 

- [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-06-27 12:59:33 -03:00
Martin Angers
ca02abb660
Trigger Windows MDM host enrollment on device when notified that it is enabled (#12426) 2023-06-26 12:13:17 -04:00
Martin Angers
8b95155ae2
Add mdm_enabled field to response of PATCH /config (#12498) 2023-06-26 09:16:42 -04:00
Marcos Oviedo
22bb16bf2e
Pushing initial support for MS-MDE2 Discovery message (#12387)
This PR requires the Windows MDM configuration changes - This will be
updated next week

- [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
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
2023-06-22 17:31:17 -03:00
Juan Fernandez
0c172c85c3
SSO Metadata URL can only be https/http (#12388)
When setting up SSO, validate that the Metadata URL has the proper scheme.
2023-06-22 08:17:37 -04:00
Juan Fernandez
d70ae633c0
Return proper status code if SMTP conf is invalid (#12389)
When setting up SMTP return the proper status code if config is invalid.
2023-06-21 14:40:26 -04:00
Juan Fernandez
d08cc18111
Don't analyze non-windows OS using the MSRC scanner (#12421)
Don't analyze non-windows OS using the MSRC scanner
2023-06-21 14:19:55 -04:00
gillespi314
8cc7d38300
Mark "verifying" or "verified" MDM profiles as "failed" if osquery cannot confirm they are installed (#12414) 2023-06-21 13:00:49 -05:00
Martin Angers
1c249b60da
Add support to configure and enable Windows MDM, notify elegible hosts (#12340) 2023-06-20 14:06:45 -04:00
Martin Angers
96aec85a0a
Add mechanism to force read from primary DB, use it for puppet matching (#12396) 2023-06-19 13:55:15 -04:00
Juan Fernandez
55d56ba2db
If the fleet/forgot_password endpoint is rate limited, it should return the proper status code (#12323)
Return proper HTTP status code if endpoint is rate limited.
2023-06-15 15:41:04 -04:00
Juan Fernandez
7226b7f087
Warnings in fleetctl should use Stderr not Stdout (#12316)
Fixed issue were the expired license banner was being sent to Stdout instead of Stderr
2023-06-15 13:13:41 -04:00
Juan Fernandez
e7ded8d0c8
When authorizing users on the PolicySpec endpoint, return proper status code if team not found (#12335)
Return proper status code on policy spec endpoint if team not found.
2023-06-15 12:46:54 -04:00
gillespi314
87fe00db71
Create new Fleet osquery extension table to read escrowed FileVault key (#12198) 2023-06-15 10:23:59 -05:00
Lucas Manuel Rodriguez
517acdad72
Add guide to configure process_file_events on CentOS 7 (#12322)
#11890

---------

Co-authored-by: Rachael Shaw <r@rachael.wtf>
2023-06-14 18:23:47 -03:00
Martin Angers
09d2ccd009
Add Windows MDM feature flag environment variable (#12306) 2023-06-14 08:44:42 -04:00
Martin Angers
68fa60c54d
Add a transferred_hosts activity when hosts are transferred to a new team (#12287) 2023-06-14 08:15:05 -04:00
Juan Fernandez
98d9f1b068
If user is a global/team observer/observer+, 'teams' endpoints should not include secrets (#12216)
Fixed auth. issue with Obs/Obs+
2023-06-08 17:30:34 -04:00
Roberto Dip
1ad80fa251
bugfixes + adjustments for the puppet module (#12221)
A few minor things going on:

1. Adjusted the Puppet module to send the profiles base64 encoded
2. Enabled FileVault by default on teams created using the `/match`
endpoint.
3. Remove profiles when a team is removed. We can't do a foreign key
because the global team.id is NULL. I also included a migration to
cleanup orphaned profiles.
2023-06-08 18:05:44 -03:00
Roberto Dip
ba68082543
return a 4xx error if a SSO session is not found (#12211)
for #12113
2023-06-07 21:12:44 -03:00
Martin Angers
de42164c53
Ignore fleet profiles when matching a set of custom profiles to a team (#12209) 2023-06-07 15:43:27 -04:00
Lucas Manuel Rodriguez
2a532ede94
Do not return empty SSO and SMTP settings for non-global-admins (#12180)
#11266

PS: I first attempted a serialization trick by introducing a new
`appConfigResponse` and implementing `json.Marshal` to exclude these
fields but it was too hacky and hard to maintain moving forward, so I'm
bitting the bullet now. Happy to hear other ideas.

- [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-06-07 16:06:36 -03:00
Martin Angers
68ddaafac0
Fix bug preventing gitops role from fleetctl applying macos setup assistant (and bootstrap package) (#12193) 2023-06-07 13:29:36 -04:00
Roberto Dip
6617938393
ensure we send post-enrollment commands if a DEP device is enrolling (#12159)
for #11257, h/t to @mna for the idea of resetting `token_update_tally`.

this is to cover scenarios where a host might be re-enrolling (eg: the
device has been wiped) but we don't know about it.

since `TokenUpdate` might be called multiple times during the lifecycle
of an MDM enrollment, we add a check on the value of
`nano_enrollments.token_update_tally`. For the scenarios described
above, the tally is still `> 0` even thought the host is enrolling for
the first time.

to mitigate this, we reset its value to 0 when we receive an
`Authenticate` message (which only happens only per enrollment)

I set the value to `0` because it's incremented to `current_value+1` by
nanomdm before calling our handler.
2023-06-06 20:18:14 -03:00