Docs v4.58.0 (#22769)

This commit is contained in:
Rachael Shaw
2024-10-17 17:51:52 -05:00
committed by GitHub
parent b27af3d4a2
commit 4cc3e3bb63
10 changed files with 380 additions and 46 deletions
@@ -21,14 +21,14 @@ Fleet allows its users to upload trusted software installation files to be insta
Current supported software deployment formats:
- macOS: .pkg
- Windows: .msi, .exe
- Linux: .deb
- Linux: .deb, .rpm
Coming soon:
- VPP for iOS and iPadOS
2. **Add a policy**: In Fleet, add a policy that failure to pass will trigger the required installation. Go to Policies tab --> Press the top right "Add policy" button. --> Click "create your own policy" --> Enter your policy SQL --> Save --> Fill in details in the Save modal and Save.
```
```sql
SELECT 1 FROM apps WHERE name = 'Adobe Acrobat Reader.app' AND version_compare(bundle_short_version, '23.001.20687') >= 0;
```
@@ -55,6 +55,56 @@ Upon failure of the selected policy, the selected software installation will be
![Flowchart](../website/assets/images/articles/automatic-software-install-workflow.png)
*Detailed flowchart*
## Templates for policy queries
Following are some templates for the policy SQL queries for each package type.
### macOS (pkg)
```sql
SELECT 1 FROM apps WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(bundle_short_version, '<SOFTWARE_PACKAGE_VERSION>') >= 0;
```
### Windows (msi and exe)
```sql
SELECT 1 FROM programs WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(version, '<VERSION>') >= 0;
```
### Ubuntu (deb)
```sql
SELECT 1 FROM deb_packages WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(version, '<SOFTWARE_PACKAGE_VERSION>') >= 0;
```
If your team has both Ubuntu and RHEL-based hosts then you should use the following template for the policy queries:
```sql
SELECT 1 WHERE EXISTS (
-- This will mark the policies as successful on RHEL hosts.
-- This is only required if RHEL-based and Debian based system share a team.
SELECT 1 FROM os_version WHERE platform = 'rhel'
) OR EXISTS (
SELECT 1 FROM deb_packages WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(version, '<SOFTWARE_PACKAGE_VERSION>') >= 0
);
```
### RHEL-based (rpm)
```sql
SELECT 1 FROM rpm_packages WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(version, '<SOFTWARE_PACKAGE_VERSION>') >= 0;
```
If your team has both Ubuntu and RHEL-based hosts then you should use the following template for the policy queries:
```sql
SELECT 1 WHERE EXISTS (
-- This will mark the policies as successfull on non-RHEL hosts.
-- This is only required if RHEL-based and Debian based system share a team.
SELECT 1 FROM os_version WHERE platform != 'rhel'
) OR EXISTS (
SELECT 1 FROM rpm_packages WHERE name = '<SOFTWARE_TITLE_NAME>' AND version_compare(version, 'SOFTWARE_PACKAGE_VERSION') >= 0
);
```
## Using the REST API for self-service software packages
Fleet provides a REST API for managing software packages, including self-service software packages. Learn more about Fleet's [REST API](https://fleetdm.com/docs/rest-api/rest-api#add-team-policy).
+1 -1
View File
@@ -46,7 +46,7 @@ To access and manage software in Fleet:
* Click the “Add Software” button in the top right corner, and a dialog will appear.
* Choose a file to upload. `.pkg`, `.msi`, `.exe`, and `.deb` files are supported.
* Choose a file to upload. `.pkg`, `.msi`, `.exe`, `.rpm`, and `.deb` files are supported.
> Software installer uploads will fail if Fleet is unable to extract information from the installer package such as bundle ID and version number.
+53
View File
@@ -0,0 +1,53 @@
# Automatic policy-based execution of scripts on hosts
![Fleet MDM Cover](../website/assets/images/articles/introducing-cross-platform-script-execution-800x450@2x.png)
Fleet [v4.58.0](https://github.com/fleetdm/fleet/releases/tag/fleet-v4.58.0) introduces the ability to execute scripts on hosts automatically based on predefined policy failures. This guide will walk you through configuring Fleet to automatically execute scripts on hosts using uploaded scripts based on programmed policies. You'll learn how to configure and use this feature and understand how the underlying mechanism works.
Fleet allows users to upload scripts executed on macOS, Windows, and Linux hosts to remediate issues with those hosts. These scripts can now be automated to run when a policy fails. See [the scripts guide](https://fleetdm.com/guides/scripts) for more information.
## Prerequisites
* Fleet Premium with admin permissions
* Fleet [v4.58.0](https://github.com/fleetdm/fleet/releases/tag/fleet-v4.58.0) or greater
* [Scripts enabled](https://fleetdm.com/guides/scripts#enable-scripts) on all target hosts
## Step-by-step instructions
1. **Add a script**: Navigate to **Controls** > **Scripts**, select the team on which you want the script and policy to run, and upload the script you want to run.
2. **Add a policy**: Navigate to **Policies**, select the team you want the policy to run on, and click **Add policy**. Follow the instructions to set up a custom policy or use one baked into Fleet. You can also add a script automation to an existing policy.
3. **Set the automation**: In the previous step's **Policies** list view you navigated to, click **Manage automations**, then click **Run script**. Check the box beside the policy (or policies) for which you want to run scripts, then select a script in the drop-down that appears next to the policy name. When you're done associating policies to scripts, click **Save**.
The next time a fleetd host fails the policy you added automation for, Fleet will queue up the script you selected and run it on the host as if you had requested a script run manually.
## How does it work?
* Online hosts report policy status when on a configurable cadence, with hourly default.
* Fleet will send scripts to the hosts on the first policy failure (first "No" result for the host) or if a policy goes from "Yes" to "No". Policies that remain failed ("No") for a host in consecutive reports will not be resent to the script.
> When script automation on a policy is added or switched to a different script, the policy's status will reset for associated hosts. This allows the newly attached script to run on hosts that had previously failed the policy.
* Scripts are run once regardless of exit code.
* When used in policy automation, Fleet does not run shell scripts on Windows hosts or PowerShell scripts on non-Windows hosts.
## Via the API
Script policy automation can be managed by setting the `script_id` field on the Fleet REST API's [Add team policy](https://fleetdm.com/docs/rest-api/rest-api#add-team-policy) or [Edit team policy](https://fleetdm.com/docs/rest-api/rest-api#edit-team-policy) endpoints.
## Via GitOps
To configure script policy automation via GitOps, nest a `run_script` entry under the `policy` you want to automate, then make sure you have the same `path` field both there and in the same team's `controls > scripts` section. See the [GitOps reference documentation](https://fleetdm.com/docs/configuration/yaml-files#policies) for an example.
## Conclusion
Fleet now supports running scripts on hosts that fail a policy check. We showed how to set up these automations via the Fleet admin UI, our REST API, and GitOps.
Host condition-related issues can be resolved by running a script on those hosts. You can now automate those resolutions inside Fleet, allowing zero-touch remediation of policy failures on hosts running fleetd.
<meta name="articleTitle" value="Automatic policy-based execution of scripts on hosts">
<meta name="authorFullName" value="Ian Littman">
<meta name="authorGitHubUsername" value="iansltx">
<meta name="category" value="guides">
<meta name="publishedOn" value="2024-10-07">
<meta name="description" value="A guide to workflows using automatic script execution in Fleet.">
+6 -2
View File
@@ -37,7 +37,7 @@ Fleet UI:
Scripts run from the Fleet UI will run the next time your host checks in with Fleet. You can view the status of the script execution as well as the output in the target host's activity feed.
Fleet API: API documentation is [here](https://fleetdm.com/docs/rest-api/rest-api#run-script)
Fleet API: See our [REST API documentation](https://fleetdm.com/docs/rest-api/rest-api#run-script)
fleetctl CLI:
@@ -45,9 +45,13 @@ fleetctl CLI:
fleetctl run-script --script-path=/path/to/script --host=hostname
```
## Automate a script
You can tell Fleet to run a script on a host when that host fails a policy. Learn more in our [script policy automations guide](https://fleetdm.com/guides/policy-automation-run-script).
<meta name="category" value="guides">
<meta name="authorGitHubUsername" value="noahtalerman">
<meta name="authorFullName" value="Noah Talerman">
<meta name="publishedOn" value="2024-06-04">
<meta name="publishedOn" value="2024-10-07">
<meta name="articleTitle" value="Scripts">
<meta name="description" value="Learn how to execute a custom script on macOS, Windows, and Linux hosts in Fleet.">
+11 -5
View File
@@ -40,10 +40,14 @@ team_settings: # Only teams/team-name.yml
### policies
Polcies can be specified inline in your `default.yml` file or `teams/team-name.yml` files. They can also be specified in separate files in your `lib/` folder.
Policies defined in `default.yml` run on **all** hosts.
Policies can be specified inline in your `default.yml`, `teams/team-name.yml`, or `teams/no-team.yml` files. They can also be specified in separate files in your `lib/` folder.
Policies defined in `default.yml` run on **all** hosts.
Policies defined in `teams/no-team.yml` run on hosts that belong to "No team".
> Policies that run automations to install software or run scripts must be defined in `teams/no-team.yml` to run on hosts that belong to "No team".
#### Options
For possible options, see the parameters for the [Add policy API endpoint](https://fleetdm.com/docs/rest-api/rest-api#add-policy).
@@ -52,7 +56,7 @@ For possible options, see the parameters for the [Add policy API endpoint](https
##### Inline
`default.yml` or `teams/team-name.yml`
`default.yml`, `teams/team-name.yml`, or `teams/no-team.yml`
```yaml
policies:
@@ -84,6 +88,8 @@ policies:
platform: darwin
critical: false
calendar_event_enabled: false
run_script:
path: "../lib/disable-guest-account.sh"
- name: Firefox on Linux installed and up to date
platform: linux
description: "This policy checks that Firefox is installed and up to date."
@@ -222,7 +228,7 @@ The `controls` section allows you to configure scripts and device management (MD
Controls for hosts that are in "No team" can be defined in `default.yml` or in `teams/no-team.yml` (but not in both files).
- `scripts` is a list of paths to macOS, Windows, or Linux scripts.
- `scripts` is a list of paths to macOS, Windows, or Linux scripts. Scripts used in policy automations for "No team" must be defined in `teams/no-team.yml`.
- `windows_enabled_and_configured` specifies whether or not to turn on Windows MDM features (default: `false`). Can only be configured for all teams (`default.yml`).
- `enable_disk_encryption` specifies whether or not to enforce disk encryption on macOS and Windows hosts (default: `false`).
@@ -319,7 +325,7 @@ The `software` section allows you to configure packages and Apple App Store apps
Software for hosts that belong to "No team" have to be defined in `teams/no-team.yml`.
Software can also be specified in separate files in your `lib/` folder.
- `packages` is a list of software packages (.pkg, .msi, .exe, or .deb) and software specific options.
- `packages` is a list of software packages (.pkg, .msi, .exe, .rpm, or .deb) and software specific options.
- `app_store_apps` is a list of Apple App Store apps.
#### Example
+31 -4
View File
@@ -1510,13 +1510,23 @@ NOTE: when updating a policy, team and platform will be ignored.
"description": "Checks to make sure that the FileVault feature is enabled on macOS devices.",
"resolution": "Choose Apple menu > System Preferences, then click Security & Privacy. Click the FileVault tab. Click the Lock icon, then enter an administrator name and password. Click Turn On FileVault.",
"platform": "darwin",
"critical": true
}
"critical": true,
"script_id": 123
},
{
"name": "Is Adobe Acrobat installed and up to date?",
"query": "SELECT 1 FROM apps WHERE name = 'Adobe Acrobat Reader.app' AND version_compare(bundle_short_version, '23.001.20687') >= 0;",
"team": "Workstations",
"description": "Checks to make sure that Adobe Acrobat is installed and up to date.",
"platform": "darwin",
"critical": false,
"software_title_id": 12
},
]
}
```
The field `critical` is available in Fleet Premium.
The fields `critical`, `script_id`, and `software_title_id` are available in Fleet Premium.
##### Default response
@@ -3340,7 +3350,24 @@ If both `team_id` and `team_name` parameters are included, this endpoint will re
##### Default response
`Status: 204`
`Status: 200`
```json
{
"scripts": [
{
"team_id": 3,
"id": 6690,
"name": "Ensure shields are up"
},
{
"team_id": 3,
"id": 10412,
"name": "Ensure flux capacitor is charged"
}
]
}
```
### Run live script
@@ -15,6 +15,7 @@
| `.pkg` | Low | High | - |
| `.exe` | Low | High | - |
| `.deb` | Low | High | - |
| `.rpm` | Low | High | - |
More details:
+4 -2
View File
@@ -80,7 +80,7 @@ Fleet supports the following operating system versions on hosts.
| Linux | CentOS 7.1+, Ubuntu 20.04+, Fedora 38+ |
| ChromeOS | 112.0.5615.134+ |
While Fleet may still function partially or fully with OS versions older than those above, Fleet does not actively test against unsupported versions and does not pursue bugs on them.
While Fleet may still function partially or fully with OS versions older than those above, Fleet does not actively test against unsupported versions and does not pursue bugs on them.
## Some notes on compatibility
@@ -91,10 +91,12 @@ If a table is not available for your host, Fleet will generally handle things be
### Linux
Fleet Desktop is supported on Ubuntu and Fedora.
Fleet Desktop is supported on Ubuntu and Fedora.
Fedora requires a [gnome extension](https://extensions.gnome.org/extension/615/appindicator-support/) and Google Chrome for Fleet Desktop.
Fleet's default (un)install scripts use `apt-get` for Debian-based distributions, and `dnf` for Red Hat-based distributions. To install packages on CentOS versions prior to 8, either add `dnf` or edit install and uninstall scripts to use the `yum` or `rpm` command.
On Ubuntu, Fleet Desktop currently supports Xorg as X11 server, Wayland is currently not supported. Ubuntu 24.04 comes with Wayland enabled by default. To use X11 instead of Wayland you can set `WaylandEnable=false` in `/etc/gdm3/custom.conf` and reboot.
The `fleetctl package` command is not supported on DISA-STIG distribution.
+219 -30
View File
@@ -2854,6 +2854,12 @@ Returns the count of all hosts organized by status. `online_count` includes all
"name": "iPadOS",
"description": "All iPadOS hosts",
"label_type": "builtin"
},
{
"id": 15,
"name": "Fedora Linux",
"description": "All Fedora hosts",
"label_type": "builtin"
}
],
"platforms": [
@@ -6958,7 +6964,11 @@ Team policies work the same as policies, but at the team level.
"passing_host_count": 2300,
"failing_host_count": 0,
"host_count_updated_at": "2023-12-20T15:23:57Z",
"calendar_events_enabled": false
"calendar_events_enabled": false,
"run_script": {
"name": "Encrypt Windows disk with BitLocker",
"id": 234
}
},
{
"id": 3,
@@ -7141,7 +7151,15 @@ Team policies work the same as policies, but at the team level.
"passing_host_count": 0,
"failing_host_count": 0,
"host_count_updated_at": null,
"calendar_events_enabled": true
"calendar_events_enabled": true,
"install_software": {
"name": "Adobe Acrobat.app",
"software_title_id": 1234
},
"run_script": {
"name": "Enable gatekeeper",
"id": 1337
}
}
}
```
@@ -7154,16 +7172,17 @@ The semantics for creating a team policy are the same as for global policies, se
#### Parameters
| Name | Type | In | Description |
| ---------- | ------- | ---- | ------------------------------------ |
| id | integer | path | Defines what team ID to operate on. |
| name | string | body | The policy's name. |
| query | string | body | The policy's query in SQL. |
| description | string | body | The policy's description. |
| resolution | string | body | The resolution steps for the policy. |
| platform | string | body | Comma-separated target platforms, currently supported values are "windows", "linux", "darwin". The default, an empty string means target all platforms. |
| critical | boolean | body | _Available in Fleet Premium_. Mark policy as critical/high impact. |
| software_title_id | integer | body | _Available in Fleet Premium_. ID of software title to install if the policy fails. |
| Name | Type | In | Description |
|-------------------| ------- | ---- |--------------------------------------------------------------------------------------------------------------------------------------------------------|
| id | integer | path | Defines what team ID to operate on. |
| name | string | body | The policy's name. |
| query | string | body | The policy's query in SQL. |
| description | string | body | The policy's description. |
| resolution | string | body | The resolution steps for the policy. |
| platform | string | body | Comma-separated target platforms, currently supported values are "windows", "linux", "darwin". The default, an empty string means target all platforms. |
| critical | boolean | body | _Available in Fleet Premium_. Mark policy as critical/high impact. |
| software_title_id | integer | body | _Available in Fleet Premium_. ID of software title to install if the policy fails. |
| script_id | integer | body | _Available in Fleet Premium_. ID of script to run if the policy fails. |
Either `query` or `query_id` must be provided.
@@ -7211,6 +7230,10 @@ Either `query` or `query_id` must be provided.
"install_software": {
"name": "Adobe Acrobat.app",
"software_title_id": 1234
},
"run_script": {
"name": "Enable gatekeeper",
"id": 1337
}
}
}
@@ -7255,18 +7278,19 @@ Either `query` or `query_id` must be provided.
#### Parameters
| Name | Type | In | Description |
| ---------- | ------- | ---- | ------------------------------------ |
| team_id | integer | path | The team's ID. |
| policy_id | integer | path | The policy's ID. |
| name | string | body | The query's name. |
| query | string | body | The query in SQL. |
| description | string | body | The query's description. |
| resolution | string | body | The resolution steps for the policy. |
| platform | string | body | Comma-separated target platforms, currently supported values are "windows", "linux", "darwin". The default, an empty string means target all platforms. |
| critical | boolean | body | _Available in Fleet Premium_. Mark policy as critical/high impact. |
| calendar_events_enabled | boolean | body | _Available in Fleet Premium_. Whether to trigger calendar events when policy is failing. |
| software_title_id | integer | body | _Available in Fleet Premium_. ID of software title to install if the policy fails. |
| Name | Type | In | Description |
|-------------------------| ------- | ---- |---------------------------------------------------------------------------------------------------------------------------------------------------------|
| team_id | integer | path | The team's ID. |
| policy_id | integer | path | The policy's ID. |
| name | string | body | The query's name. |
| query | string | body | The query in SQL. |
| description | string | body | The query's description. |
| resolution | string | body | The resolution steps for the policy. |
| platform | string | body | Comma-separated target platforms, currently supported values are "windows", "linux", "darwin". The default, an empty string means target all platforms. |
| critical | boolean | body | _Available in Fleet Premium_. Mark policy as critical/high impact. |
| calendar_events_enabled | boolean | body | _Available in Fleet Premium_. Whether to trigger calendar events when policy is failing. |
| software_title_id | integer | body | _Available in Fleet Premium_. ID of software title to install if the policy fails. Set to `0` to remove the automation. |
| script_id | integer | body | _Available in Fleet Premium_. ID of script to run if the policy fails. Set to `0` to remove the automation. |
#### Example
@@ -7281,7 +7305,8 @@ Either `query` or `query_id` must be provided.
"description": "Checks if gatekeeper is enabled on macOS devices",
"critical": true,
"resolution": "Resolution steps",
"platform": "darwin"
"platform": "darwin",
"script_id": 1337
}
```
@@ -7312,6 +7337,10 @@ Either `query` or `query_id` must be provided.
"install_software": {
"name": "Adobe Acrobat.app",
"software_title_id": 1234
},
"run_script": {
"name": "Enable gatekeeper",
"id": 1337
}
}
}
@@ -8725,7 +8754,9 @@ Deletes the session specified by ID. When the user associated with the session n
- [Modify package](#modify-package)
- [List App Store apps](#list-app-store-apps)
- [Add App Store app](#add-app-store-app)
- [Add Fleet library app](#add-fleet-library-app)
- [List Fleet-maintained apps](#list-fleet-maintained-apps)
- [Get Fleet-maintained app](#get-fleet-maintained-app)
- [Add Fleet-maintained app](#add-fleet-maintained-app)
- [Install package or App Store app](#install-package-or-app-store-app)
- [Get package install result](#get-package-install-result)
- [Download package](#download-package)
@@ -9249,7 +9280,7 @@ OS vulnerability data is currently available for Windows and macOS. For other pl
_Available in Fleet Premium._
Add a package (.pkg, .msi, .exe, .deb) to install on macOS, Windows, or Linux (Ubuntu) hosts.
Add a package (.pkg, .msi, .exe, .deb, .rpm) to install on macOS, Windows, or Linux hosts.
`POST /api/v1/fleet/software/package`
@@ -9258,7 +9289,7 @@ Add a package (.pkg, .msi, .exe, .deb) to install on macOS, Windows, or Linux (U
| Name | Type | In | Description |
| ---- | ------- | ---- | -------------------------------------------- |
| software | file | form | **Required**. Installer package file. Supported packages are PKG, MSI, EXE, and DEB. |
| software | file | form | **Required**. Installer package file. Supported packages are PKG, MSI, EXE, DEB, and RPM. |
| team_id | integer | form | **Required**. The team ID. Adds a software package to the specified team. |
| install_script | string | form | Script that Fleet runs to install software. If not specified Fleet runs [default install script](https://github.com/fleetdm/fleet/tree/f71a1f183cc6736205510580c8366153ea083a8d/pkg/file/scripts) for each package type. |
| pre_install_query | string | form | Query that is pre-install condition. If the query doesn't return any result, Fleet won't proceed to install. |
@@ -9319,7 +9350,7 @@ Update a package to install on macOS, Windows, or Linux (Ubuntu) hosts.
| Name | Type | In | Description |
| ---- | ------- | ---- | -------------------------------------------- |
| software | file | form | Installer package file. Supported packages are PKG, MSI, EXE, and DEB. |
| software | file | form | Installer package file. Supported packages are PKG, MSI, EXE, DEB, and RPM. |
| team_id | integer | form | **Required**. The team ID. Updates a software package in the specified team. |
| install_script | string | form | Command that Fleet runs to install software. If not specified Fleet runs the [default install command](https://github.com/fleetdm/fleet/tree/f71a1f183cc6736205510580c8366153ea083a8d/pkg/file/scripts) for each package type. |
| pre_install_query | string | form | Query that is pre-install condition. If the query doesn't return any result, the package will not be installed. |
@@ -9459,7 +9490,7 @@ Add App Store (VPP) app purchased in Apple Business Manager.
#### Example
`POST /api/v1/fleet/software/app_store_apps?team_id=3`
`POST /api/v1/fleet/software/app_store_apps`
##### Request body
@@ -9476,6 +9507,164 @@ Add App Store (VPP) app purchased in Apple Business Manager.
`Status: 200`
### List Fleet-maintained apps
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows.
List available Fleet-maintained apps.
`GET /api/v1/fleet/software/fleet_maintained_apps`
#### Parameters
| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| team_id | integer | query | **Required**. The team ID. Filters Fleet-maintained apps to only include apps available for the specified team. |
| page | integer | query | Page number of the results to fetch. |
| per_page | integer | query | Results per page. |
#### Example
`GET /api/v1/fleet/software/fleet_maintained_apps?team_id=3`
##### Default response
`Status: 200`
```json
{
"fleet_maintained_apps": [
{
"id": 1,
"name": "1Password",
"version": "8.10.40",
"platform": "darwin"
},
{
"id": 2,
"name": "Adobe Acrobat Reader",
"version": "24.002.21005",
"platform": "darwin"
},
{
"id": 3,
"name": "Box Drive",
"version": "2.39.179",
"platform": "darwin"
},
],
"meta": {
"has_next_results": false,
"has_previous_results": false
}
}
```
### Get Fleet-maintained app
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows.
Returns information about the specified Fleet-maintained app.
`GET /api/v1/fleet/software/fleet_maintained_apps/:id`
#### Parameters
| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| id | integer | path | **Required.** The Fleet-maintained app's ID. |
#### Example
`GET /api/v1/fleet/software/fleet_maintained_apps/1`
##### Default response
`Status: 200`
```json
{
"fleet_maintained_app": {
"id": 1,
"name": "1Password",
"filename": "1Password-8.10.44-aarch64.zip",
"version": "8.10.40",
"platform": "darwin",
"install_script": "#!/bin/sh\ninstaller -pkg \"$INSTALLER_PATH\" -target /",
"uninstall_script": "#!/bin/sh\npkg_ids=$PACKAGE_ID\nfor pkg_id in '${pkg_ids[@]}'...",
}
}
```
### Add Fleet-maintained app
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows.
_Available in Fleet Premium._
Add Fleet-maintained app so it's available for install.
`POST /api/v1/fleet/software/fleet_maintained_apps`
#### Parameters
| Name | Type | In | Description |
| ---- | ---- | -- | ----------- |
| fleet_maintained_app_id | integer | body | **Required.** The ID of Fleet-maintained app. |
| team_id | integer | body | **Required**. The team ID. Adds Fleet-maintained app to the specified team. |
| install_script | string | body | Command that Fleet runs to install software. If not specified Fleet runs default install command for each Fleet-maintained app. |
| pre_install_query | string | body | Query that is pre-install condition. If the query doesn't return any result, Fleet won't proceed to install. |
| post_install_script | string | body | The contents of the script to run after install. If the specified script fails (exit code non-zero) software install will be marked as failed and rolled back. |
| self_service | boolean | body | Self-service software is optional and can be installed by the end user. |
#### Example
`POST /api/v1/fleet/software/fleet_maintained_apps`
##### Request body
```json
{
"fleet_maintained_app_id": 3,
"team_id": 2
}
```
##### Default response
`Status: 204`
### Download package
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows.
_Available in Fleet Premium._
`GET /api/v1/fleet/software/titles/:software_title_id/package?alt=media`
#### Parameters
| Name | Type | In | Description |
| ---- | ------- | ---- | -------------------------------------------- |
| software_title_id | integer | path | **Required**. The ID of the software title to download software package.|
| team_id | integer | query | **Required**. The team ID. Downloads a software package added to the specified team. |
| alt | integer | query | **Required**. If specified and set to "media", downloads the specified software package. |
#### Example
`GET /api/v1/fleet/software/titles/123/package?alt=media?team_id=2`
##### Default response
`Status: 200`
```http
Status: 200
Content-Type: application/octet-stream
Content-Disposition: attachment
Content-Length: <length>
Body: <blob>
```
### Install package or App Store app
> **Experimental feature**. This feature is undergoing rapid improvement, which may result in breaking changes to the API or configuration surface. It is not recommended for use in automated workflows.
+2
View File
@@ -580,6 +580,8 @@ module.exports.routes = {
'GET /learn-more-about/uninstall-scripts': '/guides/deploy-software-packages#uninstall-script',
'GET /learn-more-about/read-package-version': '/guides/deploy-software-packages#add-a-software-package-to-a-team',
'GET /learn-more-about/fleetctl': '/guides/fleetctl',
'GET /feature-request': 'https://github.com/fleetdm/fleet/issues/new?assignees=&labels=~feature+fest%2C%3Aproduct&projects=&template=feature-request.md&title=',
'GET /learn-more-about/policy-automation-run-script': '/guides/policy-automation-run-script',
'GET /learn-more-about/installing-fleetctl': '/guides/fleetctl#installing-fleetctl',
// Sitemap