Commit graph

2533 commits

Author SHA1 Message Date
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
Lucas Manuel Rodriguez
5f65ea831c
Disable AI features on non-new installations upgrading to 4.51.X (#19482)
#19365

Assuming we release this fix in 4.51.0:
- Migration from a version without the feature (< 4.50.0) to 4.51.0:
Should disable (set `ai_features_disabled=true`).
- Migration from a version with the feature (>= 4.50.X < 4.51.0) to
4.51.0: Should keep `ai_features_disabled` as-is.
- New installation of Fleet: Should come with AI features enabled
(`ai_features_disabled=false`).

From
https://github.com/fleetdm/fleet/issues/19365#issuecomment-2145825363.

- [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] Manual QA for all new/changed functionality
2024-06-10 16:49:27 -03:00
Lucas Manuel Rodriguez
3e19cd90a9
Log warning when hosts enroll with duplicate hardware UUIDs (#19475)
#16393

- [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-10 16:48:05 -03:00
Victor Lyuboslavsky
6a20231fc4
Added FLEET_CALENDAR_PERIODICITY for internal demo use. (#19559)
#19491 

Video demo:
https://www.loom.com/share/c8fca008a9674cc685a5c209d9689271?sid=1f67e6c5-5e0b-4f10-9837-dc5d4c27f858

Changes file not added since this is an undocumented feature for
internal use.

New tests not created since this feature is for internal use, and will
likely be removed in the near future.

# 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. -->

- [ ] 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-10 14:27:28 -05:00
Roberto Dip
a9a11e293a
Fixed a bug that prevented unused script contents to be cleaned up. (#19615)
for #19500

# 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-10 16:03:34 -03:00
Jacob Shandling
92198a22b8
Delete team policies: 404 for nonexistent team (#19516)
## Addresses #18993 

- Return `404` when a user tries to delete team policies from a
non-existent team – see [this precedent in the
codebase](6b3310aa51/server/service/integration_core_test.go (L6212))
for a 404 in this situation
- Add missing authorization check for this action


<img width="1494" alt="Screenshot 2024-06-04 at 6 22 02 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/15b98c7e-5d4b-450c-8403-a062d7d1bd5b">



- [x] Changes file added for user-visible changes in `changes/`,
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-06-10 10:46:16 -07:00
Jahziel Villasana-Espinoza
27b8a1364f
feat: new software installer and carves fields, kept original fields for backwards compat (#19597)
> Related issue; #19526

# 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-10 13:35:27 -04:00
Martin Angers
e6de0dcebd Add integration test of batch-setting with self-service 2024-06-05 15:44:02 -04:00
Roberto Dip
f7665297fc
fix fleetctl generate mdm-apple-bm (#19507)
for #19506

# 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] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-04 18:19:09 -03:00
Jahziel Villasana-Espinoza
aac7c0435f
feat: return better errors when private key not configured (#19471)
> Related issue: #19464

# 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-04 11:06:30 -04:00
Jahziel Villasana-Espinoza
945eb778a6 fix: ensure test cleanup 2024-06-04 09:45:53 -04:00
Roberto Dip
1f6534f933
generate/ingest SCEP challenges and improve error messages (#19468)
for #19454
2024-06-03 18:33:52 -03:00
Jahziel Villasana-Espinoza
dfe5b728c2 feat: return better errors when private key not configured 2024-06-03 17:23:54 -04:00
Martin Angers
d878290027
Merge branch 'main' into feat-software-self-service 2024-06-03 13:25:03 -04:00
Roberto Dip
fa3f87a9a5
skip vuln tests until API keys are restored (#19446) 2024-06-03 14:06:41 -03:00
Victor Lyuboslavsky
275ab6e537
Live queries work with replication lag. (#19368)
#19272
Live queries now work via UI with large (~1 second) replication lag (for
master-replica DB setup).

# 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.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-06-03 08:22:45 -05:00
gillespi314
9afbd0e02f Update migrations 2024-05-31 17:17:37 -05:00
gillespi314
949acfb2bd Merge branch 'main' into feat-software-self-service 2024-05-31 16:35:56 -05:00
Jahziel Villasana-Espinoza
a343eda885
Feat save certs (#19390)
for #10383

# 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-05-31 16:58:34 -04:00