GithubHelp home page GithubHelp logo

samy-dougui / ptf Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 0.0 126 KB

Policy as Code framework to control your Terraform deployments with HCL files.

Home Page: https://samy-dougui.github.io/ptf/

License: MIT License

Go 98.66% HCL 1.19% Makefile 0.15%
cli go hcl2 policy-as-code terraform policy

ptf's People

Contributors

samy-dougui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ptf's Issues

Add local variables

The goal would be to able to create local variables (module scoped) as locals in terraform.

Syntax should be like in Terraform:

How to define a local variable

locals {
    foo = bar
}

How to use a local variable

my_rule_attribute = local.foo

Creation of the hcl context

The load of the local variables should be done during the creation of the hcl context as it would be used inside the rule block.

Create modules of policies

Naming

A "module" (group of policy) of policy should be called a policies

Requirements

  • policies should have a source path
  • variables should be passed in the block

Design example

policies "azure_container_storage"{
    source = "path/to/policies"
    foo=bar
}

Add filtering capability on change.action

We should be able to filter on the change operation that Terraform wants to do.

It's referring to this attribute of the resource change:

"change": {
        "actions": [
          "no-op"
        ],
}

Add CI

Should be done after the issue #9 is done.

On every push, to any branch, the CI with the unit tests should be triggered.

When a push is made to main, the end-to-end tests should be done

Add wildcard in the attribute inside condition

Current situation

In the condition block, the attribute field allows to select nested attribute,
For example, "metadata.hdi_version" means PTF will be looking for something like

"metadata" : {
    "hdi_version": "value"
}

Desired situation

Sometimes, we have something like:

"blob_properties": [
            {
              "change_feed_enabled": "value",
              "container_delete_retention_policy": [],
              "cors_rule": [],
              "default_service_version": "",
              "delete_retention_policy": [],
              "last_access_time_enabled": "value",
              "versioning_enabled": "value"
            }
],

We should be able to control that by providing the attribute:

blob_properties[int | "*"].cors_rule

Add summary after execution

A summary after the execution should say:

  • the number of policies that passed
  • the number of policies that have a warning output
  • the number of policies that have a fail output
  • the number of policies that are disabled

Add markdown documentation

The documentation should include:

  • What is ptf
  • How to install it
  • How to use it with examples
  • How to contribute
  • Roadmap

Add cli subcommand to valide configuration

A subcommand should be created to help the user validate the policy files.

The UX should be something like:

ptf validate-config --chdir path 

This command should always ran before the apply to make sure the configuration is valid

Add CD

The CD pipeline should be triggered when a tag has been pushed to main.
It should create a binary executable on macOS, windows and linux (at least ubuntu and debian).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.