Giter Club home page Giter Club logo

guardrails-samples's Introduction

Turbot Guardrails Samples Repo

The Turbot Guardrails Samples Repo provides teams using Turbot Guardrails automation and configuration-as-code examples for effective management of Guardrails for their organization.

Download these examples

git clone https://github.com/turbot/guardrails-samples.git

GraphQL API

Includes working examples, queries and integrations written using the Guardrails GraphQL API. It's intended as a resource for developers to use as a starting point for your own integrations.

Control Objectives

Includes policy configurations (including some calculated policies) for implementing best-practice control objectives across cloud service platforms and services. The Control Objectives are implemented with Terraform, allowing you to manage and provision Guardrails with a repeatable, idempotent, versioned infrastructure-as-code approach.

Baselines

Baselines provide a starting point for the most common configuration templates needed when creating a new Turbot Guardrails workspace or onboarding a cloud provider resource into Guardrails. Baselines are implemented with Terraform, allowing you to manage and provision Turbot Guardrails with a repeatable, idempotent, versioned infrastructure-as-code approach.

Calculated Policies

Provides templates for implementing calculated policies. Calculated policies allow Guardrails administrators to modify or extend the default behavior and logic that Guardrails uses to evaluate controls. The calculated policy examples are implemented with Terraform allowing you to manage and provision Turbot Guardrails with a repeatable, idempotent, versioned infrastructure-as-code approach.

guardrails-samples's People

Contributors

ajnihill avatar bencornelius-tempus avatar bob-bot avatar cbruno10 avatar choxie avatar dboeke avatar debabrat-git avatar dependabot[bot] avatar digbijayineeclara07 avatar e-gineer avatar fatalbert3390 avatar joeturbot avatar krishna5891 avatar lalitlab avatar luisffc avatar omerosaienni avatar rajlearner17 avatar sidr0cker avatar sumitpopat avatar vkumbha avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guardrails-samples's Issues

Calculated Policies - Sets S3 bucket tags to a lowercase

The Terraform Script will create a smart folder and a calculate policy to apply on AWS > S3 > Bucket > Tags > Template.When the Calculated policy is applied to all tags across any bucket. Each tag will be checked for case, and if there is any upper case character, it will be converted to lower case.

Base Line - Common configuration for importing AWS

The AWS setup baseline terraform implements common configurations on your Turbot environment required to import an AWS account.

The Terraform script will do an account set up for AWS and installs the mods (if outdated or not installed)

  • turbot
  • turbot-iam
  • aws
  • aws-iam
  • aws-cloudtrail
  • aws-s3
  • aws-kms
  • aws-s3
  • aws-sns
  • aws-cloudwatch
  • aws-events

Control Objective - Turbot Service Roles

Provides a Terraform configuration for creating a smart folder and creating one policy to check the existence of Turbot service roles in an AWS account, and three subsequent policies that define which roles to check.

Control Objective - Turbot Logging Buckets

Provides a Terraform configuration for creating a smart folder and setting policies to check for Turbot logging bucket existence as well as enforcing versioning, encryption, and regional approval policies.

Control Objective - Flow log configuration check

Provides a Terraform configuration for creating a smart folder and alarming if flow logs are not enabled in a VPC.

Creates a smart folder which will be in alarming state by setting the flow log policy to Check: Not configured.

Add notifications example for nodeJS

Sample notifications GraphQL

One example for each type of watch:

  • Grant
  • Policy
  • Resource
  • Control

Examples:

  • For limits
  • Paging
  • Explicit resource
  • Within time-range

Control Objective - Set DB instance encryption at rest policy

Provides a Terraform configuration for creating a smart folder and creating a policy to set an RDS instances as not approved if the encryption at rest does not meet minimum requirements.

The Terraform script creates a smart folder and apply dummy turbot policy settings for an RDS instance. The policies will check if an instance is approved based on engine type and instance type.

Control Objective - Turbot IAM Roles

Provides a Terraform configuration for creating a smart folder and sets a policy to enable Turbot creating AWS IAM roles. Two policies are also created to check for AWS boundary policies.

Fix node package names

Currently, all the node packages are called:
"name": "@turbot/api-examples"

