Edward
04/29/2021, 10:28 PMzwass
04/30/2021, 12:02 AMEdward
05/03/2021, 3:21 AMzwass
05/03/2021, 5:26 PMNoah Talerman
05/04/2021, 6:16 PMEdward
05/05/2021, 2:42 PMNoah Talerman
05/05/2021, 3:01 PMapi/v1/fleet/hosts
endpoint. See the API documentation for this endpoint here: https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/1-Using-Fleet/3-REST-API.md#list-hosts
Viewing each host’s installed software (I’m assuming this is what you mean by application) was released behind a feature flag in Fleet 3.11.0 and called Software inventory. See the feature flag documentation for instructions on turning on Software inventory in Fleet: https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/3-Deployment/2-Configuration.md#feature-flags
Once the Software inventory feature is turned on, a list of a specific host’s installed software is available using the api/v1/fleet/hosts/{id}
endpoint. See the documentation on this endpoint here: https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/1-Using-Fleet/3-REST-API.md#get-host
On kernel version: It’s now possible in Fleet to retrieve each host’s kernel version, using the Fleet API, through additional_queries
. The Fleet configuration options yaml file includes an additional_queries
property that allows you to append custom query results to the host details returned by the api/v1/fleet/hosts
endpoint. See an example configuration file with the additional_queries
field here: https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/1-Using-Fleet/2-fleetctl-CLI.md#fleet-configuration-optionsEdward
05/06/2021, 10:31 PMGET /api/v1/fleet/hosts
but don't I also need the api url? Also where can I find the api key?Noah Talerman
05/06/2021, 10:40 PMdon’t I also need the api url?Correct! The API URL is dependent on your Fleet web address. For example, if your Fleet web address is https://fleet.acme.org (this is how you would access the Fleet UI) then your API URL will be https://fleet.acme.org/api/v1/fleet/hosts.
Also where can I find the api key?You can find your API key using the Fleet UI. Select the avatar in the far right of the top navigation and then select “My account” from the dropdown menu. On the My account page, select the “Get API token” in the right side bar.
Edward
05/09/2021, 6:25 PMcurl -H "Authorization: Bearer MY_API_TOKEN_FROM_FLEET_UI_HERE" -X GET '<https://my_fleet_url/api/v1/fleet/hosts>'
{
"message": "you are not allowed to access this endpoint",
"error": true,
"version": "1.0.2",
"code": "4310"
}
zwass
05/10/2021, 3:01 PM