Giter Club home page Giter Club logo

ezghsa's Introduction

EZGHSA

ezghsa command-line screenshot

Features

EZGHSA is a command-line tool for summarizing and filtering vulnerability alerts on Github repositories.

  • List alerts for a user, organization, or specific set of repositories.
  • Display Github Security Advisory (GHSA) IDs.
  • Filter alerts by ID, severity, and age.
  • Check if alerts are enabled or disabled.
  • Run interactively or from CI/CD scripts.

Setup and Install

Standalone Binary (Recommended)

Download EZGHSA from the Github releases page. The binary is statically-linked, so no other dependencies are needed.

Github Authentication

EZGHSA needs to authenticate with the Github API. Create a fine-grained access token with the following repository permissions:

  • Administration (read-only) - Required to check if Dependabot alerts are enabled on the repository.
  • Dependabot alerts (read-only) - Required to retrieve the alert information.
  • Metadata (read-only) - Required to get general status info about the Github repository.

You can allow the token to access all your repositories, or limit it to specific ones. EZGHSA will retrieve alerts from all repositories you give it access to, and ignore everything else.

Write your token to the file ~/.config/ezghsa/hosts.yml, in the following format:

github.com:
    oauth_token: github_pat_asdf1234asdf1234

Alternatively, you can use a personal access token with similar permissions.

EZGHSA also respects the GITHUB_TOKEN environment variable. This makes it easy to use on Github Actions and other CI environments.

Docker (Advanced)

A Docker container is provided for advanced workflows that cannot use the standalone binaries.

With credentials from the environment:

docker run -e GITHUB_TOKEN --rm csang/ezghsa:latest

With a bind-mounted credential file:

docker run -v "$HOME/.config/ezghsa/hosts.yml:/home/go/.config/ezghsa/hosts.yml:ro" \
    --rm csang/ezghsa:latest

Examples

# List alerts for all repos owned by the current user
ezghsa

# List alerts for specific repos
ezghsa --repo=csdev/ezghsa,csdev/csdev.github.io

# Filter alerts by GHSA ID
ezghsa --ghsa=GHSA-pxvg-2qj5-37jq

# Filter alerts by CVE ID
ezghsa --cve=CVE-2023-29469

# Filter alerts by severity (low, medium, high, critical)
ezghsa --severity=medium

# Filter and fail if alerts have been open longer than 30 days
ezghsa --days=30 --fail

# List all repos, fail if alerts are disabled
ezghsa --list-all --fail-disabled

Exit Status

ezghsa --fail exits with a non-zero status code if any matching alerts are found. The status code indicates the highest severity alert that was found.

  1. Unknown / generic error
  2. Low severity (LO)
  3. Medium severity (MD)
  4. High severity (HI)
  5. Critical severity (CR)

Color Output

EZGHSA supports the NO_COLOR and FORCE_COLOR environment variables from jwalton/gchalk. Color output will be written on TTY and CI environments, unless overridden by one of those variables.

License

EZGHSA is licensed under the MIT License. See LICENSE.txt.

The statically-linked distribution uses musl libc (MIT licensed).

For information on Go module dependencies and links to their open-source licenses, see the go.mod file or run ezghsa --version.

ezghsa's People

Contributors

csdev 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ezghsa's Issues

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.