Git Product home page Git Product logo

seisollc / easy_sast Goto Github PK

View Code? Open in Web Editor NEW
12.0 7.0 3.0 562 KB

A docker container that integrates static analysis tools into your project

Home Page: https://seisollc.com

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.23% Makefile 0.58% Python 30.02% JavaScript 2.20% HTML 65.90% CSS 1.07%
static-code-analysis docker-image seiso security static-analysis docker-container security-testing docker python

easy_sast's Introduction

Easy SAST

CI: GitHub Actions CI: Code Coverage Security: Snyk Vulnerabilities Security: Bandit Code style: black License: BSD 3-Clause

easy_sast is a docker container for use in integration pipelines to submit an application's build artifacts to a static analysis tool. This has been developed in a way to serve as a build pattern for other containers meant to facilitate similar functionality, and natively integrates with Veracode's Static Analysis product.

easy_sast is available from Docker Hub by running docker pull seiso/easy_sast

For advanced usage and more information, see the wiki.

Features

This code base was developed in line with the Rugged Manifesto. As such, it is:

  • Simple to use: With workflow options and configurations that intuitively understand DevOps.
  • Easily configurable: Practical defaults, and numerous configuration options such as a config file, environment variables, and/or CLI arguments.
  • Clear and understandable code: Regular use of type hints, keyword arguments, and a normalized code style make understanding the code intent easy.
  • Engineered to be robust: Error handling, automated security validation, and pervasive validation.
  • 100% tested: 100% code coverage for unit tests on all commits.
  • 100% consistently formatted: Linting of Docker, make, YAML, and Python on all commits.

Quickstart

Prerequisites

In order to build and run this project, we recommend you have Docker 18.09 or newer, find, git, GNU make, and Python 3.

Setup

Integration requirements

In order to integrate with Veracode, you will need to:

Getting started

  1. Build the docker image:
    make build
  2. Run the docker container, passing it your API credentials and mounting the directory containing your build artifacts into /build:
    docker run --env-file <(env | grep ^VERACODE_API_KEY_) -v "/path/to/build":/build seiso/easy_sast:latest

Additional details and configuration options are outlined in usage and on the wiki.

Usage

Command-line

usage: main.py [-h] [--config-file CONFIG_FILE] [--version]
               [--debug | --verbose]

optional arguments:
  -h, --help                          show this help message and exit
  --config-file CONFIG_FILE           specify a config file
  --version                           show program's version number and exit
  --debug                             enable debug level logging
  --verbose                           enable info level logging

There are two recommended methods to pass information into easy_sast at runtime:

  1. Pass environment variables to docker run using --env-file. For example:
    docker run --env-file <(env | grep VERACODE_API_KEY_) -v "/path/to/build":/build seiso/easy_sast:latest
  2. You may also want to pass an argument to the Python in the container by appending your arguments to docker run. For example:
    docker run -e VERACODE_API_KEY_ID=EXAMPLE -e VERACODE_API_KEY_SECRET=EXAMPLE seiso/easy_sast:latest --debug

Want to learn about more advanced usage, such as optimizing SAST for pull requests? Check out the wiki.

Supported Veracode APIs

Note that at minimum your Veracode user must have permission to access the upload API and its getapplist.do endpoint.

If you'd like to see support for more Veracode APIs or workflows to interact with those APIs, please open an issue and let us know!

Contributing

  1. Fork the repository
  2. Create a feature branch via git checkout -b feature/description
  3. Make your changes
  4. Commit your changes via git commit -am 'Summarize the changes here'
  5. Create a new pull request (how-to)

easy_sast's People

Contributors

dependabot[bot] avatar jonzeolla avatar pb-seiso avatar seanctech avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

easy_sast's Issues

snyk incorrectly reporting 1 vulnerability

Summary

snyk.io is currently reporting that the version of pyyaml used by easy_sast is vulnerable to an Arbitrary Code Execution vulnerability. easy_sast was never susceptible to this vulnerability, as it has always used safe_load which is considered safe. MITRE has assigned this vulnerability CVE-2020-1747.

Potential Impact

There is no impact to the easy_sast project due to the appropriate use of safe_load to load untrusted yaml files. pyyaml is used for configuration loading (pyyaml 5.3), and the testing (pyyaml 5.3) of configuration loading.

Next Steps

  1. As a best practice, update the easy_sast requirements via make requirements when yaml/pyyaml#386 is merged and included in a release.
  2. Cut an easy_sast release with these updated requirements.
    • Based on the breaking changes introduced since the last release, this will be version 1.0.0 (see git log 'v0.2.0'...'0eefbb341facfdd5cfe73774faebdb311579d232' --oneline).

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.