Create Policy
Last updated
Last updated
Policies will help you to maintain strict guidelines for a deployment pipeline by allowing users to validate the application configuration while creating an application in spinnaker through a policy.
Policies are of two types:
Static Policy: A policy that is enforced at all times.
Run time Policy: A policy that can only take effect while running a pipeline.
To create a new policy follow the steps below:
From the ISD application dashboard, click Setup and then click Policies to access the policies page, where you can create, edit and delete the policies.
In the Policies page, click New Policy button to create a policy as shown in the image below.
New Policy creation screen appears and selects policy type from the drop-down as shown below:
Static Policies can be created/edited only by the Administrators.
Runtime Policies can be created/edited by the Developers.
Enter the following details:
Name: Enter the Name of the policy in the text box.
Policy Type: Select the Policy type from the drop-down.
Policy Engine: Select the Policy Engine as OPA from the drop-down.
Policy Engine Account: Select the Policy Engine Account from the drop-down.
Policy Description: Enter the Policy Description in the text box.
Policy File: Select and add any available Policy file.
Enter the Policy Details in the text box and click Save & Finish to create the policy. Users can restrict the group permission to access this policy by enabling the Policy permissions as shown in the image below.
Note: The repository contains a collection of sample policies that can be used with OpsMx ISD. Refer to the below link to view the sample policies.
Here are a couple of examples from the repository:
Static Policy to restrict image source while a pipeline is being saved
Dynamic policy that verifies the deployment is not happening during a blackout window
To know more about policy as code, refer here.