<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Armory Docs – How to Use the Policy Engine</title><link>/plugins/policy-engine/use/</link><description>Recent content in How to Use the Policy Engine on Armory Docs</description><generator>Hugo -- gohugo.io</generator><atom:link href="/plugins/policy-engine/use/index.xml" rel="self" type="application/rss+xml"/><item><title>Plugins: Example Policies</title><link>/plugins/policy-engine/use/example-policies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/plugins/policy-engine/use/example-policies/</guid><description>
&lt;ul>
&lt;li>
&lt;p>Requires a reason to be provided for any rollback. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/undorolloutmanifest/"}>spinnaker.execution.stages.before.undoRolloutManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy will prevent scaleManifest stages from running in a pipeline unless it is triggered by a webhook with a source of &amp;lsquo;prometheus&amp;rsquo; (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/scalemanifest/"}>spinnaker.execution.stages.before.scaleManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example policy will prevent execution of any manual judgement stage that can be approved by multiple roles, or for which the approving role is not on a whitelist of approving roles. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/manualjudgment/"}>spinnaker.execution.stages.before.manualJudgment&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy will prevent a pipeline from starting execution of other pipelines unless it waits for them to complete before continuing. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/pipeline/"}>spinnaker.execution.stages.before.pipeline&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example policy requires delete manifest stages to provide a minimum 2 minute grace period when run in production. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/deletemanifest/"}>spinnaker.execution.stages.before.deleteManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Requires that baked images are of type &lt;code>hvm&lt;/code>. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/bake/"}>spinnaker.execution.stages.before.bake&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy requires that a set of annotations have been applied to any manifests that are being deployed. Specifically the annotations &amp;lsquo;app&amp;rsquo; and &amp;lsquo;owner&amp;rsquo; must have been applied. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/deploymanifest/"}>spinnaker.execution.stages.before.deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy prevents exposing a set of ports that are unencrypted buy have encrypted alternatives. Specifically this policy prevents exposing HTTP, FTP, TELNET, POP3, NNTP, IMAP, LDAP, and SMTP from a pod, deployment, or replicaset. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/deploymanifest/"}>spinnaker.execution.stages.before.deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy checks whether or not the image being approved is on a list of imaged that are approved for deployment. The list of what images are approved must seperately be uploaded to the OPA data document (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/deploymanifest/"}>spinnaker.execution.stages.before.deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy prevents applications from deploying to namespaces that they are not whitelisted for. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/deploymanifest/"}>spinnaker.execution.stages.before.deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example disables the use of concourse stages. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/concourse/"}>spinnaker.execution.stages.before.concourse&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Prevent server groups from being created in production with fewer than 1 instance. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/createservergroup/"}>spinnaker.execution.stages.before.createServerGroup&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example checks the manifest being applied and ensures that it contains a set of required annotations. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/patchmanifest/"}>spinnaker.execution.stages.before.patchManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example prevents patchManifest stages from running unless they require recording the patch annotation. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/patchmanifest/"}>spinnaker.execution.stages.before.patchManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Disables the &lt;strong>Configure Application&lt;/strong>, &lt;strong>Create Application&lt;/strong>, and &lt;strong>Create Project&lt;/strong> buttons in the UI for non-admin users unless they have a particular role. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.ui.entitlements.isfeatureenabled/"}>spinnaker.ui.entitlements.isFeatureEnabled&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Requires a manual approval by the &lt;code>qa&lt;/code> role, and a manual approval by the &lt;code>infosec&lt;/code> role happen earlier in a pipeline than any deployment to a production account. Production accounts must have been loaded into the OPA data document in an array named &lt;code>production_accounts&lt;/code>. (&lt;a href="/plugins/policy-engine/use/packages/opa.pipelines/#manual-approval-by-role"> opa.pipelines &lt;/a>)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Only allows applications to deploy to namespaces that are on an allow list. (&lt;a href="/plugins/policy-engine/use/packages/opa.pipelines/#allow-list-for-target-namespaces"> opa.pipelines &lt;/a>)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Prevents users from saving pipelines that deploy to production unless the pipeline includes a deployment window. Executions outside of that window are not allowed. (&lt;a href="/plugins/policy-engine/use/packages/opa.pipelines/#deployment-window"> opa.pipelines &lt;/a>)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy prevents scaling a deployment or replicaset in a production account to have &amp;lt;2 replicas. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.deployment/tasks.before/scalemanifest/"}>spinnaker.deployment.tasks.before.scaleManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example policy will prevent deleteManifest tasks from running unless they provide a grace period of 30 seconds or more. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.deployment/tasks.before/deletemanifest/"}>spinnaker.deployment.tasks.before.deleteManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Prevents cleanupArtifacts tasks from running on any account in a predefined list. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.deployment/tasks.before/cleanupartifacts/"}>spinnaker.deployment.tasks.before.cleanupArtifacts&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example prevents deploying of pods, pod templates (deployments/jobs/replicasets) and services that use the following services: HTTP, FTP, TELNET, POP3, NNTP, IMAP, LDAP, SMTP (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.deployment/tasks.before/deploymanifest/"}>spinnaker.deployment.tasks.before.deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy simply grants all users access to all APIs. It is a good policy to enable on &lt;code>spinnaker.http.authz&lt;/code> if you do not need a more complicated policy. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/"}>spinnaker.http.authz&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy disables the ability to create new applications for non-admin users unless their role is &amp;lsquo;applicationCreators&amp;rsquo; (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.createapplication/"}>Task Type: createApplication&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy disables the ability to create new applications, or update existing applications unless the applications have specified at least 1 role with &amp;lsquo;write&amp;rsquo; permissions. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.createapplication/"}>Task Type: createApplication&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This example will prevent users from deleting deployed manifests from production accounts on the &amp;lsquo;Clusters&amp;rsquo; tab of the spinnaker UI. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.deletemanifest/"}>Task Type: deleteManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy prevents requires users to enter a reason when performing a scale from outside or a pipeline. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.scalemanifest/"}>Task Type: scaleManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy prevents non-admin users from initiating a scaleManifest from the &amp;lsquo;clusters&amp;rsquo; tab of an application. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.scalemanifest/"}>Task Type: scaleManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>This policy disables the ability to create new applications, or update existing applications unless the applications have specified at least 1 role with &amp;lsquo;write&amp;rsquo; permissions. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.updateapplication/"}>Task Type: updateApplication&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Prevents editing manifests from outside of a pipeline on production accounts. (&lt;a href="/plugins/policy-engine/use/packages/spinnaker.http.authz/tasks/type.deploymanifest/"}>Task Type: deployManifest&lt;/a> )&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Restrict which named users can edit which pipelines for which applications. Any pipeline not explicitly specified in the policy is editable as usual. ( &lt;a href="/plugins/policy-engine/use/packages/spinnaker.execution/stages.before/savepipeline/"}>spinnaker.execution.stages.before.savePipeline&lt;/a> )&lt;/p>
&lt;/li>
&lt;/ul></description></item><item><title>Plugins: Policy Engine Packages</title><link>/plugins/policy-engine/use/packages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/plugins/policy-engine/use/packages/</guid><description>
&lt;h2 id="packages">Packages&lt;/h2>
&lt;p>The following is an index of key / value pairs for each of the packages Spinnaker provides to OPA. Use these as reference to create your own policies.&lt;/p></description></item></channel></rss>