Skip to content

Github action that performs security scans and comments the results on pull-requests

License

Notifications You must be signed in to change notification settings

FollowUpBoss/security-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action - Security Scanner and Reporter

GitHub Release License: MIT

Table of Contents

Usage

Action Setup

name: Security Scan PR

on: 
  pull_request:
    types: [opened, ready_for_review, reopened]

jobs:
  security-scan-pr:
    name: Security Scan PR
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Run Scans and Comment on PR
        uses: FollowUpBoss/security-action@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

If you want to scan only the diff from the PR and not the entire branch

name: Security Scan PR

on:
  pull_request:
    types: [opened, ready_for_review, reopened]

jobs:
  security_scan_pr:
  name: Security Scan PR
  runs-on: ubuntu-latest
  steps:
    - name: Checkout code
      uses: actions/checkout@v4
      with: fetch-depth: 0
    - name: Generate diff
      run: git diff origin/main origin/${GITHUB_HEAD_REF} > diff
    - name: Run Scans and Comment on PR
      uses: FollowUpBoss/security-action@main
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        scan-type: "diff"

Features

Action uses Trivy to perform scanning. Currently it is configured:

  • Run Misconfiguration scanning against Infrastructure as Code
  • Output the scan in json format
  • Parse and validate scan output
  • Generate or Update a PR comment

About

Github action that performs security scans and comments the results on pull-requests

Resources

License

Stars

Watchers

Forks

Packages

No packages published