Commit graph

130 commits

Author SHA1 Message Date
Victor Lyuboslavsky
e2d9a9016c
Add gosimple linter (#23250)
#23249

Add gosimple linter to golangci-lint CI job.
2024-10-29 14:17:51 -05:00
Dante Catalfamo
6e9955d7c7
Add clause to exclude VPP apps from host software list (#23207) 2024-10-28 15:48:54 -04:00
Victor Lyuboslavsky
f85b6f776f
Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
Ian Littman
92bb7ec666
Add policy ID and name to activity for automated software installs, list Fleet as author rather than installer uploader (#22747)
#22424, #22705

TODO: integration test updates

# 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://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#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-10-09 18:15:56 -05:00
Tim Lee
160d11a2cc
Fix Host Software Vulnerability Filter (#21899) 2024-09-13 08:28:26 -06:00
Ian Littman
199dad272b
Add software installer extension column to database (#22017)
#22044 

This is distinct from the filename extension due to being based on
package introspection.

# Checklist for submitter

- [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-09-12 16:22:35 -05:00
Victor Lyuboslavsky
795110962d
Updated ListHostSoftware test and fixed issues. 2024-09-06 16:34:00 -05:00
Victor Lyuboslavsky
7d47cd95d8
Fixed tests 2024-09-06 09:49:36 -05:00
Victor Lyuboslavsky
54840414a2
Updated host_software_installs table. 2024-09-06 09:49:27 -05:00
Dante Catalfamo
031e5b9c71
Delete apps associated with VPP tokens when they're moved or deleted (#21852)
#21804
2024-09-06 09:14:09 -04:00
Victor Lyuboslavsky
23f9065522
Profiles batch activity (#21604)
#20757
API endpoint `/api/v1/fleet/mdm/profiles/batch` will now not log an
activity for profile types that did not change in the database (Apple
configuration profiles, Windows configuration profiles, or Apple
declarations).

Demo video: https://www.loom.com/share/8b75cbd8e7394c12ac6b56746b72c244

# Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated tests
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- [x] Manual QA for all new/changed functionality
2024-08-30 16:00:35 -05:00
Lucas Manuel Rodriguez
fcdda20664
Backend for policy automation to install software (#21650)
#21428

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#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-08-30 14:13:25 -03:00
Martin Angers
e972d38bdc
Bugfix: take VPP apps into account in "self-service" filter and My Device page (#21473) 2024-08-21 16:40:01 -04:00
Tim Lee
d0e271f51f
Bugfix: add filter to counts (#21411) 2024-08-19 16:55:59 -06:00
Tim Lee
c2635fe05b
Add Software Vulnerability Filters (#21312) 2024-08-15 12:36:47 -06:00
Dante Catalfamo
9a5e5372eb
SSVPP Backend and CLI (#21132)
#19882 and #20532
2024-08-14 10:25:32 -04:00
Martin Angers
e65d6cfa06
Bugfix: don't show as available for install a software with an install request once host is moved/installer is deleted (#21064) 2024-08-06 12:31:01 -04:00
Martin Angers
ef07a406cc
Bugfix: list host software "Available for install" filter must show installers that have an install request on the host (#21083) 2024-08-06 10:14:01 -04:00
Victor Lyuboslavsky
438b0ff4d6
Added available_for_install query parameter to host details (#20876)
Missing part of #19447
Added `available_for_install` query parameter to `GET
/api/v1/fleet/hosta/:id/software`

# Checklist for submitter

- [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-07-31 16:27:43 +02:00
Victor Lyuboslavsky
31224ccd34
Added VPP support for iOS/iPadOS (#20837)
#19447 
iOS and iPadOS apps can be installed using Apple's VPP (Volume Purchase
Program)

VPP apps are now using a composite primary key (Adam ID and platform)
because we want to keep iOS/iPadOS/macOS separate. It is possible for
one app to be installable on all Apple platforms.

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#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-07-30 22:43:51 +02:00
Tim Lee
0e9705fdf7
Add No Team to Software Backend (#20822) 2024-07-30 11:19:05 -06:00
Jahziel Villasana-Espinoza
fda37851c1
fix: move last install data into apps and packages (#20664)
> Related issue: #20662

# 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
- [x] Manual QA for all new/changed functionality
2024-07-24 13:39:23 -04:00
Jahziel Villasana-Espinoza
caa7fd74e4
fix: remove temporary functions in tests (#20615)
> Related issue: #20229

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

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-07-19 17:10:03 -04:00
Roberto Dip
87f9a9a3e7
feat: VPP app installation flow (#20448)
> Related issue: #19868 

# 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

---------

Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
2024-07-18 18:35:26 -04:00
Martin Angers
b8b03b1e5a
VPP: update list software titles/list host's software response payloads (#20553)
#20536 

# Checklist for submitter

- [ ] 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

---------

Co-authored-by: Roberto Dip <rroperzh@gmail.com>
Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
2024-07-18 14:33:07 -07:00
Martin Angers
75bdc05f5d
VPP: unify List host's software and List my device's software response payload (#20519) 2024-07-16 16:52:04 -04:00
Martin Angers
0f9a549ed4
VPP: add VPP apps to list host's software endpoint (#20483) 2024-07-16 16:18:44 -04:00
Tim Lee
2ea369c093
Custom Vulnerability Matching (#20118) 2024-07-09 11:50:22 -06:00
Tim Lee
812140a760
Add createdAt to Vulnerability responses (#20019) 2024-07-09 11:09:16 -06:00
Jahziel Villasana-Espinoza
57fa67c8c0
fix: filter by vulnerable software (#20241)
> Related issue: #20050

# 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

---------

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-07-09 10:02:49 -04:00
Tim Lee
2d6458b3f8
Custom Ubuntu Kernel Vuln Scanning (#19588) 2024-06-17 15:44:01 -06: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
Gabriel Hernandez
af88da49bc Merge branch 'main' into feat-software-self-service 2024-05-31 18:15:19 +01:00
Victor Lyuboslavsky
b3f0d07e51
Improved software ingestion performance by deduplicating incoming software. (#19325)
#11942 

To check if you have duplicate software, install multiple python
versions, like:
```shell
brew install python@3.11
brew install python@3.12
```

Then query: `SELECT * FROM python_packages` to see the packages with the
same versions but different paths.

# 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-05-30 13:14:49 -05:00
Martin Angers
6b9fecf172 Fix conflicts 2024-05-29 16:08:51 -04:00
Martin Angers
0b9b8c6279
Software SS: Add missing data to device software endpoints (#19304) 2024-05-29 08:54:48 -04:00
Martin Angers
16c4e0c411
Software SS: add self-service filter to list software titles and list host's/device's software (#19186) 2024-05-27 10:53:41 -04: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
Sarah Gillespie
8cc3d7dd4f
Update list host software to omit software installers for other platforms (#19088) 2024-05-16 17:09:41 -05:00
Roberto Dip
1ef19e4ff2 Merge remote-tracking branch 'origin/main' into feat-software-installers 2024-05-15 19:55:02 -03: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
Roberto Dip
da85d91551
add counts to host software endpoints (#18995)
part of #18677

# 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-05-15 09:55:27 -03:00
Sarah Gillespie
2a4b00b349
Add software installer details to get software title API response and add software install status filter to list hosts API (#18748) 2024-05-08 15:52:35 -05: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
Martin Angers
7bb726ba8e
Create and return upcoming/past host activities for software installs (#18772) 2024-05-07 11:28:16 -04:00
Martin Angers
874c3cd811
Add orbit endpoint to receive results of a software installation attempt (#18689)
#18675
2024-05-03 13:03:59 -03:00
Martin Angers
ad11f075c1
Add API endpoint to list host/device software (#18676) 2024-05-01 14:37:52 -04:00
Jacob Shandling
1cf7362968 Merge branch 'main' into 15919-vulnerabilities-page 2024-02-21 10:58:58 -08:00
Victor Lyuboslavsky
35ca4ee32b
Add team filter to software detail APIs (#16876)
#16787
2024-02-18 07:14:20 -06:00
Gabriel Hernandez
119d1df76f
add permission check to software titles/versions endpoints (#16561)
relates to #16052

This adds a team permission check the `GET software/titles/:id`
endpoint. If the user should not be able to get the software title if it
is not on a host that is on the same team as the user (e.g. software
title 1 is on host 1, which is on team 1. A user who is only on team 2
should get a 403 response)

The UI is also updated to show the access denied error page when the we
receive a 403 response for the software title

<!-- 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

---------

Co-authored-by: Roberto Dip <dip.jesusr@gmail.com>
Co-authored-by: Roberto Dip <me@roperzh.com>
2024-02-15 17:22:27 -03:00