fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3.02k stars 419 forks source link

GitOps policy script automations don't work on No Team #22787

Open iansltx opened 1 day ago

iansltx commented 1 day ago

Fleet version: 4.58.0


💥  Actual behavior

Scripts are not detected as associated with the team, or not detected at all, when attempting configuration of script automation via GitOps for "No team."

🧑‍💻  Steps to reproduce

  1. Add a policy with run_script on no-team.yml, along with the requisite controls > script entry.
  2. Run gitops.sh

More Info

This is due to how scripts are processed for "No team" (merged from global and no-team files), so neither standard-team (which works) logic nor the workaround used for no-team installers/policy automation works here.

To Fix

To quickly fix this, we may need to limit eligible scripts for policy automations to those declared in no-team.yml, rather than the YAML author's choice of default.yml or no-team.yml; TBD.

iansltx commented 17 hours ago

Test plan:

Regression testing

Happy path

Error handling