Commit Graph

2210 Commits

Author SHA1 Message Date
Roberto Dip
48ee019507 fix unreleased issues for macOS DDM
for #17924 and #17923
2024-03-28 15:44:14 -03:00
Roberto Dip
0d15132ae4 fix tests and lint 2024-03-27 12:21:08 -03:00
Roberto Dip
e34b320ed5 Merge remote-tracking branch 'origin/main' into feat-macos-ddm 2024-03-27 11:58:22 -03:00
Roberto Dip
15e671da9a add missing activities 2024-03-27 11:04:47 -03:00
Martin Angers
8abee3e72d
Merge branch 'main' into feat-prefill-account-name 2024-03-27 09:53:02 -04:00
Roberto Dip
0be9f085b0
batch set declarations as pending when they're uploaded (#17876)
#17685
2024-03-27 10:44:22 -03:00
Lucas Manuel Rodriguez
ea92433c34
Disabling calendar policies removes scheduled calendar events (#17882)
#17230

Fix for the following scenarios:
- Team has only one policy with calendar enabled. Events are created on
user calendars. Then the user disables the calendar on such policy.
Expected behavior: Events on the user calendar should be cleaned up in
that scenario.
- Policy `platform` is edited (which removes `policy_membership`
entries) and we'd like to have the calendar event removed for the hosts
that do not apply anymore.

To cover these scenarios I changed `ds.GetTeamHostsPolicyMemberships` so
that it also returns hosts that have a calendar event AND have no
results on policies (returned as passing=1).
E.g. this could happen if there ARE calendar events for a team but with
a platform that doesn't match the host (so it has no results).
2024-03-27 10:33:09 -03:00
Roberto Dip
fdc5aa57c2
add ddm declarations in the API (#17880)
for #17409
2024-03-27 09:53:43 -03:00
Martin Angers
b449900602 Regenerate schema.sql 2024-03-27 08:19:21 -04:00
Dante Catalfamo
7b13d9ce17
Add mdm_apple_declarative_requests table to log DDM requests (#17844)
#17792
2024-03-27 00:09:09 -03:00
Sarah Gillespie
1edd9f07bb
Update host details, list host filters, and MDM summary to include macOS declarations (#17866)
Issue #17619

---------

Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2024-03-26 21:54:47 -03:00
Victor Lyuboslavsky
9bb1610408
Fleet in your calendar feature branch (#17584)
# Checklist for submitter
- [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
2024-03-26 15:34:33 -05:00
Dante Catalfamo
0b04e7ea9f
Allow EnrollmentState to be in status '3' for MDM clients (#17868)
#17692

Recently there was a change that filtered out hosts in `EnrollmentState`
3. This change may cause some hosts that are in otherwise good health to
appear unresponsive to MDM in the management UI.

This change will allow hosts with `EnrollmentStatus` 3 show as enrolled.

The root cause of some hosts being in state 3 is still not entirely
clear, but may have to do with either trying to re-enroll once already
enrolled, or windows updates causing some sort of issue with fleet.

Despite the "failed" `EnrollmentState` 3, the host will still display
that the system is managed by Fleet, and will actively sync.
2024-03-26 16:33:52 -04:00
Victor Lyuboslavsky
72662291b0
Adding embedded timezone database. 2024-03-26 13:39:37 -05:00
Lucas Manuel Rodriguez
31fe9d17b9
More fixes to support users with hosts in same team and hosts in different teams (#17789)
#17441
2024-03-26 13:39:37 -05:00
Lucas Manuel Rodriguez
e8f177dd43
Additional changes to happy path and cleanup cron job (#17757)
#17441 & #17442
2024-03-26 13:39:37 -05:00
Victor Lyuboslavsky
e4ba41ac85
Latest changes to configs (#17724)
- Remove email from team configs
- Accept api_key_json for global config
2024-03-26 13:39:37 -05:00
Victor Lyuboslavsky
196d8ce5b7
Calendar interface updates and mock calendar (#17701)
- Updated calendar interface to use updated `genBodyFn`
- The mock calendar is enabled by specifying `calendar-mock@example.com`
as the service account email.
2024-03-26 13:39:36 -05:00
Lucas Manuel Rodriguez
9a8ac02bc1
Happy path implementation of the calendar cron job (#17713)
Happy path for #17441.
2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
21f95d8b5d
Calendar interface fixes from code review and refactoring. (#17658)
Calendar interface fixes from code review and manual merge with
@lucasmrod changes.
2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
2db8eb3c80
Update migrations for main rebase. 2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
63e9d49dfc
Calendar config updates -- policy table now has calendar_events_enabled (#17645)
# Checklist for submitter
- [ ] 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] If database migrations are included, checked table schema to
confirm autoupdate
- For database migrations:
- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [x] Manual QA for all new/changed functionality
2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
d3e1716572
Calendar config API endpoints bug fixes. (#17640)
Bug fixes for frontend
- google_calendar can be nil for global config to indicate that it
should not change
- `fleet/teams/:id` endpoint now working
2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
c9b917a491
Calendar interface (#17633)
# Checklist for submitter
- [ ] 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.
- [ ] 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
2024-03-26 13:39:36 -05:00
Lucas Manuel Rodriguez
be0e89142f
Add migrations for calendar events (#17585)
#17230
2024-03-26 13:39:36 -05:00
Victor Lyuboslavsky
1c311b73be
Fleet in your calendar configs (#17462)
Sub-task for #17230 

# Configuration changes
App configuration:
```yaml
integrations:
  google_calendar:
    - email: name@service-account.com
      private_key: ***
      domain: fleetdm.com
```
Team configuration:
```yaml
integrations:
  google_calendar:
    email: name@service-account.com
    enable_calendar_events: true
    policies:
      - name: My policy
        id: 12
    webhook_url: https://example.com/policy-remediation
```

Note: Policy is looked up by name when configuration is set. The policy
id is set/updated by the server for internal use.

# Checklist for submitter
<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-03-26 13:39:36 -05:00
Martin Angers
12d9377d68
Merge branch 'main' into feat-prefill-account-name 2024-03-26 14:01:22 -04:00
Martin Angers
74d60dca4d
Update/fix/add tests for puppet-related flow (preassign+match) (#17859) 2024-03-26 13:41:40 -04:00
Roberto Dip
f0ad942a57
implement status reports for DDM commands (#17831)
for #17408
2024-03-26 10:40:35 -03:00
Roberto Dip
44727ace3b
fix issues with ddm CLI (#17826)
for #17404. I couldn't find tests for this portion of the code, so full
tests for this section will need to be added during freeze.
2024-03-25 17:36:26 -03:00
Roberto Dip
95df7e2b0b
implement DDM cron and protocol bits (#17791)
for #17399
2024-03-25 17:32:27 -03:00
Martin Angers
994040b1c9
Send DeviceConfigured MDM command after DEP enrollment (#17737) 2024-03-25 13:25:29 -04:00
Dante Catalfamo
ee14a26df4
Return correct OS details for Windows Server 2019 (#17760) 2024-03-25 10:06:36 -04:00
Gabriel Hernandez
8d2deb37e5 Merge branch 'main' into feat-prefill-account-name 2024-03-25 11:38:20 +00:00
Gabriel Hernandez
577d5c27ea Merge branch 'main' into feat-macos-ddm 2024-03-25 11:11:40 +00:00
StepSecurity Bot
80335d88d1
[StepSecurity] Apply security best practices (#17811) 2024-03-22 16:19:11 -05:00
Sarah Gillespie
60ba78fc9d
Additional backend support for DDM profiles (#17775) 2024-03-22 10:37:43 -05:00
Dante Catalfamo
bd3e775e67
Windows MDM Fix Manual Detection (#17721)
#15565 

Replace the use of the isFederated registry key with a keys that check
for AAD (Azure Active Directory, now Entra ID)

Federated enrollment (`isFederated`) seems to be when windows uses a
Discovery MDM endpoint to get its policy and management endpoint
configuration. This is always the case when a client is enrolled with
fleet, so installations always show up as automatic.

It's being replaced by a different key, `AADResourceID`, which appears
to identify the resource that controls the automated deployment. In my
tests it only appears to be populated when the computer is enrolled
through automated deployments. This key appears on both Windows 10 and
11.

There is a similar key, `AADTenantID`, which appears to identify the
client (tenant) to the Azure cloud. I haven't seen this ID in our
systems, so it is likely exclusively used in Azure. Both this key and
`AADResourceID` seem to always be set at the same time, so we only
check for the `AADResourceID`.

I've also added documentation on the registry keys I've analyzed for future reference.
2024-03-21 15:09:05 -04:00
Roberto Dip
495638b45a
bugfixes, integration and cleanup for DDM (#17756)
Improvements and fixes I found while integrating this

- Renamed db columns to match the profile tables for consistency
- Added columns to `host_mdm_apple_declarations`
- Removed `team_declaration_checksum_view`
- Remove the ad-hoc `MDMAppleRecordDeclarativeCheckIn`, I confused
myself by developing this using tests, the device actually sends an
`Acknowledged` response, which is recorded by nano
- Fixed bugs in the `declaration/../..` endpoints
    - The prefix for the endpoint is `declaration` without `s`
- The response needs to include a `ServerToken`, otherwise the
declaration fails
2024-03-21 13:12:32 -03:00
Sarah Gillespie
7dcfef38d4
Update name validations for POST /mdm/profiles endpoint (#17753)
Follow up for #17402
2024-03-21 12:25:28 -03:00
Sarah Gillespie
01e3b94e55
Update backend APIs for macOS DDM (#17734)
Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
2024-03-20 14:15:07 -05:00
Gabriel Hernandez
73e5f478d4 Merge branch 'main' into feat-prefill-account-name 2024-03-20 14:45:02 +00:00
Gabriel Hernandez
d9f9d28646 Merge branch 'main' into feat-macos-ddm 2024-03-20 14:26:00 +00:00
Sarah Gillespie
d56d0cde31
Update DDM protocol endpoints to use host UUID in support of profile labels (#17719) 2024-03-20 09:14:21 -05:00
Victor Lyuboslavsky
759003e37d
Fixing false negative vulnerabilities on macOS Homebrew python packages. (#17709)
#17061

TODO: Need to also merge this fix into patch branch.

# Checklist for submitter
- [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
2024-03-19 14:12:07 -05:00
Martin Angers
b0ab7bbdc4
Add enable_release_device_manually setting to team and no-team (#17698) 2024-03-19 13:21:16 -04:00
Sarah Gillespie
3d73174e90
Add macOS DDM protocol endpoints for tokens, declaration-items, and declaration/.../... (#17679) 2024-03-18 17:48:07 -05:00
Roberto Dip
93f040f7da
fix mysql 8+ test (#17702) 2024-03-18 17:35:18 -03:00
Roberto Dip
e26d23460c
record declarative checkin command responses (#17693)
this is to prevent nanomdm to send the DeclarativeManagement command
every time the host checks in.
2024-03-18 14:41:33 -03:00
Roberto Dip
f5cf156653
improve mdmtest package to handle any kind of command (#17673)
it delegates any extra unmarshaling to the caller. We might consider
building our own types in the future instead of relying on micromdm, but
these are used only for tests right now.
2024-03-15 17:10:48 -03:00