Fleet logo
Menu An icon indicating that interacting with this button will open the navigation menu.
Fleet logo An 'X' icon indicating that this can be interacted with to close the navigation menu.

Solutions

a small chevron
Device management

Device management

Remotely manage, and protect laptops and mobile devices.

Orchestration

Orchestration

Automate tasks across devices, from app installs to scripts.

Software management

Software management

Inventory, patch, and manage installed software.

Extend Fleet

Extend Fleet

Integrate your favorite tools with Fleet.


Customers

a small chevron
Stripe + Fleet

Stripe + Fleet

Stripe consolidates multiple tools with Fleet.

Foursquare + Fleet

Foursquare + Fleet

Foursquare quickly migrates to Fleet for device management.

What people are saying

What people are saying

Stories from the Fleet community.


Pricing

More

a small chevron
Docs

Docs

Guides

Guides

Support

Support

News

News

Get your license

Get your license

The handbook

The handbook

Fleet @ Meow Wolf

Kick off JNUC with Fleet at Meow Wolf Denver's Convergence Station.

Join us
Get a demo Try it yourself
Solutions A small chevron
Device management

Device management

Remotely manage, and protect laptops and mobile devices.

Orchestration

Orchestration

Automate tasks across devices, from app installs to scripts.

Software management

Software management

Inventory, patch, and manage installed software.

Extend Fleet

Extend Fleet

Integrate your favorite tools with Fleet.

Customers A small chevron
Stripe + Fleet

Stripe + Fleet

Stripe consolidates multiple tools with Fleet.

Foursquare + Fleet

Foursquare + Fleet

Foursquare quickly migrates to Fleet for device management.

What people are saying

What people are saying

Stories from the Fleet community.

Pricing
More A small chevron

Fleet @ Meow Wolf

Kick off JNUC with Fleet at Meow Wolf Denver's Convergence Station.

Join us
Docs

Docs

Guides

Guides

Support

Support

News

News

Get your license

Get your license

The handbook

The handbook

Try it yourself Get a demo
{{categoryFriendlyName}}/
{{thisPage.meta.articleTitle}}
search

Sysadmin diaries: exporting policies

{{articleSubtitle}}

| The author's GitHub profile picture

JD Strong

Share

Share this article on Hacker News Share this article on LinkedIn Share this article on Twitter

On this page

{{topic.title}}
Docs Docs REST API REST API Guides Guides Get a demoGet a demo
Suggest an editSuggest an edit

Try it out

See what Fleet can do

Start now
macOS Windows Linux

Sysadmin diaries: exporting policies

{{articleSubtitle}}

| The author's GitHub profile picture

JD Strong

Sysadmin diaries: exporting policies

Sysadmin diaries: exporting policies

As we explore using GitOps for managing Fleet, the need to streamline the transition of policies from the web user interface to the organization's GitOps configuration. In this latest diary entry, we will explore extracting policies initially created and tested in the web UI and implementing them in GitOps configurations. By leveraging existing tools and anticipating new features, we will explore both current methods and future capabilities to facilitate this essential task.

Policy management in Fleet

Fleet provides a robust IT security and device management platform, allowing administrators to implement and manage policies across diverse operating systems. Integrating these policies with GitOps configurations is essential for maintaining consistency and automating policy enforcement in large-scale environments. Understanding the tools and methods available for this integration is the first step in optimizing your workflow.

Extracting policies

Administrators have a couple of options to extract policies from the Fleet web UI for use in GitOps configurations.

Using the Fleet API

The most direct method is to use the Fleet API. You can extract existing policies by making a GET request to the Fleet server:

GET https://my.fleet.server/api/v1/fleet/global/policies

This request retrieves all global policies configured in the Fleet. The output, typically in JSON format, can then be converted into YAML format and integrated into your GitOps configurations. This process requires careful handling to ensure that the policy attributes are correctly mapped in the YAML file.

Manual integration process

For those preferring a hands-on approach, manually editing the xxx.policies.yml file is an alternative. This method involves:

  • Navigate to the Fleet web UI and select the policy you wish to export.

  • Copy and paste the relevant keys and values into your GitOps configuration file.

  • Ensuring that features like calendar_events_enabled are true if the policy includes calendar events.

Commands available

While fleetctl currently lacks a direct command to export policies in YAML format (fleetctl get policies --yaml), there are workarounds:

fleetctl api api/v1/fleet/teams/9/policies | jq .policies | yq -P

This command sequence uses fleetctl to call the API, jq to parse the JSON output, and yq to convert it into pretty YAML format. Although not as straightforward as a single command, this method is useful for teams needing to automate their workflow until a dedicated command is available.

Upcoming Features and Improvements

Looking ahead, Fleet is committed to enhancing its GitOps integration capabilities. Upcoming features include:

  • Direct fleetctl commands for policy management: Anticipated updates will introduce new fleetctl commands for easier policy export.
  • Enhanced API endpoints: Future API enhancements will provide more granular control over policy attributes directly from the command line.

Conclusion

Integrating policies from Fleet's web UI to GitOps configurations doesn't have to be complex. Administrators can streamline their workflows by using the current API methods and preparing for upcoming improvements, ensuring their environments remain secure and compliant. As Fleet continues to evolve, look forward to even more powerful tools that make policy management a seamless part of your IT operations.

Fleet logo
Multi platform Device management Orchestration Software management Integrations Pricing
Documentation Support Docs API Release notes Get your license
Company About News Jobs Logos/artwork Why open source?
ISO 27001 coming soon a small checkmarkSOC2 Type 2 Creative Commons Licence CC BY-SA 4.0
© 2025 Fleet Inc. Privacy
Slack logo GitHub logo LinkedIn logo X (Twitter) logo Youtube logo Mastadon logo
Tried Fleet yet?

Get started with Fleet

Start
continue
×