CDFoundation
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
###### tags: `Archived` # Policy Driven CD This is an initiative within the [CDF SIG Interoperability](https://github.com/cdfoundation/sig-interoperability). ## Quick links * [Introduction](#Introduction) * [Policy Types](#Policy-Types) * [Open Source Policy Frameworks](#Open-Source-Policy-Frameworks) * [Open Policy Agent](#Open-Policy-Agent) * [ONAP Policy Framework](#ONAP-Policy-Framework) * [Approaches to Policy](#Approaches-to-Policy) * [Communities and Technologies](#Communities) * [Jenkins](#Jenkins) * [Spinnaker](#Spinnaker) * [Tekton](#Tekton) * [Ortelius](#Ortelius) * [DeployHub Pro](#DeployHub-Pro) * [Zuul](#Zuul) * [Harness](#Harness) * [Users](#Users) * [eBay](#eBay) * [Ericsson](#Ericsson) * [Challenges](#Challenges) * [Terminology](#Terminology) * [Best Practices](#Best-Practices) * [Interoperability](#Interoperability) * [References and Past Presentations](#References-and-Past-Presentations) ## Introduction TBD ## Policy Types TBD ## Open Source Policy Frameworks ### Open Policy Agent Open Policy Agent is an infrastructure agnostic policy engine with the mission of decoupling decisions about policy from other application business logic, via "policies as code". Policies are expressed in a language called Rego which is supported via: * An online playground: https://play.openpolicyagent.org/ * IDE integrations (e.g. [vscode](https://marketplace.visualstudio.com/items?itemName=tsandall.opa)) * [Testing capabilities](https://www.openpolicyagent.org/docs/latest/policy-testing/) * [Command line REPL](https://www.openpolicyagent.org/docs/latest/#2-try-opa-eval) ### ONAP Policy Framework TBD ## Approaches to Policy ### Communities #### Jenkins Jenkins Pipeline has a check for insecure pipeline interpolation. This check is run before the pipeline and is not yet integrated into a policy, so it will not block a pipeline from running. If the check fails, a warning will be shown. There is interest within the Jenkins community to support OPA. #### [CloudBeees Pipeline Policies Plugin](https://docs.cloudbees.com/docs/admin-resources/latest/pipelines/pipeline-policies) This plugin enables pipeline policies. Currently, the plugin has one rule to enforce timeouts. Administrators can add multiple policies to govern pipeline execution. Each policy can have multiple rules for limiting timeouts either for the entire pipeline, paused actions, or for specific agents. Each pipeline policy can be set to issue a warning or to fail and have the pipeline stop executing. The intention is to add more policy rules in the future. #### Spinnaker The Armory flavor of Spinnaker [supports OPA](https://docs.armory.io/docs/armory-admin/policy-engine-enable/). Armory provides companies with an automated definition for deployment policies. The OPA Decision log can provide a full audit history of enforcement decisions. When reviewing policies, policy automation engineers can collaborate, and offer improvements to improve the effectiveness of the policies. All policies, and their automations, can be stored in GIT for easy auditing of changes over time. Example Policies Enforced with Spinnaker: 1) Enforcing which Spinnaker applications can deploy to which AWS account, or which kubernetes namespace. 2) Enforce separation of duties by controlling which user roles can approve a manual judgement step. 3) Enforcing that deployments cannot expose SSH (port 22) to the internet. 4) Enforce that all pipelines that deploy to a production account contain a manual judgement step earlier in the pipeline than the deploy to a production account. 5) Require certain pipeline steps to exist in a deployment pipeline. For example, we have a customer who requires a security scanning step be in the pipeline before and deployment step that touches a production account. 6) Disable buttons in the UI by user role. For example, we have customers who are disabling the ability to edit and delete deployments on the ‘Clusters’ tab from non-admin users, but keeping them for admin users. 7) Enforce application best practices. We have customers who, for example, require that all applications have explicit RBAC permissions #### Tekton A few ways that Tekton could integrate with Policy frameworks: * Enforcing policies via kubernetes webhooks (e.g. looking at TaskRuns and PipelineRuns), and either: * Preventing them from executing when policies are violated * Mutating them to enforce policies * Using policies to generate Pipelines and Tasks (e.g. express CD pipelines completely via policy) * Using [when expressions](https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md#guard-task-execution-using-whenexpressions) as gates to control execution of Tasks in a Pipeline * [Tekton Chains](https://github.com/tektoncd/chains) has a goal to store trusted information about executions and policies could be expressed against this * Tekton Triggers has support for [interceptors](https://github.com/tektoncd/triggers/blob/master/docs/eventlisteners.md#interceptors) for filtering, with built in support for CEL and extensibility which could support [Rego](https://github.com/tektoncd/triggers/issues/484) An interesting question to answer about policy is do you want it to be _reactive_ or _proactive_, e.g. do you want to find out that you are violating a policy, or do you want to use a policy to decide what you do. #### Ortelius Ortelius, serving as a centralized catalog for microservice deployment metadata and relationships is relatively unrestricted with some built-in guardrails. * License policy would ensure all components for an application version conform to an approved list of licenses. Ortelius would enforce that application versions from consuming components with unapproved licenses would not be deployed. * CVE policy would ensure all components for an application version conform to a risk level. Ortelius would enforce that application versions consuming components with a high risk level would not be deployed. * Configuration policy would be used to ensure specific configurations are in place for the application versions, component versions and environment combination. For example, does the cluster have enough nodes in it. Ortelius would enforce that the configuration is in conformance and prevent the application version from being deployed if there is a policy violation. #### DeployHub Pro A few ways that DeployHub Pro could integrate with Policy frameworks: * Authorization policy would be used to validate who can do what preventing unauthorized actions from happening. For example, which users can update a component or which group can execute a deployment. * Approved Component policy would be used to ensure all components for an application are on the "Approved to Use" list. This policy would allow new unapproved components in development but restricted for testing and production. DeployHub Pro would enforce the consumption of the components by applying the appropriate policy for the pipeline stage (dev, test, prod). * License policy would ensure all components for an application version conform to an approved list of licenses. DeployHub Pro would enforce that application versions from consuming components with unapproved licenses would not be deployed. * CVE policy would ensure all components for an application version conform to a risk level. DeployHub Pro would enforce that application versions consuming components with a high risk level would not be deployed. * Duplicate Component policy would be used to minimize the copying of code instead of it being made available as reusable code. DeployHub Pro would enforce that application versions consuming components do not have copied code in a component and would prevent the application version from being deployed. * SLO/SLI policy would be used as a reactive policy to revert a deployment to its previous version if the policy has been violated. DeployHub Pro would redeploy the previous version of the application to the environment. * Configuration policy would be used to ensure specific configurations are in place for the application versions, component versions and environment combination. For example, does the cluster have enough nodes in it. DeployHub Pro would enforce that the configuration is in conformance and prevent the application version from being deployed if there is a policy violation. #### Zuul Policy enforcement in Zuul is achieved through layered management of job definitions, and their mapping to build triggers via project pipelines. Because this configuration can be distributed across any of the Git repositories included in a tenant, even speculatively incorporating configuration from proposed changes not yet merged, people who control the content of those repositories or who can propose changes for them have the ability to influence what jobs are run and what those jobs do. In order to provide a central means of administration, any of this configuration can also reside in trusted repositories under the control of tenant managers, and is immutable from the perspective of untrusted repositories, or at least designed to limit what variables may be externally overridden. The upshot of this model is that tenant managers have the ability to specify particular jobs which must run and succeed before changes can merge, or mandate that certain playbooks are included within jobs, in addition to those which the maintainers of untrusted repositories might wish to add. While Zuul configuration can be organized in a variety of ways to provide policy enforcement, the documentation recommendeds a popular arrangement referred to as the Project Testing Interface: https://zuul-ci.org/docs/zuul/howtos/pti.html #### Harness The Harness Platform is an opinionated platform designed for safety and ease of use/implementation. Policy enforcement can be implicit or explicit in the Harness Platform. * Explicit * Leveraging OPA to enforce decisions across pipelines. * Seperation of duties such as the creator can't be the deployer. * Quality decisions and evidence. E.g promotion based on security scan. * Implicit * Pipeline conformance tests based on tags. * Enforcing standards via configuration-as-code with templates. * Pipeline and Application meta-data based decisions. ### Users #### eBay The approach to policy at eBay is more of a badge system. Badges are awarded by a central authority and events are produced based on this so other systems could subscribe to them. We are trying to make sure that as the manifest for a particular release is moving from environment to environment with ultimate goals to reach production. They achieve certain things along the way - those things are making sure a project or an application has a CD pipeline defined (build/unit tests/integration tests/security tests). All of these basically become badges so a manifest of an application that's a candidate for release receives along the way. For example; when unit tests finish, they report back to system and the system takes the manifest id, awarding a badge and so on and so forth. When they are ready to deploy to staging environment, it requires manifests to have certain set of badges to in order to be deployed. Otherwise, deployment is denied. This ensures things are done as per the company policy for different environments. (feature environment, staging environment, pre-production environment, production environment) This is similar to gating - gate allows or prevents deployment of a certain application version to different environments based on badges. #### Ericsson The use case at Ericsson is pretty similar to eBay. At Ericsson, the term " "Confidence Levels" are used. These confidence levels are applied when an artifact passes certain type of tests, gaining confidence levels. These confidence levels are carried by events, triggering actual deployments. In this case, the "Deployment system" doesn't search for badges but events are the main medium to trigger stuff. ## Challenges ### Terminology eBay: Badges are used to enforce policies Ericsson: Confidence Levels are used to enforce policies ### Best Practices TBD ### Interoperability TBD ## References and Past Presentations * [Recording of Initial discussion within SIG Interoperability during February 2021](https://youtu.be/VqoZy4E-ijo?t=727) and [Slides](https://github.com/cdfoundation/presentations/blob/master/sig-interoperability/Policy_Driven_CICD.pdf) * [CDF Meetup Policy Presentation during March 2021](https://www.youtube.com/watch?v=wAn1yJpJsW0) and [Slides](https://docs.google.com/presentation/d/1aJbdTRV7LxjsL7ptBViUSRWxK7qTD2UQSR0LawOKgnE/edit)

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully