Giter Club home page Giter Club logo

pccs-custom-policies's Introduction

Prisma Cloud Code Security Custom Policies

A repository to store custom policy examples that do not belong as out-of-the-box policies for Code Security.

You can learn more about writing custom policies here: https://www.checkov.io/3.Custom%20Policies/YAML%20Custom%20Policies.html

Also, leverage out-of-the-box policies from Checkov.

Using Custom Policies with Checkov

This guide explains how to use custom policies with Checkov by incorporating them from external repositories. You can utilize custom policies either from the command line or using the pre-commit utility.

Using Custom Policies from the Command Line

To download a Git repository containing custom checks, use the following command:

checkov -d . --external-checks-git [email protected]:PaloAltoNetworks/pccs-custom-policies.git

Work with subdirectory

If you only want to download a specific subdirectory from a GitHub repository, you can specify the subdirectory after a double-slash //.

checkov -d . --external-checks-git [email protected]:PaloAltoNetworks/pccs-custom-policies.git//python

Using Custom Policies with the Pre-Commit Utility

Installing Pre-Commit

You can install the pre-commit utility using pip. It is recommended to install it within a virtual environment to avoid conflicts with other packages.
To install it in a virtual environment, follow these steps:

python3 -m venv pre-commit-env
source pre-commit-env/bin/activate
pip install pre-commit

Creating a Pre-Commit Configuration File

To set up pre-commit for a project, create a .pre-commit-config.yaml file in the root of your project directory. An example configuration file for Checkov might look like this:

repos:
- repo: https://github.com/bridgecrewio/checkov.git
  rev: '2.3.176' # Checkov Version
  hooks:
  - id: checkov
    args: ['--external-checks-git', '[email protected]:PaloAltoNetworks/pccs-custom-policies.git//python', '--soft-fail']

Installing Git Hooks

After creating the configuration file, run the following command to install the Git hooks:

pre-commit install

Now, pre-commit will run the specified hooks every time you try to commit changes to your repository.

pccs-custom-policies's People

Contributors

tsmithv11 avatar simonpanw avatar tprenderville avatar

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.