Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/devopsshield-cis-trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# DevOps Shield - The ultimate DevSecOps platform designed to secure your DevOps.
# https://devopsshield.com
##############################################################
# This is a DevOps Shield - Application Security - Code Security Template.

# This workflow template uses actions that are not certified by DevOps Shield.
# They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation.

# Use this workflow template for integrating code security into your pipelines and workflows.

# DevOps Shield Workflow Template Details:
# ------------------------------------------------------------
# Code: GH_CIS_TRIVY
# Name: Trivy Container Image Scanning
# DevSecOpsControls: CIS
# Provider: Aqua Security
# Categories: Code Scanning, Dockerfile
# Description:
# Scan Docker container images for vulnerabilities in OS packages and language dependencies with Trivy from Aqua Security.
# Trivy is a comprehensive and versatile security scanner.
# Trivy has scanners that look for security issues, and targets where it can find those issues.
# Read the official documentation to find out more.
# For more information:
# https://trivy.dev/latest/
# https://github.com/aquasecurity/trivy
# ------------------------------------------------------------
# Source repository: https://github.com/aquasecurity/trivy-action
##############################################################

name: Trivy Container Image Scanning

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: 0 0 * * 0

jobs:
trivy:
name: Trivy vulnerability scanner

runs-on: ubuntu-latest

permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build an image from Dockerfile
run: |
docker build -t docker.io/my-organization/my-app:${{ github.sha }} .

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
with:
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
60 changes: 60 additions & 0 deletions .github/workflows/devopsshield-dast-zed-attack-proxy-zap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# DevOps Shield - The ultimate DevSecOps platform designed to secure your DevOps.
# https://devopsshield.com
##############################################################
# This is a DevOps Shield - Application Security - Code Security Template.

# This workflow template uses actions that are not certified by DevOps Shield.
# They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation.

# Use this workflow template for integrating code security into your pipelines and workflows.

# DevOps Shield Workflow Template Details:
# ------------------------------------------------------------
# Code: GH_DAST_Zed_Attack_Proxy_ZAP
# Name: Zed Attack Proxy (ZAP) Penetration Testing
# DevSecOpsControls: DAST
# Provider: Checkmarx
# Categories: Code Scanning, Penetration Testing
# Description:
# Zed Attack Proxy (ZAP) by Checkmarx is a free, open-source penetration testing tool.
# ZAP is designed specifically for testing web applications and is both flexible and extensible.
# Automate with ZAP. ZAP provides range of options for security automation.
# The world�s most widely used web app scanner. Free and open source. A community based GitHub Top 1000 project that anyone can contribute to.
# A GitHub Action for running the ZAP Full Scan to perform Dynamic Application Security Testing (DAST).
# The ZAP full scan action runs the ZAP spider against the specified target (by default with no time limit) followed by an optional ajax spider scan and then a full active scan before reporting the results.
# WARNING this action will perform attacks on the target website. You should only scan targets that you have permission to test.
# Read the official documentation to find out more.
# For more information:
# https://www.zaproxy.org/
# https://www.zaproxy.org/docs/
# https://github.com/zaproxy/
# https://www.zaproxy.org/docs/automate/
# https://www.zaproxy.org/docs/guides/zapping-the-top-10-2021/
# ------------------------------------------------------------
# Source repository: https://github.com/zaproxy/action-full-scan
##############################################################

name: Zed Attack Proxy (ZAP) Full Scan

on:
push:
branches: [ main ]
schedule:
- cron: 0 0 * * 0

jobs:
zap_scan:
name: ZAP Full Scan
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Run ZAP Scan
uses: zaproxy/action-full-scan@v0.12.0
id: zap
with:
target: 'https://www.zaproxy.org/'
74 changes: 74 additions & 0 deletions .github/workflows/devopsshield-msdo-microsoft-security-devops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# DevOps Shield - The ultimate DevSecOps platform designed to secure your DevOps.
# https://devopsshield.com
##############################################################
# This is a DevOps Shield - Application Security - Code Security Template.

# This workflow template uses actions that are not certified by DevOps Shield.
# They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation.

# Use this workflow template for integrating code security into your pipelines and workflows.

# DevOps Shield Workflow Template Details:
# ------------------------------------------------------------
# Code: GH_MSDO_Microsoft_Security_DevOps
# Name: Microsoft Security DevOps (MSDO) - Defender for DevOps
# DevSecOpsControls: SAST, CIS, IACS
# Provider: Microsoft
# Categories: Code Scanning, Dockerfile, Python, JavaScript, EcmaScript, TypeScript, C#, .NET, ARM Template, Bicep, Kubernetes, JSON, YAML, CloudFormation, HCL, Terraform
# Description:
# Microsoft Security DevOps (MSDO) is a command line application which integrates static analysis tools into the development cycle.
# MSDO installs, configures and runs the latest versions of static analysis tools (including, but not limited to, SDL/security and compliance tools).
# Defender for DevOps helps integrate multiple tools with Advanced Security and sends the results to Defender for Cloud dashboard.
# Please note this workflow do not integrate with Microsoft Defender For DevOps.
# You have to create an integration and provide permission before this can report data back to Azure.
# Read the official documentation to find out more.
# For more information:
# https://github.com/microsoft/security-devops-action
# https://learn.microsoft.com/en-us/azure/defender-for-cloud/github-action
# https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-github
# ------------------------------------------------------------
# Source repository: https://github.com/microsoft/security-devops-action
##############################################################

