Ed Merrett
02/14/2025, 2:50 PMfleetctl api api/v1/fleet/teams/5/policies | jq .policies | yq -P
Trying to migrate to gitops and want to copy over the handful of policies in All TeamsAllen Houchins
02/14/2025, 3:21 PMdefault.yml
, not a team specific team.yml
file.Ed Merrett
02/14/2025, 3:38 PMdefault.yml
Can I ask about how the software
yaml is supposed to work?
I have this policy that was built in the UI but I am migrating to git ops:
- name: '[Install software] falcon-sensor (deb)'
platform: linux
description: |
Policy triggers automatic install of falcon-sensor on each host that's missing this software.
Software won't be installed on Linux hosts with RPM-based distributions because this policy's query is written to always pass on these hosts.
resolution: ""
query: |
SELECT 1 WHERE EXISTS (
SELECT 1 WHERE (SELECT COUNT(*) FROM deb_packages) = 0
) OR EXISTS (
SELECT 1 FROM deb_packages WHERE name = 'falcon-sensor'
);
install_software:
package_path: ../../software/linux/Falcon_Sensor_7.20.0_17306.deb
and I have uploaded the .deb file to the repo (prob wont do this in the future?)
my teams.yml
is the below:
name: Testing (linux)
policies:
- path: ../../policies/linux/device-health-policies.yml
queries:
agent_options:
path: ./agent-options.yml
controls:
scripts:
- path: ../../scripts/linux/create_cronjob_gsettings_table.sh
team_settings:
secrets:
- secret: "$FLEET_GLOBAL_ENROLL_SECRET"
software:
software
isn't an array like scripts according to the errors.
Error: 2 errors occurred:
* Couldn't edit software. "software" must be a spec.Software, found array
* failed to parse policy install_software "[Install software] falcon-sensor (deb)": failed to unmarshal install_software.package_path file ../../software/linux/Falcon_Sensor_7.20.0_17306.deb: error converting YAML to JSON: yaml: invalid leading UTF-8 octet
Guidance would be great!Allen Houchins
02/14/2025, 3:41 PMsoftware:
packages:
- path: ../path/to/file.yml
Allen Houchins
02/14/2025, 3:41 PMEd Merrett
02/14/2025, 3:42 PMAllen Houchins
02/14/2025, 3:43 PMEd Merrett
02/14/2025, 3:43 PMEd Merrett
02/14/2025, 3:53 PM- name: '[Install software] falcon-sensor (deb)'
platform: linux
description: |
Policy triggers automatic install of falcon-sensor on each host that's missing this software.
Software won't be installed on Linux hosts with RPM-based distributions because this policy's query is written to always pass on these hosts.
resolution: ""
query: |
SELECT 1 WHERE EXISTS (
SELECT 1 WHERE (SELECT COUNT(*) FROM deb_packages) = 0
) OR EXISTS (
SELECT 1 FROM deb_packages WHERE name = 'falcon-sensor'
);
install_software:
package_path: ../../software/linux/crowdstrike-falcon.yml
where crowdstrike-falcon.yml
would be a URL the software package? (Likely in S3)?Ed Merrett
02/14/2025, 3:53 PMname: falcon-sensor
url: <https://some.s3.thing/falcon-sensor-7.20.0-17306.deb>
self-service: false
Allen Houchins
02/14/2025, 3:56 PMurl
is right and the ../../
in the package_path
are correct. I don't think name:
is supported in the software yaml file or at least you don't need that flag. That is automatically extracted from the package when Fleet downloads it.Allen Houchins
02/14/2025, 3:56 PM--dry-run
and it will validate everything for youEd Merrett
02/14/2025, 3:57 PMAllen Houchins
02/14/2025, 3:58 PMEd Merrett
02/14/2025, 3:59 PMAllen Houchins
02/14/2025, 3:59 PMEd Merrett
02/14/2025, 5:00 PMdial tcp: lookup <http://nexus.xxxx.net|nexus.xxxx.net> on 10.10.0.2:53: no such host
when trying to run a --dry-run with a software package. I can get to the host and download the file via curl in the same place I am running fleetctl
Any ideas?Allen Houchins
02/14/2025, 5:03 PMEd Merrett
02/14/2025, 5:04 PMAllen Houchins
02/14/2025, 5:14 PMEd Merrett
02/14/2025, 5:50 PMAllen Houchins
02/14/2025, 6:35 PM