Commit graph

2077 commits

Author SHA1 Message Date
Jacob Shandling
c73904ec8c
UI – Place all TooltipWrapper tooltips on the bottom (#19002)
## Addresses #18741 
<img width="727" alt="Screenshot 2024-05-14 at 3 26 20 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/671c680e-00db-4481-a7b3-5425bf6a610d">

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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-05-24 14:30:54 -07:00
Sharon Katz
f75f0776e6
additional stats (#19078)
Additional telemetry stats to report to Heroku.
FYI - @eashaw, we could later add to datadog as well.

---------

Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
2024-05-24 15:06:10 -04:00
Victor Lyuboslavsky
addbceece0
Activity feed webhooks backend (#19261)
This is a redo of the already-approved PR
https://github.com/fleetdm/fleet/pull/19125

The difference is that this merge is into main as opposed to the feature
branch.
2024-05-24 11:25:27 -05:00
Jacob Shandling
886d53412b
UI – Queries table: Fix issues with filter/sorting, optimize render behavior (#18973)
## Addresses #18881 and #18858
- Fix the bugs, memoize various props to optimize table rendering

## QA
In addition to the bugs outlined in the addressed issue, this PR
contains rendering optimizations. Please check these functionalities,
which should be unaffected (and were so in my own testing) but should be
double-checked:

- [ ] create query
- [ ] delete query
- [ ] empty state
- [ ] changing platform dropdown
- [ ] different sort orders
- [ ] delete query from table action
- [ ] results count change

## Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-05-23 13:30:24 -07:00
Jacob Shandling
a31cde9f2c
Exclude host_ids field from label responses when it is empty, which is the case for the list labels endpoint (#19190)
## Addresses #18515 
<img width="989" alt="Screenshot 2024-05-21 at 4 11 53 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/99f137a1-50cf-4cfb-a3e1-0ed13264c963">


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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-05-23 13:29:46 -07:00
Victor Lyuboslavsky
67ab732867
Optimizing MySQL master DB based on customer feedback (#19075)
#18838

1. During software ingestion, switched to updating `last_updated_at` as
a batch for 1 host.
2. Removed `DELETE FROM software` statement that ran for every host
update (where software was deleted). This is only done now during the
vulnerability job.

# 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-23 14:45:50 -05:00
Roberto Dip
987b64a0c7
update to go1.22.3 + dependencies (#19142)
For #16795, this:

- Updates Go to go1.22.3
- Per
https://github.com/fleetdm/fleet/issues/16795#issuecomment-2100450618, I
also ran the following to update the versions requested by @getvictor

```
go get github.com/kataras/golog@v0.1.12
go get github.com/kataras/iris/v12@v12.2.11
go get github.com/sethvargo/go-password@v0.3.0
```

**Notes**

After this is merged people will need to update their Go version. I use
gvm and I did it like:

```
$ gvm install go1.22.3
$ gvm use go1.22.3 --default
```

**Relevant changes**

The release notes mention:

> Previously, the variables declared by a “for” loop were created once
> and updated by each iteration. In Go 1.22, each iteration of the loop
> creates new variables, to avoid accidental sharing bugs.

However, we already have a lint rule (see
https://github.com/fleetdm/fleet/pull/13877) for this scenario, so it
shouldn't affect us.
2024-05-23 16:23:38 -03:00
Luke Heath
a540e0e38b
Adding changes for Fleet v4.50.0 (#19191) 2024-05-23 11:11:28 -05:00
Benjamin Edwards
677835e2c3
support external id in STS Assume Role calls (#18901) 2024-05-21 13:19:35 -04:00
Martin Angers
44858152aa
Bugfix: only count hosts that user has permission to see in count field of label endpoints (#18859) 2024-05-21 12:02:08 -04:00
Jahziel Villasana-Espinoza
180753e6c3
fix: team filter not working for uploaded software (#19159)
> Related issue: #19153

# 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-05-20 18:17:38 -04:00
Roberto Dip
7559944ec7
fix device SCEP renewal cron if a host is deleted (#19158)
for #19149
2024-05-20 18:11:17 -03:00
Jahziel Villasana-Espinoza
bdf2604377 chore: changes file 2024-05-20 16:07:08 -04:00
Roberto Dip
8d9dcafbbc Merge remote-tracking branch 'origin/main' into feat-software-installers 2024-05-16 17:23:39 -03:00
Jacob Shandling
df7e8fc64a
UI - sort host queries case-insensitively (#19004)
## Addresses #18953 

<img width="727" alt="Screenshot 2024-05-14 at 4 30 58 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/d60ed18a-e0ad-4a55-86f6-db3b6bb8e707">


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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-05-16 12:52:47 -07:00
Jacob Shandling
7cc39cdc3e
UI – Only render SW version tooltip for > 1 version (#19003)
## Addresses #18852 

![Screenshot-2024-05-14-at-41502PM](https://github.com/fleetdm/fleet/assets/61553566/04e2ae9c-613e-49ba-95df-e2915e1427df)

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

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-05-16 12:52:39 -07:00
Roberto Dip
1ef19e4ff2 Merge remote-tracking branch 'origin/main' into feat-software-installers 2024-05-15 19:55:02 -03:00
Jahziel Villasana-Espinoza
01898fd176
fix: typos in scripts (#19045)
Feature cleanup

# 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] Manual QA for all new/changed functionality
2024-05-15 16:36:31 -04:00
Jahziel Villasana-Espinoza
40dc8e57ed
fix: add missing software_package field (#18998)
No related issue, just cleanup work on the feature

# 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-05-15 13:41:35 -04:00
Victor Lyuboslavsky
825e785821
Optimizations to reduce MySQL writer DB load (#18880)
#18838 and #18986
Optimized master DB accesses during host software ingestion.

# 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-15 10:34:21 -05:00
Jacob Shandling
5acbfab566
Update MS vulnerability details links to point to NVD (#18991)
## Addresses #18470 

- [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-05-14 16:00:33 -07:00
Martin Angers
1def5b2ddf
Add support for software installers in fleetctl gitops (#18990) 2024-05-14 16:58:58 -04:00
Victor Lyuboslavsky
8d253fe19a
Updating user now updates activity feed. (#18962)
#18766
Fixed a bug where updating user via `/api/v1/fleet/users/:id` endpoint
sometimes did not update the activity feed and returned the un-updated
user object.

You must use a DB configuration with a replica to reproduce the issue.

# 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-05-14 15:06:23 -05:00
Jahziel Villasana-Espinoza
6b31b71c93
18531 failed mdm profs (#18930)
> Related issue: #18531
2024-05-14 14:19:14 -05:00
RachelElysia
fe8167538d
[released bug] Fleet free UI: Hide Software > Vulnerabilities > Severity column and Exploited vulnerabilities dropdown option (#18952) 2024-05-14 14:46:55 -04:00
RachelElysia
1d6eea0459
[small released bug] UI: Linux OSs show linux icon in OS table (#18947) 2024-05-14 14:45:32 -04:00
Victor Lyuboslavsky
2bc511b6e6
Removed unsupported detailed queries for fleetd-chrome hosts. (#18945)
#18944
# 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.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-05-13 12:23:17 -05:00
Sarah Gillespie
fa2b295a5e
Update UI to support filtering by software install status (#18888) 2024-05-10 10:57:47 -05:00
Victor Lyuboslavsky
62361329ec
Allow applying built-in label specs without modifications. (#18804)
#18477 

Built-in labels can now be applied via `fleetctl apply` as long as no
changes are made to them. This allows the following workflow:
  1. `fleetctl get labels --yaml > labels.yml`
  2. (Optional) Edit/add non-built in labels in labels.yml
  3. fleetctl apply -f labels.yml

# 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: Tim Lee <timlee@fleetdm.com>
2024-05-09 11:47:50 -05:00
Lucas Manuel Rodriguez
a1f77e01e5
Add support for escaping $ in gitops yamls (#18845)
#18467

- [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.
- ~[ ] 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-05-09 12:29:16 -03:00
Tim Lee
7bba061ad2
Bugfix: Use hyphen delimiter in resolved_in_version (#17683) 2024-05-09 06:49:55 -06:00
RachelElysia
184c41fbb6
Fleet UI: Fix reversed accordion text (#18767) 2024-05-08 15:55:18 -04:00
Martin Angers
8367166278
Add uninstalled but available software installers to the "List software titles" API (#18842) 2024-05-08 12:41:57 -04:00
Victor Lyuboslavsky
abf4837eff
Broke apart the hourly host_software count query to reduce the individual query runtime (#18773)
#18221
Broke apart the hourly host_software count query to reduce the
individual query runtime. This fixes timeouts seen when host_software
table has over 25 million records.

I recommend hiding whitespace during review:
<img width="240" alt="image"
src="https://github.com/fleetdm/fleet/assets/2685025/6da9b643-8582-4d2f-bf32-8a1cc38f1032">


# 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-05-08 09:27:17 -05:00
Jahziel Villasana-Espinoza
c88a7cf6b0
feat: software added and deleted global activities (#18798)
> Related issue: #18330 

# 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

## Notes
- ~I added an `includeTitle bool` parameter to
`ds.GetSoftwareInstallerMetadata`. This allows for the title of the
software (from the `software_titles` page) to be fetched in
`svc.DeleteSoftwareInstaller` without an additional call to the DB.~ We
wound up deciding to just fetch the title every time.

---------

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2024-05-08 10:08:28 -04:00
Victor Lyuboslavsky
a453979202
Updated macadmins and added new tables. (#18819)
#18808 
Added the new `sofa_security_release_info` and `sofa_unpatched_cves`
tables from `macadmins/osquery-extension` 1.0.1

These tables do not have detailed documentation in macadmins repo, so
not adding documentation at this point.

# 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] 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-05-08 08:57:16 -05:00
Martin Angers
4f9363fd78
Add cron job to cleanup unused software installers (#18812) 2024-05-07 16:50:44 -04:00
RachelElysia
f71aae8c87 Feature branch with changelog only 2024-05-07 15:42:04 -04:00
RachelElysia
e92e76aee3
Revert "Feature: 15605 merge inherited queries and policies" 2024-05-07 13:30:39 -04:00
RachelElysia
9e66ef6b34
Feature: 15605 merge inherited queries and policies (#18801)
## Issue
Feature branch including all frontend and backend of #15605
2024-05-07 13:07:54 -04:00
RachelElysia
4ea5ea9f00
Revert "Feature: 15605 merge inherited queries and policies" (#18800)
Reverts fleetdm/fleet#18771

(Because of accidental squash and merge of feature dev by 3 of us only has my name on it)
2024-05-07 12:47:12 -04:00
Roberto Dip
e5283ef2a8 Merge remote-tracking branch 'origin/main' into feat-software-installers 2024-05-07 13:37:29 -03:00
George Karr
db5d553545
Initial fleetctl api command works with GETS and fields (#17971) 2024-05-07 11:22:05 -05:00
RachelElysia
434239e5f9
Feature: 15605 merge inherited queries and policies (#18771) 2024-05-07 12:10:06 -04:00
Victor Lyuboslavsky
9a6b2f655e
Fixed MySQL sort buffer overflow when fetching activities. (#18782)
#12619

Fixed MySQL sort buffer overflow when fetching activities. This issue
happened when activities contained very large details, such as large SQL
queries.

# 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
  - Existing tests provide sufficient coverage
- [x] Manual QA for all new/changed functionality
2024-05-07 10:53:24 -05:00
Martin Angers
7bb726ba8e
Create and return upcoming/past host activities for software installs (#18772) 2024-05-07 11:28:16 -04:00
George Karr
0b9ec5e322
Adding cli improvements for run-scripts (#18010) 2024-05-07 10:10:22 -05:00
Jahziel Villasana-Espinoza
f85eb0aaff
feat: get install results endpoint (#18751)
> Related issue: #18335
2024-05-06 16:09:25 -03:00
RachelElysia
c2be147ae9 Feature branch with changelog only 2024-05-06 12:26:09 -04:00
Victor Lyuboslavsky
9c714c544d
Optimized policy_stats updates to NOT lock the policy_membership table (#18720)
#16562

Optimized policy_stats updates to NOT lock the policy_membership table.
This should improve deployment performance with many global policies and
team hosts.

The original implementation that used INSERT ... SELECT (SELECT
COUNT(*)) ... caused performance issues. Given 50 global policies, 10
teams, and 10,000 hosts per team, the INSERT query took 30-60 seconds to
complete. Since it was an INSERT query, it blocked other hosts from
updating their policy results in policy_membership.

Now, we separate the INSERT from the SELECT, since SELECT by itself does
not block other hosts from updating their policy results. In addition,
we process one global policy at a time, which reduces the time to
complete the SELECT query to <2 seconds, and limits the memory usage. We
are not using a transaction to reduce locks. This means that INSERT may
fail if the policy was deleted by a parallel process. Also, the INSERT
may overwrite a clearing of the stats. This is acceptable, since these
are very rare cases. We log and proceed in that case.


# 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-06 09:48:37 -05:00