Commit graph

780 commits

Author SHA1 Message Date
George Karr
db5d553545
Initial fleetctl api command works with GETS and fields (#17971) 2024-05-07 11:22:05 -05:00
George Karr
0b9ec5e322
Adding cli improvements for run-scripts (#18010) 2024-05-07 10:10:22 -05:00
Victor Lyuboslavsky
a3d94c8324
AI generated policy description/resolution (#18713)
Merging feature branch. Each commit into feature branch has already been
reviewed.
2024-05-03 15:23:27 -05:00
Victor Lyuboslavsky
4f4800be19
GitOps remove teams (#18640)
#16677 

Improvements to `fleetctl gitops` command:
- Added the ability to pass multiple files, like `fleetctl gitops -f
file1 -f file2`, where the first file must be the global configuration
- Added the ability to remove teams that were not specified in team
configs using the switch `--delete-other-teams`
- When passing a global config and team config during initial
configuration, the `org_settings.mdm.apple_bm_default_team` value can be
set to match the team that will be created by the provided team config.

After these changes are released to prod, we can update
https://github.com/fleetdm/fleet-gitops to use the new switches: #18692

# 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-05-03 08:03:00 -05:00
Victor Lyuboslavsky
4946c96e77
AI-generated calendar backend changes (#18571)
#18464

Added `/fleet/autofill/policy` endpoint to get autogenerated policy
description and resolution for a given SQL query.

Added `server_settings.ai_features_disabled` setting to disable the
above endpoint.

For Google calendar integration,
- changed the event title to: "💻 🚫 Scheduled maintenance"
- updated event description to include policy description and resolution
if only one policy is failing

# 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

---------

Co-authored-by: Luke Heath <luke@fleetdm.com>
2024-05-02 11:56:54 -05:00
Dante Catalfamo
2c6e7c71a8
Zsh script support (#18411)
#17321
2024-04-30 14:38:56 -04:00
Dante Catalfamo
3aa9437d35
fleetctl get teams prints team id (#18395)
#18394
2024-04-29 09:56:04 -04:00
Rachael Shaw
8bcdd93f2c
Update fleetctl package usage description (#18545)
Slight verbiage change requested by @noahtalerman re: #16512
2024-04-26 15:10:28 -05:00
Roberto Dip
08b5e1c7b5
fixed a bug causing servers with Windows MDM only to crash (#18568) 2024-04-26 10:09:01 -05:00
Lucas Manuel Rodriguez
1b26129465
Delete expired activities in cleanup cron (#18441)
#16989

API draft PR: #17809.
UI draft PR: #18243.

- [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-26 07:22:31 -03:00
Rachael Shaw
0ccc7f6244
Use "Fleet's agent (fleetd)" naming in the CLI (#18528)
For https://github.com/fleetdm/fleet/issues/16512
2024-04-25 10:32:49 -05:00
Jacob Shandling
d7821685a8
Migrate logic from nvdtools into Fleet (#18244)
## Addresses #15999

- [x] Added/updated tests
- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-04-24 15:25:59 -07:00
Tim Lee
79a5baa5a6
Add vuln clean option (#18457) 2024-04-22 12:57:00 -06:00
Roberto Dip
e39f5bce3b
implement logic to sign apple profiles (#16490)
#10418
2024-04-18 18:01:37 -03:00
Lucas Manuel Rodriguez
225a0f8a5c
Revert software failure prob for osquery-perf (#18357)
@xpkoala came across this issue while performing a load test for the
calendar backoff feature with rolling.
It changed our baseline mainly while performing the hosts enrollment
during load tests
2024-04-17 16:11:04 -03:00
George Karr
999e200992
Add feature to manage macOS software updates via DDM (#18281)
Feature branch for #17295
2024-04-16 15:18:40 -05:00
Victor Lyuboslavsky
6b2ab24aeb
Fixed fleetctl gitops dry-run validation issues when enabling calendar integration for the first time. (#18301)
#18299
Fixed fleetctl gitops dry-run validation issues when enabling calendar
integration for the first time.

# 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-04-16 15:15:08 -05: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
3b3f815a42 Merge conflicts 2024-04-16 10:20:59 -05:00
Lucas Manuel Rodriguez
a86da9f74b
Fix enroll request retry in osquery-perf (#18227)
This was discovered by @xpkoala while performing a load test for the
calendar backoff feature.

Some enroll requests were failing due to enrolling hosts too fast (`-var
loadtest_containers` from `0` to `40` at once), and osquery-perf had a
bug in the enroll request where the `bytes.Buffer` was being incorrectly
reused thus sending an empty body on the enroll retries, getting 400s
from Fleet due to `Expected JSON Body`:
```
2024/04/11 18:57:49 request failed: 400
```
2024-04-16 08:39:34 -03: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
Tim Lee
8194b6e379
Optimize cve/generate to use last release (#18269) 2024-04-15 13:17:28 -06:00
Victor Lyuboslavsky
7785aa5070
vulnerabilities.current_instance_checks=no is now an alias for vulnerabilities.disable_schedule=true (#18184)
#16661 
vulnerabilities.current_instance_checks=no is now an alias for
vulnerabilities.disable_schedule=true

PR for doc changes: https://github.com/fleetdm/fleet/pull/18186

# 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.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-04-15 12:10:52 -05:00
Tim Lee
a47f59ef36
Implement NVD Feed with Vulncheck Data (#18168) 2024-04-15 09:44:44 -06: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
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
8a0f87ef3d Rename the builtin label constant 2024-04-08 15:01:22 -04:00
Martin Angers
f5129bfa1a Fix the fix for tests 2024-04-08 11:34:31 -04:00
Martin Angers
f9e1bc2e97 Fix tests 2024-04-08 11:14:30 -04:00
Roberto Dip
f1b45a3865
friday tidy up party (#18106)
- add missing tests
- remove unused code
- remove unnecessary nested branches
2024-04-08 08:42:42 -03:00
Lucas Manuel Rodriguez
e8ca959888
Add enterprise integration test for calendar events (#17900)
Integration tests for the calendar feature: #17441.

Adding coverage screenshots for the calendar cron and the osquery
distributed/write coverage:

![Screenshot 2024-03-27 at 14 20
44](https://github.com/fleetdm/fleet/assets/2073526/40d394ab-2208-4bec-981b-fe22fae8b5c1)
![Screenshot 2024-03-27 at 14 21
20](https://github.com/fleetdm/fleet/assets/2073526/1e4c8611-21ba-48a6-82f8-a163594f7f01)
2024-04-04 14:58:31 -03:00
Victor Lyuboslavsky
af80a7bff7
Reducing max bandwidth by 10% to prevent potential rate limit issues. 2024-04-01 16:31:38 -05:00
Victor Lyuboslavsky
e65fe99316
Ensure each thread has its own calendar struct. 2024-04-01 16:15:20 -05:00
Victor Lyuboslavsky
74968de6e3
Enabling calendar clean up job to delete Google calendar events in parallel. 2024-04-01 15:54:37 -05:00
Lucas Manuel Rodriguez
c0f693c9b2
[osquery-perf] Rename variable and reduce failure prob for software ingestion (#17952)
Fixes from the changes added to #17003.

- 50% failure for the software query was not realistic (changing to 5%).
- 50% failure for the VS Code query was also not realistic (changing to
5%).
- Renamed a wrongly named variable.
2024-03-29 12:18:31 -03:00
Sarah Gillespie
bb0d031ea8
Populate host.MDMInfo when getting host details for Windows host (#17893) 2024-03-29 09:48:31 -05:00
Roberto Dip
e34b320ed5 Merge remote-tracking branch 'origin/main' into feat-macos-ddm 2024-03-27 11:58:22 -03:00
Martin Angers
8abee3e72d
Merge branch 'main' into feat-prefill-account-name 2024-03-27 09:53:02 -04: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
Martin Angers
98bccf54e3 Fix test with expected Google Calendar integration 2024-03-27 08:39:41 -04:00
Martin Angers
b449900602 Regenerate schema.sql 2024-03-27 08:19:21 -04:00
Lucas Manuel Rodriguez
51cd71f464
Fix concurrency bug in calendar cron (#17832)
#17441
2024-03-26 13:39:37 -05:00
Lucas Manuel Rodriguez
9090d8541f
Calendar update event if meeting occurring now (#17815)
#17441

---------

Co-authored-by: Victor Lyuboslavsky <victor.lyuboslavsky@gmail.com>
2024-03-26 13:39:37 -05:00
Victor Lyuboslavsky
2e56563280
Adding retry logic when rate limited by Google Calendar API. (#17810)
Adding retry logic when rate limited by Google Calendar API.
2024-03-26 13:39:37 -05:00
Lucas Manuel Rodriguez
355379aa0b
Fleet calendar process 100 hosts at a time (#17806)
Add concurrency for #17441.
2024-03-26 13:39:37 -05:00
Victor Lyuboslavsky
62049b04bd
Added TestEventForDifferentHost for calendar_cron. (#17802)
Added TestEventForDifferentHost for calendar_cron.
2024-03-26 13:39:37 -05:00
Lucas Manuel Rodriguez
c6e2e8d6c4
Always create event next 3rd Tuesday (#17799)
Fix to always create events for next 3rd Tuesday #17441
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