name: Microsoft Security DevOps (MSDO) - Defender for DevOps

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: 0 0 * * 0

jobs:
MSDO:
name: Microsoft Security DevOps (MSDO)

# Windows and Linux agents are supported
runs-on: windows-latest

permissions:
contents: read
# Write access for security-events is only required for customers looking for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
security-events: write

steps:
# Checkout your code repository to scan
- uses: actions/checkout@v4

# Run analyzers
- name: Run Microsoft Security DevOps
uses: microsoft/security-devops-action@v1.6.0
id: msdo
# with:
# config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig').
# policy: 'GitHub' | 'microsoft' | 'none'. Optional. The name of a well-known Microsoft policy. If no configuration file or list of tools is provided, the policy may instruct MSDO which tools to run. Default: GitHub.
# categories: string. Optional. A comma-separated list of analyzer categories to run. Values: 'code', 'artifacts', 'IaC', 'containers'. Example: 'IaC, containers'. Defaults to all.
# languages: string. Optional. A comma-separated list of languages to analyze. Example: 'javascript,typescript'. Defaults to all.
# tools: string. Optional. A comma-separated list of analyzer tools to run. Values: 'bandit', 'binskim', 'checkov', 'eslint', 'templateanalyzer', 'terrascan', 'trivy'.

# Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
- name: Upload results to Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
60 changes: 60 additions & 0 deletions .github/workflows/devopsshield-ss-gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# DevOps Shield - The ultimate DevSecOps platform designed to secure your DevOps.
# https://devopsshield.com
##############################################################
# This is a DevOps Shield - Application Security - Code Security Template.

# This workflow template uses actions that are not certified by DevOps Shield.
# They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation.

# Use this workflow template for integrating code security into your pipelines and workflows.

# DevOps Shield Workflow Template Details:
# ------------------------------------------------------------
# Code: GH_SS_GITLEAKS
# Name: Gitleaks Secret Scanning
# DevSecOpsControls: SS
# Provider: Gitleaks
# Categories: Code Scanning, Secrets
# Description:
# Gitleaks is a tool for detecting and preventing hardcoded secrets like passwords, API keys, and tokens in git repos.
# Gitleaks is an easy-to-use, all-in-one solution for detecting secrets, past or present, in your code.
# Enable Gitleaks-Action in your GitHub workflows to be alerted when secrets are leaked as soon as they happen.
# A gitleaks-action license can be obtained at gitleaks.io.
# Read the official documentation to find out more.
# For more information:
# https://gitleaks.io/
# https://github.com/gitleaks
# https://blog.gitleaks.io/
# ------------------------------------------------------------
# Source repository: https://github.com/gitleaks/gitleaks-action
##############################################################

name: Gitleaks Secret Scanning

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: 0 0 * * *

jobs:
gitleaks:
name: Gitleaks Secret Scanning

runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
id: gitleaks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} # Only required for Organizations, not personal accounts.
58 changes: 58 additions & 0 deletions .github/workflows/devopsshield-ss-trufflehog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# DevOps Shield - The ultimate DevSecOps platform designed to secure your DevOps.
# https://devopsshield.com
##############################################################
# This is a DevOps Shield - Application Security - Code Security Template.

# This workflow template uses actions that are not certified by DevOps Shield.
# They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation.

# Use this workflow template for integrating code security into your pipelines and workflows.

# DevOps Shield Workflow Template Details:
# ------------------------------------------------------------
# Code: GH_SS_TRUFFLEHOG
# Name: TruffleHog Secret Scanning
# DevSecOpsControls: SS
# Provider: Truffle Security Co.
# Categories: Code Scanning, Secrets
# Description:
# TruffleHog is the most powerful secrets Discovery, Classification, Validation, and Analysis tool.
# In this context secret refers to a credential a machine uses to authenticate itself to another machine.
# This includes API keys, database passwords, private encryption keys, and more.
# Find, verify, and analyze leaked credentials.
# Read the official documentation to find out more.
# For more information:
# https://trufflesecurity.com/
# https://github.com/trufflesecurity/trufflehog
# ------------------------------------------------------------
# Source repository: https://github.com/trufflesecurity/trufflehog?tab=readme-ov-file#octocat-trufflehog-github-action
##############################################################

name: TruffleHog Secret Scanning

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: 0 0 * * *

jobs:
gitleaks:
name: TruffleHog Secret Scanning

runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run TruffleHog
uses: trufflesecurity/trufflehog@v3
id: trufflehog
with:
extra_args: --results=verified,unknown