Commit graph

30 commits

Author SHA1 Message Date
Scott Gress
176f39c247
Update script test "golden" files (#36129)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #36111

The updates in https://github.com/fleetdm/fleet/pull/36111 caused some
tests to start failing. I ran the suggested script:

```
go test ./pkg/file/... -update
```

and verified that the changes match the changes in the above PR
[here](https://github.com/fleetdm/fleet/pull/36111/files#diff-09e225a2a28fbf997ddf571274119a20d9210539e5bdd49749beb2226e6de5aa).
2025-11-21 11:37:36 -06:00
Jonathan Katz
59a73b1e47
32084 Cisco Secure Client installer fix (#35077)
**Related issue:** Resolves #32084 
This PR modifies `isValidAppFilePath` to allow subdirectors in
`Applications/`, like in this case `Applications/Cisco/Cisco Secure
Client.app`.
This also changes the metadata extraction from packageinfo to trim
`.app` from the name in all cases.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [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/guides/committing-changes.md#changes-files)
for more information.

- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

### Test plan:
---
I ran this on my local environment and it seemed fine
- Have environment with the bug recreated, it has two software titles
for "Cisco Secure Client", and the one with the bundle id
`com.cisco.pkg.anyconnect.vpn` is used by the installer.
- URL to pkg:
https://fndtnfleetmsp.blob.core.windows.net/fndtnpkgs/cisco-secure-client-macos-5.1.3.62-core-vpn-webdeploy-k9.pkg
- Cisco Secure Client doesn't show as installed in UI even after
installing.
- Run the new migration.
- Cisco Secure Client shows as installed now in ui, software title with
bundle id `com.cisco.pkg.anyconnect.vpn` is gone from the database, and
the software installer references the correct title
(`com.cisco.secureclient.gui`).
- Check that deleting and reuploading the installer doesn't recreate the
bad software title.

### QA Note:
---
There are some problems with the install script, but that is probably a
different scope than this ticket.
`Reinstall` wont work, it says Cisco Secure Client is already installed.
Uninstalling through Fleet then Installing again works fine though.
2025-11-03 15:22:39 -05:00
Konstantin Sykulev
c9f693a77c
Fixed bundle identifier for privileges pkg (#33517)
**Related issue:** Resolves #32083

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [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/guides/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)

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked table schema to confirm autoupdate
- [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.
2025-09-26 14:31:31 -05:00
Allen Houchins
10d9bccfc1
Add waits + norestart to MSI uninstall scripts (#31078)
Closes #31077.

- Added logic to wait for the uninstall command to finish running before
exiting the script.
- Also added the `/norestart` flag so users who click uninstall in
self-service aren't at risk of a sudden and unintentional reboot as the
result of software uninstalling.


# 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/guides/committing-changes.md#changes-files)
for more information.

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2025-07-23 09:27:59 -05:00
Ian Littman
7fb9a94384
Use install path on packageInfo XML if it's a .app before falling back to bundle ID for PKG name extraction (#30669)
Fixes #25587. SubEthaEdit packgeInfo file is a bit bigger, but the only
thing different is the list of package IDs included, and that's not what
was broken/fixed here, so went with an abbreviated version that better
demonstrates what got fixed here.

# 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/guides/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 automated tests
- [x] Manual QA for all new/changed functionality

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Improved extraction of application names from uploaded PKG packages by
using the install path as a fallback method.

* **Tests**
* Added a new test case to verify correct name extraction from PKG
packages using the install path.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-09 08:21:10 -05:00
Jahziel Villasana-Espinoza
cf3a3cfbd2
fix: use a new strategy for finding the app name in case the title is wrong (#25297)
> For #24873

# 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] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2025-01-10 16:42:06 -05:00
Victor Lyuboslavsky
06a4c86b3b
Allow uploading PKG without Distribution.xml (#23590)
#23213
Use PackageInfo.xml if Distribution.xml does not exist in uploaded macOS
PKG.

This means we now support script-only packages:
<div>
<a href="https://www.loom.com/share/fb2f9fe93cb64f3aa1221f974ca0eb3a">
<p>[Demo] Install script-only macOS package on Fleet (#23213) - Watch
Video</p>
    </a>
<a href="https://www.loom.com/share/fb2f9fe93cb64f3aa1221f974ca0eb3a">
<img style="max-width:300px;"
src="https://cdn.loom.com/sessions/thumbnails/fb2f9fe93cb64f3aa1221f974ca0eb3a-4b035241497a6c22-full-play.gif">
    </a>
  </div>

# 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] Manual QA for all new/changed functionality
2024-11-06 14:38:13 -06:00
Lucas Manuel Rodriguez
fee21ae2eb
Use pkgutil approach to be more effective at uninstalling (#22618)
#22571

- [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
- 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-03 14:21:23 -03:00
Lucas Manuel Rodriguez
862cd142a3
Add filter to default unintaller for pkgs to only remove .app folders (#22585)
#22571

- [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] Manual QA for all new/changed functionality
2024-10-02 17:50:27 -03:00
Lucas Manuel Rodriguez
f8f24e0a80
Add support to upload RPM packages (#22502)
#22473

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

---------

Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
Co-authored-by: Ian Littman <iansltx@gmail.com>
2024-10-01 13:02:13 -03:00
Victor Lyuboslavsky
ddbdce4ab9
Updated PS1 install/uninstall scripts to fail on error. (#22164) 2024-09-17 17:32:14 -05:00
Victor Lyuboslavsky
e0e6b2a938
Updating install/uninstall scripts. (#22083)
Work in progress for #20000 
The biggest change here is the update to `uninstall_exe.ps1` so that it
is not completely broken.

I'd like to get these changes onto main for testing while I switch to
working on unreleased bugs.

# Windows EXE testing notes (in progress)

## FileZilla
https://filezilla-project.org/download.php?platform=win64
In uninstall script, use /S as $uninstallArgs

## Firefox
Get the full installer like:
https://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US
DO NOT get product=firefox-stub
In uninstall script, use -ms as $uninstallArgs
2024-09-13 17:06:49 -05:00
Victor Lyuboslavsky
f5fb6ba75c
Fixes from BE code review. 2024-09-12 10:29:28 -05:00
Victor Lyuboslavsky
93f12d0d85
Updated/tested uninstall scripts, except for EXE. 2024-09-10 15:28:28 -05:00
Victor Lyuboslavsky
1cf6cab829
Fix TestExtractInstallerMetadata test fail. 2024-09-08 13:16:04 -05:00
Victor Lyuboslavsky
3287a245de
Added pe_test.go 2024-09-08 12:00:43 -05:00
Victor Lyuboslavsky
dd674552e2
Fixed and added Go tests. 2024-09-07 08:07:22 -05:00
Victor Lyuboslavsky
7d47cd95d8
Fixed tests 2024-09-06 09:49:36 -05:00
Victor Lyuboslavsky
ea10d43e93
Added uninstall script to software_installers 2024-09-06 09:49:27 -05:00
Victor Lyuboslavsky
d7f13295e9
Parsing package IDs 2024-09-06 09:49:27 -05:00
Roberto Dip
7b20060350
cover edge case for alternative zoom installer (#20286)
Zoom offers two installers:

- Zoom for IT admins (already covered previously)
- "Regular" Zoom (covered here)

This tweaks the logic made as part of #19144 to ensure we cover both

# 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-07-10 08:05:09 -03:00
Roberto Dip
8f7e2f5214
improve extraction of name and version, and add bundle identifier for pkg installers (#19838)
part 1 of #19144
2024-06-25 10:55:24 -03:00
Roberto Dip
d383876a3c
fix issues installing software in windows (#19048)
for #19039 and #19041 this:

- fixes the install/remove scripts to read the env variable the proper
way
- truncates output before storing in the databse in case its longer than
MySQL's TEXT size

# 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 19:39:42 -03:00
Roberto Dip
ad94dff814
installer report and rollback fixes (#19046)
for https://github.com/fleetdm/fleet/issues/19020

- Fixes the rollback logic to get the right script for the software
being installed
- Fixes the messages displayed in the install results

# 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 19:18:35 -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
Roberto Dip
37fe905f96
missing validations and tweaks to default scripts (#18780)
This adds two things:

- when implementing the CLI, I found [a
panel](https://www.figma.com/file/oQl2oQUG0iRkUy0YOxc307/%2314921-Deploy-security-agents-to-macOS%2C-Windows%2C-and-Linux-hosts?type=design&node-id=779-29335&mode=design&t=Y27cbj7DdhUEGJko-4)
in the Figma file with validations that I missed
- explicit shebang for bash scrips (requested by product) and removed a
comment that will be user facing for exe files.
2024-05-07 13:02:08 -03:00
Roberto Dip
bd3c0a1e9a
adjust logic to get default scripts (#18719)
This tweaks the logic to get default install/remove scripts to delegate
the variable replacement to `fleetd`
2024-05-06 11:41:31 -03:00
Roberto Dip
92e540aee5
add scripts to add/remove software (#18649)
for:

- https://github.com/fleetdm/fleet/issues/18314
- https://github.com/fleetdm/fleet/issues/18315
- https://github.com/fleetdm/fleet/issues/18317
- https://github.com/fleetdm/fleet/issues/18316

# 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-01 14:15:59 -03:00
Martin Angers
563d55c218
Software installers: extract metadata from installers (part 1) (#18509) 2024-04-29 09:13:36 -04:00
Roberto Dip
12b79d5e46
add pkg to inspect xar files (#11015)
Part of #10213 this will be used to do various validations in the
provided bootstrap package.
2023-04-05 20:49:02 -03:00