mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Add Ubuntu Advantage Query to Library (#35680)
Adds the Ubuntu Advantage policy to the policy library that checks to see if the file exists, and that it is attached, and expiry date has not passed. This can be used in combination with a script automation running `pro attach <tokenID>`, with a tokenID configured in Fleet Variables. E.g: `pro attach $FLEET_SECRET_UBUNTUPRO` for remediation. --------- Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
This commit is contained in:
parent
1ca8c6ec79
commit
33510dc40c
1 changed files with 9 additions and 0 deletions
|
|
@ -184,6 +184,15 @@ spec:
|
|||
contributors: zwass
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: policy
|
||||
spec:
|
||||
name: Get Ubuntu Advantage (Ubuntu Pro) attachment status
|
||||
platform: linux
|
||||
description: Checks to see if the Ubuntu Pro status file exists, and ensures attachment and expiry are as expected. Combine with a script automation to run the attach command for remediation.
|
||||
query: SELECT 1 FROM parse_json WHERE path = '/var/lib/ubuntu-advantage/status.json' AND ((key = 'attached' AND value = 'true') OR (key = 'expires' AND datetime(value) > datetime('now'))) GROUP BY path HAVING SUM(CASE WHEN key = 'attached' AND value = 'true' THEN 1 ELSE 0 END) = 1 AND SUM(CASE WHEN key = 'expires' AND datetime(value) > datetime('now') THEN 1 ELSE 0 END) = 1;
|
||||
contributors: GrayW
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: query
|
||||
spec:
|
||||
name: Get authorized SSH keys
|
||||
|
|
|
|||
Loading…
Reference in a new issue