Hello, Permit Team! Can you please help me? Is the...
# permit-saas
u
Hello, Permit Team! Can you please help me? Is there a way to recover the policy configured before and rewritten accidentally?
p
Hey, thanks for reaching out ! It seems our team is a little busy right now, a human will be with you within the next hour or so. In the meantime, can I help you ?
a
Hi @Uladzislava Sheleh, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
Yes, Permit.io provides backup and versioning capabilities to help you recover accidentally overwritten policies. Permit offers ​*Git-backed policies*​ for version control and policy auditing, along with ​*backup & point-in-time restore*​ to recover previous authorization states (1) . This means your policies are versioned and can be rolled back if needed. When you use the GitOps feature, policy code generated by the policy editor is saved into a Git repository (2) . This allows you full control of the code and provides comprehensive versioning for all your policies (3) . You can track changes to policies over time and roll back changes if necessary (2) . The GitOps flow stores policies as code in a Git repository before being deployed to your PDP . This creates a controlled process for creating and maintaining policies, where code reviews, tests, and approval flows combine with the Permit.io authorization development lifecycle (3) . To set up GitOps and enable this versioning capability, you can follow the guide referenced in the documentation (3) (2) . ​*Check out these potentially useful sources:*​ [GitOps Overview](https://docs.permit.io/integrat
To learn more, see the sources I considered: [[1] Permit Strength Points](https://docs.permit.io/concepts/differentiator-checklist) [[2] GitOps Overview](https://docs.permit.io/integrations/gitops/overview) [[3] Policy Basics](https://docs.permit.io/how-to/build-policies/policy-basics)
u
What if I had a policy configured via UI? I don't have the flow set up yet, I'm thinking of buying the product based on experience yet.
@Ask Inkeep
a
Thanks for tagging me @Uladzislava Sheleh. I'll look through relevant sources and get back to you shortly.
I understand you're working with policies configured through the UI and haven't set up GitOps yet. Based on the available documentation, policies created through the Policy Editor are automatically merged into a Git repository (1) . This means even if you're using the UI, your policies should have some level of versioning built in. The documentation indicates that "Code created through the editor is merged into a Git repository. The stored policies are then deployed on the fly via OPAL to the multiple PDP microservices that you run" . This suggests that even UI-configured policies benefit from version control. However, I don't have specific information in the available sources about recovering UI-configured policies without GitOps explicitly set up, or what the default backup/recovery process looks like for UI-only configurations. I'd recommend reaching out to the Permit team directly via Email to clarify: 1. What backup/recovery options exist for UI-configured policies before GitOps setup 2. Whether there's a policy history or audit log you can access 3. The specific workspace/project/environment where this occurred Would you like me to provide a general answer based on my broader knowledge of how authorization platforms typically handle this, or would you prefer to wait for the Permit team's response? ​*Check out these potentially useful sources:*​ Policy Basics
To learn more, see the sources I considered: [[1] Policy Basics](https://docs.permit.io/how-to/build-policies/policy-basics)
t
You can do backups with terraform via the CLI too.
https://github.com/permitio/permit-cli Unfortunately if you didn't get a backup there is no way to get it back. This is why having your own got repo configured is so important.
✅ 1
u
Thank you!
@Ask Inkeep can you please give a link to proper code controlled approach of working with permit.io?
a
Thanks for tagging me @Uladzislava Sheleh. I'll look through relevant sources and get back to you shortly.
Permit.io offers several code-controlled approaches for managing your authorization policies: ​*GitOps Integration*​ The primary code-controlled approach is through GitOps, where policy code generated by the policy-editor is saved into a Git repository before being deployed to your PDP (1) . This allows you full control of the code and enables you to set up CI processes between Permit environments, add tests, benchmarks, code reviews, and more . To set up GitOps, follow the guide at GitOps Overview . You can also configure GitOps using the CLI with:
Copy code
permit gitops create github
(2) ​*Permit CLI for Policy Management*​ The Permit CLI provides multiple ways to manage policies as code (3) : 1. ​*Export to Terraform*​ - Export your environment configuration as Terraform HCF files:
Copy code
permit env export terraform --file <http://permit-policies.tf|permit-policies.tf>
2. ​*Policy Creation Commands*​ - Create policies through interactive wizards or AI-powered generation (3) (4) 3. ​*Environment Management*​ - Copy policies between environments:
Copy code
permit env copy --api-key permit_key --from staging --to production
(3) ​*Key Resources:*​ • GitOps Overview (1) • CLI Documentation (3) • Custom Rego and GitOps (2) • Terraform Provider Integration (3) These approaches ensure your authorization policies are versioned, testable, and recoverable through standard development workflows.
To learn more, see the sources I considered: [[1] GitOps Overview](https://docs.permit.io/integrations/gitops/overview) [[2] Custom Rego (OPA) and GitOps](https://docs.permit.io/how-to/permit-cli/permit-cli-gitops) [[3] CLI Overview | Permit.io Documentation](https://docs.permit.io/how-to/permit-cli) [[4] Introducing the New Permit.io CLI: A New Era of Access Control Developer Experience](https://www.permit.io/blog/introducing-the-new-permit-cli)
Thanks for the feedback, glad I was helpful.