This should be changed to the script name.

Base Line - Azure CIS v1 Polcy setter

Added GraphQL to find all CIS policies for Azure.
Created an example on how to do this and described how to apply this to other Cloud Providers.
Created the base line which will install the CIS v1 defaults for Azure

Base Lines - Azure subscription import for existing subscriptions

The current version of Azure import will create the subscription using Azure AD.

Typically, clients have existing subscriptions and would want to show how to import instead.

We should rename the existing imports from azure_sub_import to azure_sub_create_then_import and azure_sub_import_ro to azure_sub_create_then_import_ro

Then we should create a new script called azure_sub_import.

This should introduce new variable which will be used by the provider as seen in the example that follows:

provider "azurerm" {
  client_id       = "GUID"
  environment     = "public"
  subscription_id = "GUID"
  tenant_id       = "GUID"
  client_secret   = "GUID"
  features {}
}

For documentation, have a look at the README.md from baselines/azure/azure_eventing

Control Objective - Ec2 volume approved

Provides a Terraform configuration for creating a smart folder and creating policies to ensure volumes that exist in the child account are approved. In this example, approval of a volume is based on the type of the volume. Check the aws-ec2 mod page for more information on EC2 volume approved policies and controls.

Add miscellaneous policies

Add a GraphQL example how to update a policy,
The GraphQL will look similar to the following code snippet

{
  policyDetail(resourceId: 183105788693237, uri: "tmod:@turbot/aws-s3#/policy/types/bucketVersioning") {
    policyTypeUri
    value {
      value
      turbot {
        id
      }
      resource {
        turbot {
          title
        }
      }
    }
    settings {
      items {
        resource {
          trunk {
            title
          }
        }
        orphan
        exception
        precedence
        turbot {
          id
        }
      }
    }
  }
}
---------------------------------------------------
mutation updatePolicySetting {
  updatePolicySetting(input: {id: 183972449659649, precedence: REQUIRED, value: "Skip"}) {
    turbot {
      id
    }
    value
  }
}

Rearrange file structure for api examples

I was looking at TDK, concentrating on the api examples only for now.
I want to modify the folder structure from

.
└── api_examples
    └── graphql
        ├── clients
        │   ├── node
        │   ├── python
        │   └── shell
        └── queries

To

.
└── api_examples
    └── graphql
        ├── clients
        │   ├── node
        │   │    ├── define-node-example-in-snake-case-as-folder-1
        │   │    ├── define-node-example-in-snake-case-as-folder-2
        │   │    └── define-node-example-in-snake-case-as-folder-3
        │   ├── python
        │   │    ├── define-python-example-in-snake-case-as-folder-1
        │   │    ├── define-python-example-in-snake-case-as-folder-2
        │   │    └── define-python-example-in-snake-case-as-folder-3
        │   └── shell
        │   │    ├── define-shell-example-in-snake-case-as-folder-1
        │   │    ├── define-shell-example-in-snake-case-as-folder-2
        │   │    └── define-shell-example-in-snake-case-as-folder-3
        │   └── powershell
        │        ├── define-powershell-example-in-snake-case-as-folder-1
        │        ├── define-powershell-example-in-snake-case-as-folder-2
        │        └── define-powershell-example-in-snake-case-as-folder-3
        └── queries

Each script will have its:

  • README.md
  • package.json

Will provide better code management

Control Objective - RDS Audit Logging

Provides a Terraform configuration for creating a smart folder and applying example Turbot policy settings checking for Audit Logging DB Parameters on RDS instances.

Control Objective - Check if default VPC exists

Provides a Terraform configuration for creating a smart folder and creating a policy to check if the default VPC exists.

The Terraform script will create a smart folder and a policy to check for default VPC, if exists the control will go into alarm state.

Control Objective - Enable Global CloudTrail

Provides a Terraform configuration for creating a smart folder and configuring Turbot to create a Global CloudTrail in the specified region for audit logging purposes.

The Terraform script will create a smart folder to configure the CloudTrail stack in a specific region. Need to set the Turbot Audit Trail as Enforce: Configured as it provides a mechanism for configuring a CloudTrail to record API calls to your AWS accounts.

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.