Commit graph

2307 commits

Author SHA1 Message Date
Dante Catalfamo
086e2464c2
Check macos version with semver for nudge disabling (#18485)
Fixes a bug where macos versions are incorrectly parsed for nudge
requirements
2024-04-23 10:09:47 -04:00
Martin Angers
f21aad446e
Fix creation of manual label that allowed overriding existing one (#18474) 2024-04-22 16:51:50 -04:00
Tim Lee
9e1878e01c
18439 Vulncheck data processing bug (#18440) 2024-04-22 09:36:20 -06:00
Lucas Manuel Rodriguez
74a9683637
Remove fmt.Println (#18426)
If this is for debugging let's add a comment :)
2024-04-19 14:39:07 -03:00
Roberto Dip
e39f5bce3b
implement logic to sign apple profiles (#16490)
#10418
2024-04-18 18:01:37 -03:00
Victor Lyuboslavsky
72cc82f60d
Ignoring Valve Corporation's Steam client's vulnerabilities on Windows and macOS (#18380)
#18126
Ignoring Valve Corporation's Steam client's vulnerabilities on Windows
and macOS
- On Windows and macOS, the true version of the Steam client (like
2021-04-10) cannot be retrieved by standard methods used on other
software. We would need to create custom logic to retrieve the version
of the Steam client.
- Steam client automatically updates itself, so security risk is
somewhat mitigated.

QA note: Items from software_cve table are cleared after 2 hours.

# 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.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-04-18 10:12:49 -05:00
Martin Angers
d08d715e89
Fix the TestIntegrationsMDM/TestDEPProfileAssignment test. (#18367) 2024-04-17 11:06:13 -04:00
Victor Lyuboslavsky
a5c107e082
For calendar integration, calendar event no longer created when policy has an invalid SQL query. (#18352)
For calendar integration, calendar event no longer created when policy
has an invalid SQL query.
#18350 

# 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-04-16 16:50:22 -05:00
Lucas Manuel Rodriguez
4a38135ea5
Fix TestIntegrations/TestUsers flaky test (#18251)
```
--- FAIL: TestIntegrations (47.44s)
    --- FAIL: TestIntegrations/TestUsers (1.42s)
        integration_core_test.go:4198:
            	Error Trace:	/Users/tim/workspace/fleet/server/service/integration_core_test.go:4198
            	Error:      	Not equal:
            	            	expected: 0x2
            	            	actual  : 0x1
            	Test:       	TestIntegrations/TestUsers
```
2024-04-16 18:40:29 -03:00
Sarah Gillespie
3ea7a4ba63
Merge branch 'main' into feat-macos-software-updates 2024-04-16 11:30:02 -05:00
Gabriel Hernandez
2fc4e520b8
add ability to create manual labels (#18303)
relates to #17031

Adds functionality to create manual labels in fleet.

- [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] M0anual QA for all new/changed functionality

---------

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2024-04-16 17:22:08 +01:00
gillespi314
be415c1678 Merge branch 'main' into feat-macos-software-updates 2024-04-16 10:24:43 -05:00
gillespi314
754fb17064 Exclude removal operations from declarations subqueries 2024-04-16 10:21:25 -05:00
gillespi314
3b3f815a42 Merge conflicts 2024-04-16 10:20:59 -05:00
Dante Catalfamo
48036577eb
Interpret windows exit codes as a signed integer (#18282)
#17695

The windows exit code is a 32-bit unsigned integer, but the command
interpreter treats it like a signed integer. When a process is killed,
it returns 0xFFFFFFFF (interpreted as -1). We convert the integer to an
signed 32-bit integer to flip it to a -1 to match our expectations, and
fit in our db column.

https://en.wikipedia.org/wiki/Exit_status#Windows

FIxed on both the client and server side.
2024-04-16 10:53:50 -04:00
Victor Lyuboslavsky
f58947012b
In fleetctl debug db-locks and fleetctl debug db-innodb-status, fixed 500 errors (#18285) 2024-04-16 07:52:03 -05:00
Lucas Manuel Rodriguez
e7f61305a9
New APIs to add/remove manual labels to/from a host (#18283)
#16767

To create a manual label:
```sh
cat labels.yml
---
apiVersion: v1
kind: label
spec:
  name: Manually Managed Example
  label_membership_type: manual
  hosts:
    - lucass-macbook-pro.local
```

To add/delete a manual label to/from a host:
```
curl -k -v -X POST -H "Authorization: Bearer $TEST_TOKEN" https://localhost:8080/api/latest/fleet/hosts/1/labels -d '{"labels": ["Manually Managed Example"]}'

curl -k -v -X DELETE -H "Authorization: Bearer $TEST_TOKEN" https://localhost:8080/api/latest/fleet/hosts/1/labels -d '{"labels": ["Manually Managed Example"]}'
```

API draft changes: https://github.com/fleetdm/fleet/pull/16979/files
Figma with error strings:
https://www.figma.com/file/JiWoAiuHlkt76s3o3Uyz6h/%2316767-API-endpoint-for-updating-a-host's-manual-labels?type=design&node-id=2-130&mode=design&t=pxRPhrn6E1bOCrEd-0

- [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)
~- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- ~[ ] If database migrations are included, checked table schema to
confirm autoupdate~
- ~For database migrations:~
- ~[ ] Checked schema for all modified table for columns that will
auto-update timestamps during migration.~
- ~[ ] Confirmed that updating the timestamps is acceptable, and will
not cause unwanted side effects.~
- ~[ ] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).~
- [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)).~
2024-04-16 06:37:58 -03:00
Tim Lee
46f7b6b043
Add Failing Policy Counts to Health API (#17758) 2024-04-15 16:14:21 -06:00
Martin Angers
775fa70c53
Fix Apple profile upload error message when identifier is a duplicate. (#18272)
#18081 

# 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] 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-04-15 16:50:14 -05:00
George Karr
fa5e224a4a
Add feature to resend MDM configuration profiles (#18280)
Includes PRs #18111, #18212, and #18271
2024-04-15 16:48:42 -05:00
Sarah Gillespie
9897649696
Update osquery-perf with DDM functionality (#18273) 2024-04-15 15:56:25 -05:00
Martin Angers
47279ca2a9 Fix conflicts 2024-04-15 16:10:10 -04:00
Sarah Gillespie
ecdcb7c2fb
Add activity item for resend configuration profile (#18271) 2024-04-15 14:18:09 -05:00
Tim Lee
8194b6e379
Optimize cve/generate to use last release (#18269) 2024-04-15 13:17:28 -06:00
Martin Angers
ea0da5e2fa
Add tool to get a profile as defined in Apple BM (#18274) 2024-04-15 15:11:46 -04:00
Tim Lee
a47f59ef36
Implement NVD Feed with Vulncheck Data (#18168) 2024-04-15 09:44:44 -06:00
Gabriel Hernandez
5df04c8cca Merge branch 'main' into feat-resend-config-profile 2024-04-15 11:35:14 +01:00
Sarah Gillespie
03bd837c9c
Add backend to resend host MDM profiles (#18212)
Issue #17897 

# 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/` 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
- [x] Manual QA for all new/changed functionality
2024-04-12 14:34:54 -05:00
Dante Catalfamo
80c906aa69
Windows careful bitlocker selection (#18189)
#17796

Fixes an issue in windows server where selecting from `bitlocker_info`
will cause the query to abort. Bitlocker is not available by default
on some version of windows server, so we first check if the optional
component is enabled before making our query
2024-04-12 10:00:46 -04:00
Jacob Shandling
3f32c870a6
Ignore leading/trailing whitespace when filtering entities; fix url param handling; test broad range of affected endpoints (#17455)
## Addresses #16615 and #18041

### #16615:
- Trim whitespace for backend filtered tables
- Trim whitespace in UI for Queries table search string
<img width="1271" alt="Screenshot 2024-03-06 at 11 46 56 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/b818591c-a977-4203-8adb-3a0d909fcfbb">
<img width="1271" alt="Screenshot 2024-03-06 at 11 47 21 AM"
src="https://github.com/fleetdm/fleet/assets/61553566/3c95b992-31ed-4c12-9763-6f5fc7d78b1f">
<img width="1800" alt="Screenshot 2024-03-06 at 3 18 31 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/05c677a4-80e8-4f94-8abc-235cab4145b7">
<img width="1800" alt="Screenshot 2024-03-06 at 5 05 25 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/4a5529a4-dd5f-463c-97ae-6ceaaaff7f93">


_______________________
### #18041:
#### Global:
![Screenshot 2024-04-03 at 12 21
19 PM](https://github.com/fleetdm/fleet/assets/61553566/9a45a3a6-4136-4851-b887-bd176299d0c2)
 
#### Team:
![Screenshot 2024-04-03 at 12 56
36 PM](https://github.com/fleetdm/fleet/assets/61553566/793c70e7-384b-4705-a373-7e30a5188b03)

#### **Similar fix for `GET` ...`vulnerabilities`**


- [x] Changes file added for user-visible changes in `changes/`
- [x] Add integration tests for all affected endpoints
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-04-10 11:50:08 -07:00
Jacob Shandling
dfe51474cd
BadRequest when no payloads present; BadRequest for invalid payload types (#18169)
## Addresses #17157 
![Screenshot 2024-04-09 at 4 53
22 PM](https://github.com/fleetdm/fleet/assets/61553566/a6a57f55-275f-4a06-89e7-085262d2672c)

- [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-04-10 10:55:38 -07:00
Victor Lyuboslavsky
3859c971cf
Added error messages when scripts are disabled. (#18174)
#17148

Added error messages to lock/unlock/wipe when scripts are disabled.

# Checklist for submitter
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-04-10 11:29:46 -05:00
George Karr
e73fd55c5b
Updating vuln check support (#15174) 2024-04-10 10:04:50 -05:00
Martin Angers
f4d6136236
Ignore pending DDM profiles when waiting to release a device (#18159)
#18160 

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
2024-04-09 17:12:51 -05:00
Victor Lyuboslavsky
3367b7e036
Added orbit_version, fleet_desktop_version, and scripts_enabled to host details. (#18123)
#17361
#17148

In GET fleet/hosts/:id response, added the following fields:
- orbit_version
  - `orbit_version == null` means this agent is not an orbit agent
- fleet_desktop_version
- `fleet_desktop_version == null` means this agent is not an orbit agent
or it is an older version which is not collecting the desktop version
- `fleet_desktop_version == ""` means this agent is an orbit agent but
does not have fleet desktop
- scripts_enabled
- `scripts_enabled == null` means this agent is not an orbit agent or it
is an older version which is not collecting scripts_enabled

In orbit_info table, added the following fields:
- desktop_version
- scripts_enabled

Updated docs for orbit_info PR:
https://github.com/fleetdm/fleet/pull/18135

Updated API docs: https://github.com/fleetdm/fleet/pull/17814

MDM lock/unlock/wipe error messages are not part of this PR. They will
be in a separate PR.

# 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 support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [x] Added/updated tests
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- [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.
- [x] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2024-04-09 16:33:44 -05:00
Martin Angers
7a57618555 Hide the macOS OS Updates DDM profile from the host list of profiles 2024-04-09 15:51:52 -04:00
Martin Angers
c2d565df40 Clarify error message 2024-04-09 13:40:56 -04:00
Martin Angers
c263923eab Explicitly set collation for character columns 2024-04-09 13:17:33 -04:00
Martin Angers
0faa96658c Fix NOT IN reserved names for status 2024-04-09 10:33:21 -04:00
Roberto Dip
f827a4727e
use license.IsPremium to check for premium licenses (#18141)
a license can be considered premium for trials, this replaces
occurrences that used comparison operators to check for premium
licences.
2024-04-09 11:15:22 -03:00
Martin Angers
b88ef81239 Fix search targets test 2024-04-09 10:03:02 -04:00
Martin Angers
47b310000d Add integration test to check update of the payload 2024-04-09 09:47:46 -04:00
Martin Angers
7035c4b09e Fix some comments/indent 2024-04-09 09:30:26 -04:00
Martin Angers
0ca2a45cd4 Use a static identifier, use actual deadline value in payload 2024-04-09 09:18:44 -04:00
Martin Angers
6af79d139d Remove obsolete todo 2024-04-08 17:04:40 -04:00
Martin Angers
671153da32 Finish up the integration test 2024-04-08 16:45:52 -04:00
Martin Angers
ef652f2b96 Test batch-set with declarations 2024-04-08 16:33:10 -04:00
Martin Angers
319e331614 Test that OS updates declaration does not show up in summaries 2024-04-08 15:57:50 -04:00
Martin Angers
c62ed8bd0f Ignore ddm os updates profile for statuses and filters 2024-04-08 15:36:31 -04:00
Sarah Gillespie
05ccf9ee23
Fix issues related to Fleet builtin labels and reserved MDM profile names (#18043) 2024-04-08 14:34:55 -05:00