Commit graph

2551 commits

Author SHA1 Message Date
Sarah Gillespie
74db826a52
Add option to exclude software from device details API response (#19874) 2024-06-24 10:43:16 -05:00
Victor Lyuboslavsky
7b751fa50a
Additional debug info and speculative fix for TestUpdateStatsOnReplica (#19901)
Additional debug info and speculative fix for TestUpdateStatsOnReplica
CI fails
2024-06-21 14:50:12 -05:00
Victor Lyuboslavsky
2e2d0fb983
Removed duplicate os_versions results in /api/latest/fleet/vulnerabilities/:cve endpoint (#19912)
#19819
Removed duplicate `os_versions` results in
/api/latest/fleet/vulnerabilities/:cve endpoint

Could not manually test since I do not have an Intel mac. We will need
to QA on dogfood.

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [ ] Manual QA for all new/changed functionality
2024-06-21 14:14:56 -05:00
Roberto Dip
685e1f8557
Fixed a server panic in /mdm/apple/mdm (#19929)
for #19928

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-21 12:20:51 -03:00
Tim Lee
cb5fb65c5e
fix app vuln false positives (#19905) 2024-06-21 08:05:18 -06:00
Victor Lyuboslavsky
0dd620e61b
Added character validation to /api/fleet/orbit/device_token endpoint (#19919)
https://github.com/fleetdm/confidential/issues/6978
Added character validation to /api/fleet/orbit/device_token endpoint

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-21 08:43:08 -05:00
Gabriel Hernandez
8d064065d7
Dont send 500 for every call to /debug/errors endpoint (#19827)
relates to #15197

This updates the handler for `/debug/errors` so that we no longer always
send a 500 response.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Added/updated tests
2024-06-21 13:12:06 +01:00
Roberto Dip
03dd4721b6
proper fix for renew enrollment profile requests (#19909)
# Checklist for submitter

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-20 16:35:23 -03:00
Sarah Gillespie
9f0404fbe1
Add fallback checks for MDM unenrollment during migration flow (#19860)
Follow up to address additional issues uncovered during QA of #19512
2024-06-18 20:05:44 -03:00
Victor Lyuboslavsky
a452e01bb2
Changed activities.created_at timestamp precision to microseconds (#19848)
#19845 
Changed `activities.created_at` timestamp precision to microseconds

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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
- [x] Manual QA for all new/changed functionality
2024-06-18 15:37:08 -05:00
Victor Lyuboslavsky
82d1f8e3db
disable_issues and host issues support for other API endpoints (#19802)
#18115 
`disable_issues` param, plus additional API support for critical
vulnerabilities count

* /api/latest/fleet/labels/:id/hosts now return
`critical_vulnerabilities_count` for premium users.
* /api/latest/fleet/labels/:id/hosts can be sorted by total_issues_count
by specifying `order_key=issues` query parameter.
* /api/latest/hosts/:id and /api/latest/hosts/identifier/:identifier now
return `critical_vulnerabilities_count` for premium users.
* For /api/latest/fleet/hosts, /api/latest/fleet/hosts/report, and
/api/latest/fleet/labels/:id/hosts endpoints, the
`disable_failing_policies` query parameter has been deprecated. Instead,
use `disable_issues` to disable the failing policies and critical
vulnerabilities counts.


# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-18 14:13:38 -05:00
Jahziel Villasana-Espinoza
2a0de89797
fix: allow profiles larger than 65KB (#19829)
> Related issue: #19771 

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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
- [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] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [x] Manual QA for all new/changed functionality
2024-06-18 13:02:00 -04:00
Victor Lyuboslavsky
8d5914b6fb
Added debug info to TestUpdateStatsOnReplica (#19825)
To debug occasional CI failures.
2024-06-18 11:29:13 -05:00
Tim Lee
2d6458b3f8
Custom Ubuntu Kernel Vuln Scanning (#19588) 2024-06-17 15:44:01 -06:00
Roberto Dip
c9f26b2e18
for mdm migration, also use data from host_mdm (#19812)
unreleased bug I introduced

# Checklist for submitter
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-17 18:39:15 -03:00
Dante Catalfamo
e9efbef41a
MDM Azure enable scripts by default (#19706)
#17528
2024-06-17 16:37:15 -04:00
Victor Lyuboslavsky
2350ffdf49
Added host_issues (#19654)
* /api/latest/fleet/hosts now returns `critical_vulnerabilities_count`
for premium users. This data is held in the new `host_issues` table. The
failing policies total is updated in real-time, while the critical
vulnerabilities total is updated every hour after vulnerabilities job.
* /api/latest/fleet/hosts can be sorted by total_issues_count by
specifying `order_key=issues` query parameter.

#18115

Video commentary:
https://www.loom.com/share/ff4425e217db43d6b3ba4aa075374808

@getvictor TODO: Replacing `disable_failing_policies` with
`disable_issues` will be done in a separate PR.

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
- [x] Manual QA for all new/changed functionality
2024-06-17 12:15:42 -05:00
Tim Lee
b137bcbef2
Hotfix - Vuln matching race (#19786) 2024-06-17 11:02:47 -06:00
Victor Lyuboslavsky
c3efefa44a
Updated locked_host activity docs. (#19792)
#19545
Updated locked_host activity docs.
2024-06-17 11:54:56 -05:00
Victor Lyuboslavsky
05547a5130
Added view_pin param. (#19788)
#19545

`/api/latest/fleet/hosts/:id/lock` returns `unlock_pin` for Apple hosts
when query parameter `view_pin=true` is set

The lock host activity now has a `view_pin` parameter. Frontend change
is needed to reflect this in the UI.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-17 11:30:53 -05:00
Jahziel Villasana-Espinoza
cc96b3372a
fix: do not abort MDM ingestion flow if IdP id not found (#19776)
> Related issue: #19612

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-17 10:03:13 -04:00
Roberto Dip
1cc13a09fb
🧹 friday cleanup party: substitute deprecated import of go-kit (#19774)
`go-kit/kit/log` was deprecated and generating warnings

# Checklist for submitter

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

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

- [x] Manual QA for all new/changed functionality
2024-06-17 10:27:31 -03:00
Roberto Dip
48ea95385e
final adjustments to return timeout errors for software (#19772)
for #19453


![image](https://github.com/fleetdm/fleet/assets/4419992/c9849cf4-ea78-4393-8693-8ff8ea612221)

I don't know how to test this in the server without a significant
refactor.

# Checklist for submitter

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

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

- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-14 18:39:03 -03:00
Dante Catalfamo
72dd25c9cb
Disable mdm_bridge table on Windows Server (#19709)
#19239
2024-06-14 16:56:58 -04:00
Roberto Dip
b01389ad31
don't rely on MDM solution name to know if the host has Fleet MDM on (#19688)
for #18977

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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
- [x] Manual QA for all new/changed functionality
2024-06-14 15:01:12 -03:00
Sarah Gillespie
5a95911303
Improve error messages for parsing MDM config profiles via fleetctl (#19495) 2024-06-14 12:48:00 -05:00
Lucas Manuel Rodriguez
567e93baee
Wipe support for iPhone/iPad (#19733)
#19010
2024-06-14 14:25:54 -03:00
Gabriel Hernandez
a453d4ad36
add better messaging for 504 responses in fleetctl when running a script synchronously (#19680)
relates to #19378

This adds better error messaging in fleetctl for a 504 response (Gateway
timeout) when we run a script synchronously.


- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-14 17:07:08 +01:00
Lucas Rodriguez
63a6bb8bf3
Merge branch 'main' into feature_19010-ipad-ios-lock-wipe 2024-06-14 12:45:47 -03:00
Sharon Katz
5d93f27f20
use reader for stats (#19398)
# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.



@xpkoala the main things to QA:

- Statistics should be sent by the server to our Heroku service.
- The should be a theoretical small improvement to DB load (using the
reader instance instead of the writer). Not sure it will be measureable.
2024-06-14 11:34:39 -04:00
Lucas Manuel Rodriguez
904e8a6825
Added server_settings.query_report_cap (#19692)
#19600

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-14 12:24:01 -03:00
Roberto Dip
f62d5eda20
use Fleet instead of FleetDM in certificates (#19748)
for #18427

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [ ] Manual QA for all new/changed functionality
2024-06-14 11:08:49 -03:00
Victor Lyuboslavsky
8921cfe537
Code review fixes. (#19755)
Fixes from #19720 code review
2024-06-14 07:08:54 -05:00
Victor Lyuboslavsky
8b84b06a86
/api/latest/fleet/hosts/:id/lock returns unlock_pin for Apple hosts (#19720)
/api/latest/fleet/hosts/:id/lock returns `unlock_pin` for Apple hosts
#19545 
# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-14 06:58:17 -05:00
Lucas Manuel Rodriguez
60b233e5f7
Return token when creating API-only users (#19525)
#16961

API changes here: https://github.com/fleetdm/fleet/pull/17609/files

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-13 19:10:27 -03:00
George Karr
4e2f7e53c3
Merge branch 'main' into feature_19010-ipad-ios-lock-wipe 2024-06-13 14:01:02 -05:00
Lucas Manuel Rodriguez
af525223f2
Implement support for Wipe for iOS/iPadOS devices (#19704)
Backend changes for #19010.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-13 12:26:02 -03:00
Tim Lee
0516cd61d0
App OS Vulnerability Matching (#19486) 2024-06-13 11:20:28 -04:00
Tim Lee
6d2471d5e5
vscode false positivies (#19508)
#18733 

Added a rule for the affected CVEs and made a change to the `IfIgnore`
func. Manually tested CVE removals with `/tools/nvd/nvdvuln`. Existing
test coverage ensures the rule doesn't cause false negatives on vscode
extensions.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [] Added/updated tests
- [X] Manual QA for all new/changed functionality
2024-06-13 11:03:53 -04:00
Martin Angers
468a9ff608
Change status code 500=>408 when the MDM protocol endpoints time out reading the request body (#19698) 2024-06-12 16:30:49 -04:00
Tim Lee
33b087955b
Firefox ESR Fix (#19466)
#19401
#18447 

Reverted commit 5dab2042f8, corrected
discovery query, added lint test.

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-12 16:06:40 -04:00
Martin Angers
3044eb9e6b
Soft-delete entries for host script results so the details are still available in activities (#19457) 2024-06-12 10:26:03 -04:00
Victor Lyuboslavsky
8c4c739ef3
Display ingested software on host details page. (#19576)
#19348 

Fixed host details page and device details page not showing the latest
software.
- During software ingestion, software titles are now added if needed and
software items have their title_id field populated.
- In addition, after refreshing via UI, the software will be re-fetched
if it has been modified.

Added `exclude_software` query parameter to the
`/api/latest/fleet/hosts/:id` endpoint to exclude software from the
response.

PR for API doc change: #19617

Related issue filed for the Device User Page:
https://github.com/fleetdm/fleet/issues/19618

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-12 08:38:57 -05:00
Martin Angers
a154f4ca04
Improve handling of timeouts and maximum size for the upload software installer endpoint (#19657) 2024-06-12 09:33:25 -04:00
Victor Lyuboslavsky
05eb338561
Enable gitops to create teams with no enroll secrets, or clear enroll secrets for an existing team (#19616)
Enable gitops to create teams with no enroll secrets, or clear enroll
secrets for an existing team
#19332 

`fleetctl apply` also gains this extra functionality. In `fleetctl
apply` secrets will not be change if one of the following:
- secrets is missing from yml
- They are blank in yml, like: `secrets:`
- They are null in yml, like: `secrets: null`

They will only be cleared with `fleetctl apply` if the user explicitly
sets them to an empty array, like:
- `secrets: []`

# Checklist for submitter

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

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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-06-11 13:20:32 -05:00
Martin Angers
6dd365f266
Fix scripts that block execution of subsequent scripts when timing out on Windows (#19485) 2024-06-11 09:21:57 -04:00
Martin Angers
dec9bc53e3
Fix code linting issue where a slice was created non-empty and appended-to (#19490) 2024-06-11 08:55:07 -04:00
Martin Angers
96c8139c02
Fix a panic when downloading a software installer that exists in the DB but not in the storage (#19527) 2024-06-11 08:53:41 -04:00
Lucas Manuel Rodriguez
01dd0c7c4d
Update osquery flags to 5.12.2 (#19338)
#17375

Updating the osquery flags for 5.12.2
And making the changes so that we can just run `cd server/fleet/ && go
generate` on a macOS host every time we need to do this.

Manual tested by setting `logger_tls_backoff_max` in Fleet agent
settings (which is a 5.12.0 flag).

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/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

---------

Co-authored-by: Victor Lyuboslavsky <victor.lyuboslavsky@gmail.com>
2024-06-10 17:02:49 -03:00
Lucas Manuel Rodriguez
3dbdbc1bcf
Add support for iOS/iPadOS to osquery-perf (#19522)
#18119

- [X] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.

Sample on how to simulate 50 iPads and 50 iPhones:
```sh
go run ./cmd/osquery-perf -host_count 100 -os_templates iphone_14.6.tmpl:50,ipad_13.18.tmpl:50 -mdm_scep_challenge <...>
```
2024-06-10 17:02:35 -03:00