Commit Graph
10474 Commits
Author SHA1 Message Date
Martin Angers 9c37db2a05 Remove unnecessary nested transactions in batch-set of MDM profiles (#16449) 2024-02-05 10:51:32 -05:00
Roberto Dip fa89dff66f fix race in orbit test (#16589)
The scheduled test run
https://github.com/fleetdm/fleet/actions/runs/7764392848 failed with a
panic because `TestWindowsMDMEnrollmentPrevented` timed out:

```
2024-02-03T05:05:26.3041218Z === RUN   TestWindowsMDMEnrollmentPrevented
2024-02-03T05:05:26.3044251Z === RUN   TestWindowsMDMEnrollmentPrevented/{RenewEnrollmentProfile:false_RotateDiskEncryptionKey:false_NeedsMDMMigration:false_NeedsProgrammaticWindowsMDMEnrollment:true_WindowsMDMDiscoveryEndpoint:http://example.com/_NeedsProgrammaticWindowsMDMUnenrollment:false_PendingScriptExecutionIDs:[]_EnforceBitLockerEncryption:false}
2024-02-03T05:05:26.3047208Z coverage: 2.5% of statements in github.com/fleetdm/fleet/v4/...
2024-02-03T05:05:26.3047963Z panic: test timed out after 1h0m0s
2024-02-03T05:05:26.3048482Z running tests:
2024-02-03T05:05:26.3049005Z 	TestWindowsMDMEnrollmentPrevented (59m52s)
2024-02-03T05:05:26.3052172Z 	TestWindowsMDMEnrollmentPrevented/{RenewEnrollmentProfile:false_RotateDiskEncryptionKey:false_NeedsMDMMigration:false_NeedsProgrammaticWindowsMDMEnrollment:true_WindowsMDMDiscoveryEndpoint:http://example.com/_NeedsProgrammaticWindowsMDMUnenrollment:false_PendingScriptExecutionIDs:[]_EnforceBitLockerEncryption:false} (59m52s)
[...]
2024-02-03T05:05:26.3068624Z goroutine 69 [chan receive]:
2024-02-03T05:05:26.3069997Z github.com/fleetdm/fleet/v4/orbit/pkg/update.TestWindowsMDMEnrollmentPrevented.func2.1({{0xe3ada3, 0x12}, {0x0, 0x0}, {0xe37311, 0xc}})
2024-02-03T05:05:26.3072376Z 	/home/runner/work/fleet/fleet/orbit/pkg/update/notifications_test.go:295 +0x65
2024-02-03T05:05:26.3074514Z github.com/fleetdm/fleet/v4/orbit/pkg/update.(*windowsMDMEnrollmentConfigFetcher).attemptEnrollment(0xc0000f8cf0, {0x0, 0x0, 0x0, 0x1, {0xe3ada3, 0x12}, 0x0, {0x0, 0x0, ...}, ...})
```

I was able to reproduce locally 1/4th of the times, after putting the
following print statements:

```diff
                        if cfg.NeedsProgrammaticWindowsMDMEnrollment {
                                fetcher.execEnrollFn = func(args WindowsMDMEnrollmentArgs) error {
-                                       <-chProceed    // will be unblocked only when allowed
+                                       fmt.Println("fetcher.execEnrollFn A: ", apiCallCount)
+                                       <-chProceed // will be unblocked only when allowed
+                                       fmt.Println("fetcher.execEnrollFn B: ", apiCallCount)
                                        apiCallCount++ // no need for sync, single-threaded call of this func is guaranteed by the fetcher's mutex
                                        return apiErr
                                }
@@ -301,7 +303,9 @@ func TestWindowsMDMEnrollmentPrevented(t *testing.T) {
                                }
                        } else {
                                fetcher.execUnenrollFn = func(args WindowsMDMEnrollmentArgs) error {
-                                       <-chProceed    // will be unblocked only when allowed
+                                       fmt.Println("fetcher.execUnenrollFn A: ", apiCallCount)
+                                       <-chProceed // will be unblocked only when allowed
+                                       fmt.Println("fetcher.execUnenrollFn B: ", apiCallCount)
                                        apiCallCount++ // no need for sync, single-threaded call of this func is guaranteed by the fetcher's mutex
                                        return apiErr
                                }
@@ -317,23 +321,33 @@ func TestWindowsMDMEnrollmentPrevented(t *testing.T) {

                        started := make(chan struct{})
                        go func() {
+                               fmt.Println("before close started")
                                close(started)
+                               fmt.Println("aftre close started")

                                // the first call will block in enroll/unenroll func
+                               fmt.Println("before inner fetchergetconfig")
                                cfg, err := fetcher.GetConfig()
+                               fmt.Println("after inner fetchergetconfig")
                                assertResult(cfg, err)
                        }()

+                       fmt.Println("before started")
                        <-started
+                       fmt.Println("after started")
                        // this call will happen while the first call is blocked in
                        // enroll/unenrollfn, so it won't call the API (won't be able to lock the
                        // mutex). However it will still complete successfully without being
                        // blocked by the other call in progress.
+                       fmt.Println("before first fetchergetconfig")
                        cfg, err := fetcher.GetConfig()
+                       fmt.Println("before first fetchergetconfig")
                        assertResult(cfg, err)

                        // unblock the first call and wait for it to complete
+                       fmt.Println("before close chProceed 1")
                        close(chProceed)
+                       fmt.Println("after close chProceed 2")
                        time.Sleep(100 * time.Millisecond)
```

This is the output I've got every time the test hung:

```
before started
before close started
aftre close started
after started
before first fetchergetconfig
before inner fetchergetconfig
after inner fetchergetconfig
fetcher.execEnrollFn A:  0
```

And this is the output when the tests passed

```
before started
before close started
aftre close started
before inner fetchergetconfig
fetcher.execUnenrollFn A:  0
after started
before first fetchergetconfig
before first fetchergetconfig
before close chProceed 1
after close chProceed 2
fetcher.execUnenrollFn B:  0
after inner fetchergetconfig
fetcher.execUnenrollFn A:  1
fetcher.execUnenrollFn B:  1
```

Note how the deadlock occurs when `GetConfig` is called first outside of
the goroutine. I added some logic to prevent this, but I'm confident
there must be a better way to accomplish the same. cc: @mna you're the
king of concurrency, do you have any ideas?
2024-02-05 12:06:25 -03:00
Martin Angers 9abb572194 Rename mdm profiles updated_at to uploaded_at and remove automatic setting (#16425) 2024-02-05 10:01:38 -05:00
Jahziel Villasana-EspinozaandRoberto Dip fa46cfba20 fix: filter out software from parallels vm (#16520)
> Related issue: #15855

I followed a similar pattern to `sanitizeSoftware`, a function that
modifies the `Software`. I was originally going to update
`sanitizeSoftware` itself, but decided against it
1. to avoid making lots of changes to the function signature and
internals
2. because the logic this issue requires is pretty different from what
`sanitizeSoftware` is trying to do, so seemed to warrant its own
function.

# 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/` 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

---------

Co-authored-by: Roberto Dip <me@roperzh.com>
2024-02-05 10:00:08 -05:00
Noah Talerman 9069850585 Docs and articles: Remove Windows MDM feature flag (#16399)
- Remove feature flag from the docs and articles (it no longer exists)
- Remove mention of Windows MDM not being ready for production
2024-02-05 09:11:45 -05:00
Roberto Dip efe68e2c66 fix puppet tests and add CI workers (#16529)
for #16059
2024-02-05 09:50:18 -03:00
Roberto Dip d4ef9be990 fix query generation for docs + update them (#16537)
this fixes the `go:generate` directive + adds the changes for the files
generated automatically after running `make generate-doc`
2024-02-05 09:50:05 -03:00
Roberto Dip e35d1dacbd improve validation of windows profiles (#16563)
for #16316, this improves the XML validation of Windows profiles and
ensures we support two ways of embedding XML:

- Escape the XML
- Use a wrapping `<![CDATA[ ... ]]>` element
2024-02-05 09:49:55 -03:00
Lucas Manuel Rodriguez 5360029d67 Allow custom osquery database on fleetd (#16554)
#16014

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [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-02-05 09:41:06 -03:00
Victor LyuboslavskyandRachael Shaw 78911e9595 Updated docs for PATCH teams/:id/users (#16336)
Updated docs for PATCH teams/:id/users
#16275

---------

Co-authored-by: Rachael Shaw <r@rachael.wtf>
2024-02-04 14:52:45 -06:00
Mike McNeilandSampfluger88 10bac0c469 Handbook: Event strategy (#16587)
Co-authored-by: Sampfluger88 <sampfluger88@gmail.com>
2024-02-03 23:22:42 -06:00
Noah Talerman c1fb5c549c Pricing page: Add "Variable agent versions" (#16513)
- Add item for pricing page for the "Remotely configure fleetd update
channels in agent options" (#13825) feature
  - Fleet Premium only
2024-02-03 21:18:20 -06:00
Sam Pfluger 6b26e67a1f Update why-this-way.md (#16586) 2024-02-03 18:55:14 -06:00
Sam PflugerandMike McNeil 3e1683cde5 Demand update (#16568)
Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
2024-02-03 18:37:20 -06:00
Noah Talerman 39f58b5805 Update features.yml (#16578)
Updates made during "🪶 Feature checkpoint" call on 2024-02-02

- Fold in internal commitments (Q1 product design OKRs)
- Update other feature commitments
2024-02-03 18:20:11 -06:00
Jacob ShandlingandJacob Shandling c086d5a231 Make "create_n_policies" script (#16517)
## Tool for testing policies-related features

When you just need a bunch of random policies:
<img width="1487" alt="Screenshot 2024-01-31 at 1 30 54 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/77165bb9-8194-44e5-b57f-9e691de44785">

<img width="948" alt="Screenshot 2024-01-31 at 1 31 17 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/ad72ae8c-926f-461f-8824-53b8ae0d4c2f">


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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-02-02 16:26:47 -08:00
Eric c5736af55e Website: fix incorrect conditional statement in Datadog script (#16583)
Changes:
- Updated a conditional statement in the
`send-aggregated-metrics-to-datadog` script. (`===` » `!==`)
2024-02-02 18:22:49 -06:00
Roberto Dip db58539c9d set exit_code = -1 for scripts that are pending before upgrade to 4.44.0 (#16581)
for https://github.com/fleetdm/fleet/issues/16547

# 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-02-02 21:20:56 -03:00
Victor Lyuboslavsky dbf53cae6a Policies are now unique for (team_id, name). (#16501)
#13643 

Updating the `policies` table to use a checksum column for uniqueness.
The checksum is computed with team_id (which may be null) and name. This
change is modeled on the checksum in the software table.

# 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/` 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-02-02 17:41:32 -06:00
Eric b7a85fba48 Website: Update usage analytics sent to Datadog (#16572)
Related to: #16458

Changes:
- Updated the receive-usage-analytics webhook not to send metrics to
Datadog.
- Updated the send-aggregated-metrics-to-datadog script to build
aggregated metrics from the JSON values reported by Fleet instances
(stored errors, host count by orbit version, host count by osquery
version, host count by operating system), and updated the script to not
report metrics from Fleet instances using the development premium
license key.
2024-02-02 17:23:33 -06:00
Roberto Dip d479f93f49 add internal docs to set end user email (#16573)
for #15057
2024-02-02 18:13:07 -03:00
Roberto Dip 7ddf275a64 fix treatment of sync scripts + prevent running expired scripts on fleet upgrade (#16567)
for #16547

# 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] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] Added/updated tests
- 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-02-02 17:57:46 -03:00
Noah Talerman ffa929b24d Server configuration docs: enable_scheduled_query_stats (#16571)
- Clearly document the behavior for `enable_scheduled_query_stats`
2024-02-02 15:49:53 -05:00
Noah Talerman 558ef6497f fleetdm.com/tables: Add Fleet override for process_file_events docs (#16503)
- To address the bug, we decided to document the current behavior: The
`process_file_events table` will only emit events for changes and files
in directories that existed before osquery starts.
2024-02-02 15:47:23 -05:00
Rachael Shaw 669f796d3a Document how performance indicator text is determined (#16553)
Proposing this as a potential resolution for
https://github.com/fleetdm/fleet/issues/16123.
 
The only place we talk about performance impact in the docs is
[here](https://fleetdm.com/docs/get-started/faq#will-fleet-slow-down-my-servers-what-about-my-employee-laptops),
and it feels too high-level to include these details.

Since that FAQ section links to this article for more information about
performance impact, this seems like the most appropriate place to
document that info without adding surface area to the conceptual docs.

Code for displaying performance impact:
https://github.com/fleetdm/fleet/blob/7da9019f4d06fe088fca8dab1bb39e30a42d04bb/frontend/utilities/helpers.tsx#L691-L706
2024-02-02 13:03:43 -06:00
George KarrandLuke Heath af354863d6 Update engineering handbook README.md with deep freeze (#16550)
...

---------

Co-authored-by: Luke Heath <luke@fleetdm.com>
2024-02-01 22:24:28 -06:00
Eric fc8c78ae77 Website: Fix homepage image border and background. (#16559)
Closes: https://github.com/fleetdm/fleet/issues/16558

Changes:
- Updated the styles for the boxes in the "An open interface for every
endpoint" callout box on the homepage to resolve a bug affecting older
browser versions.
2024-02-01 19:15:54 -06:00
Eric 9ac8ab203a Website: Update endpoints box on homepage, center hero image on /endpoint-ops (#16555)
Closes: #16548

Changes:
- Updated the styles of the "An open interface for every endpoint"
callout box on the homepage to resolve a browser compatibility issue
- Removed the left padding from the hero image on /endpoint-ops on
smaller screen sizes to keep the image centered.
2024-02-01 17:17:13 -06:00
Marko Lisica cb593d4818 Fix broken link in MDM section (#16507) 2024-02-01 17:11:11 -06:00
Victor Lyuboslavsky 7da9019f4d Updated enroll-hosts.md for MSI generation on macOS. (#16459)
Doc update for #15463
2024-02-01 15:23:36 -06:00
Victor Lyuboslavsky f49f37e755 Updating wa-sqlite to latest version. (#16484)
This is a speculative fix for #16394 RuntimeError, which was coming from
wa-sqlite web assembly code.

# 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/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
2024-02-01 15:21:46 -06:00
JDandAndrew Baker 9c8699673b Article WS1 and Fleet (#16534)
Article: A comparative look at VMware Workspace One and Fleet Device
Management https://github.com/fleetdm/confidential/issues/5180

Note: this currently links to our [migration
guide](https://fleetdm.com/docs/using-fleet/mdm-migration-guide#migration-guide)
in docs, until [another
guide](https://github.com/fleetdm/confidential/issues/5180#issuecomment-1917876455)
can be created.

---------

Co-authored-by: Andrew Baker <89049099+DrewBakerfdm@users.noreply.github.com>
2024-02-01 09:24:53 -08:00
JD 3d92503c7b Article config-less fleetd deployment (#16514)
Config-less `fleetd` agent deployment
https://github.com/fleetdm/fleet/issues/13670
2024-02-01 09:07:37 -08:00
Eric 2caabbe34f Website: Update testimonial video thumbnails (#16483)
Closes: #16360

Changes: 
- Updated the play button on the thumbnails for the testimonial videos
on the homepage to be a separate image.
- Removed three unused images (old versions of video thumbnails)
2024-02-01 10:53:14 -06:00
Noah Talerman b79c59e554 Update copy for success notification when running script (#16531) 2024-02-01 09:44:56 -06:00
Mike McNeil e8a1e2760b Update product-groups.md (#16528)
# 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/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Documented any permissions changes (docs/Using
Fleet/manage-access.md)
- [ ] 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.
- [ ] 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.
- [ ] 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-02-01 03:31:51 -06:00
Mike McNeil 83c5a7d886 Update product-groups.md (#16527)
# 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/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Documented any permissions changes (docs/Using
Fleet/manage-access.md)
- [ ] 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.
- [ ] 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.
- [ ] 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-02-01 03:09:18 -06:00
Mike McNeil 4c5eca5950 Update leadership.md (#16526)
# 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/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Documented any permissions changes (docs/Using
Fleet/manage-access.md)
- [ ] 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.
- [ ] 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.
- [ ] 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-02-01 02:56:03 -06:00
Eric c935fdf099 Website: Add three videos to testimonials configuration (#16485)
Closes: #16429

Changes:
- Added links to YouTube videos to three testimonials ...
2024-01-31 22:57:07 -06:00
Sharon Katz af2a2f3f79 Fix CIS documentation link (#16456)
...
2024-01-31 22:55:33 -06:00
Joanne Stableford 947f7e4c9f Add "The numbers" to rituals in BizOps page (#16477)
...
2024-01-31 22:53:32 -06:00
Joanne StablefordandSam Pfluger f54b5ff946 Adding compensation change responsibility to BizOps page (#15922)
Moving the responsibility steps from communications page to BizOps page,
and updating for recent changes....

---------

Co-authored-by: Sam Pfluger <108141731+Sampfluger88@users.noreply.github.com>
2024-01-31 22:48:49 -06:00
Eric 65a1655512 Website: update homepage product category section (#16509)
Closes: #16267

Changes:
- Removed the category switch on the homepage and updated the layout of
the product category blocks.
2024-02-01 09:47:33 +09:00
Noah Talerman 08497bd5fe Update rest-api.md (#16508)
- Update titles for enroll secret endpoints
- Use “list” for many and “get” for single
- No articles (“a” or “the”) in titles to make them shorter
2024-01-31 18:54:27 -05:00
Mike McNeil d2a55219b3 Update fleetctl-preview.ejs (#16523) 2024-01-31 17:40:57 -06:00
Eric 50a6a64045 Website: update parallax component (#16521)
Closes: #16494

Changes:
- Updated the parallax-city component to use jquery for DOM manipulation
and event handlers.
- Updated the names of functions in the parallax city component to match
website naming conventions.
- Removed the isMobile prop from the parallax-city component, it now
uses bowser directly.
2024-01-31 17:40:08 -06:00
Rachael Shaw 6c6364b5af Update error message when scripts are disabled for a host (#16301)
In newer designs, we are moving toward always using the phrase "the
fleetd agent" in place of "a Fleet installer", so updating this existing
error message to reflect that.
2024-01-31 16:39:18 -06:00
Luke Heath 668fe41611 Prepare v4.44.0 (#16486) 2024-01-31 16:11:22 -06:00
Luke Heath 93ed597345 Update and rename smoke-tests.md to release-qa.md (#16283) 2024-01-31 14:56:27 -06:00
Joanne Stableford a64cf58aff Update the language regarding consultant onboarding (#15949)
Point to correct issue template, and provide context on what the
manager/instigator will need to provide.
2024-01-31 15:20:20 -05:00