Skip to content

francisw626/devsecops-actions

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

118 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” DevSecOps Actions

Enterprise-Grade Reusable GitHub Actions for Security Automation

Ministry of Justice Repository Compliance Badge


MIT License OpenSSF Scorecard

GitHub release GitHub issues GitHub pull requests

Overview

A comprehensive collection of production-ready, enterprise-grade GitHub Actions that standardise and automate DevSecOps security practices across the software development lifecycle. This suite provides best-in-class security scanning, dependency management, template synchronisation, and compliance reporting capabilities.

Core Capabilities:

  • Software Composition Analysis - Multi-tool dependency vulnerability detection
  • Secret Scanning - Dual-engine credential exposure prevention
  • SAST & Code Analysis - Semantic security vulnerability detection
  • Template Synchronisation - Automated Cookiecutter/Cruft updates
  • SBOM Generation - Software Bill of Materials for supply chain transparency
  • Repository Management - Dormant repository detection and archival workflows
  • Commit Validation - Signature verification and conventional commit enforcement
  • Compliance Reporting - Security posture assessment and audit trails

πŸ“‹ Table of Contents


πŸ—οΈ Architecture

Key Architecture Concepts

  1. Composite Actions: Reusable composite actions in dedicated directories provide modular functionality
  2. Explicit Permissions: Workflows must explicitly declare all required permissions following least-privilege principle
  3. Version Pinning: Use @vx.x.x for latest updates or @<commit-sha> for maximum stability
  4. Centralized Maintenance: Developed and managed by Ministry of Justice - OCTO Cyber team
  5. Zero Configuration: Sensible defaults with optional customisation via configuration files

πŸš€ Available Actions

πŸ” SCA - Software Composition Analysis

Path: ministryofjustice/devsecops-actions/sca

Enterprise-grade composite action for comprehensive software composition analysis, dependency management and security review across the entire software supply chain.

Introduction

Orchestrates 9 specialized security tools:

  1. πŸ“¦ Repository Checkout - Secure code retrieval
  2. πŸ“Š Dependency Review - PR vulnerability scanning
  3. πŸ”Ž OWASP Dependency-Check - CVE detection (CVSS β‰₯7.0 fails)
  4. πŸ” Renovate - Automated dependency updates
  5. πŸ”‘ MOJ Secret Scanner - Custom secret patterns
  6. 🐷 TruffleHog - Entropy-based secret detection (700+ detectors)
  7. βš™οΈ CodeQL - SAST semantic analysis
  8. πŸ›‘οΈ OpenSSF Scorecard - Security posture (18+ checks)
  9. πŸ“‹ SBOM Generator - CycloneDX-compliant bill of materials

Code

- uses: ministryofjustice/devsecops-actions/sca@v1.3.0
  with:
    token: ${{ secrets.GITHUB_TOKEN }}

Features

  • βœ… Zero Configuration - Works out-of-the-box
  • βœ… Multi-Language - JavaScript, Python, Java, .NET, Go, Ruby, Swift, Kotlin, C/C++
  • βœ… Container Scanning - Docker image SBOM generation
  • βœ… GitHub Integration - Results in Security tab
  • βœ… Compliance Ready - NTIA SBOM & EO 14028 compliant

πŸ“– Full SCA Documentation


πŸš€ Cruft - Template Synchronization

Path: ministryofjustice/devsecops-actions/cruft

Automated template synchronisation action that maintains consistency between repositories created from Cookiecutter/Cruft templates and their upstream sources.

Introduction

Orchestrates 4 specialized components:

  1. βš’οΈ Install - Python environment and Cruft setup
  2. πŸ”‘ Authenticate - HTTPS token authentication for private templates
  3. πŸ”Ž Check - Template update detection and availability checking
  4. ✏️ Create - Pull request creation with template updates

Code

Public Template:

- uses: ministryofjustice/devsecops-actions/cruft@v1.3.0
  with:
    token: ${{ secrets.GITHUB_TOKEN }}

Private Template:

- uses: ministryofjustice/devsecops-actions/cruft@v1.3.0
  with:
    private: "true"
    github-app-id: ${{ secrets.CRUFT_APP_ID }}
    github-app-private-key: ${{ secrets.CRUFT_APP_PRIVATE_KEY }}
    github-app-owner: "${{ github.repository_owner }}"
    github-app-repositories: "${{ github.event.repository.name }},template-repository"

Features

  • βœ… Automatic Sync - Detects upstream template changes
  • βœ… PR Automation - Creates pull requests automatically
  • βœ… Private Support - HTTPS token authentication for private repos
  • βœ… GitHub App Integration - Verified commits via GitHub App
  • βœ… Smart Naming - Date-based branch naming

πŸ“– Full Cruft Documentation


πŸ”Ž GitHub - Repository Management

Path: ministryofjustice/devsecops-actions/github

Repository health monitoring, lifecycle management, and commit validation actions that automate governance, compliance, and quality workflows.

Available GitHub Actions

  1. πŸ“¦ Repository Archive Check - Identifies dormant repositories eligible for archival
  2. πŸ” Commit Validation - Enforces commit signing and conventional commit messages

πŸ“¦ Repository Archive Check

Path: ministryofjustice/devsecops-actions/github/repository/archive

Automated repository health monitoring that scans commit history to identify dormant repositories.

Key Features:

  • βœ… Configurable Thresholds - Custom inactivity periods
  • βœ… Email Notifications - GOV.UK Notify integration
  • βœ… Commit Analysis - Deep repository activity scanning
  • βœ… Non-Destructive - Analysis only, no auto-archival
  • βœ… Audit Trail - Complete logging of checks

Code:

- uses: ministryofjustice/devsecops-actions/github/repository/archive@v1.3.0
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    notification-email: "team@example.gov.uk"
    gov-notify-key: ${{ secrets.GOV_NOTIFY_API_KEY }}
    gov-notify-template-id: ${{ secrets.GOV_NOTIFY_TEMPLATE_ID }}

πŸ“– Full Archive Check Documentation


πŸ” Commit Validation

Path: ministryofjustice/devsecops-actions/github/commit

Comprehensive commit verification that validates Git commits for security and quality standards.

Key Features:

  • βœ… Signature Verification - Ensures commits are cryptographically signed (GPG/SSH)
  • βœ… Conventional Commits - Enforces standardised commit message format
  • βœ… Zero Configuration - Works out-of-the-box with sensible defaults
  • βœ… Customisable - Supports custom commitlint configurations
  • βœ… Fast Validation - Lightweight verification process

Code:

- uses: ministryofjustice/devsecops-actions/github/commit@v1.3.0

πŸ“– Full Commit Validation Documentation


πŸ› οΈ Development

Prerequisites

Tool Version Purpose
Node.js 24.x Runtime for validation scripts
npm 10.x Package management
Docker 24.x+ Container-based security scanning
Git 2.40+ Version control

Local Development Setup

# Clone the repository
git clone https://github.com/ministryofjustice/devsecops-actions.git
cd devsecops-actions

# Install dependencies
npm install

# Run all validation checks
npm run validate:all

# Run individual validations
npm run lint:ts           # ESLint checks
npm run validate:ts       # TypeScript type checking
npm run validate:yml      # YAML linting
npm run validate:md       # Markdown linting
npm run validate:renovate # Renovate config validation
npm run spellcheck        # Spell checking

Quality Assurance

# Run comprehensive housekeeping
npm run housekeeping

# Update all dependencies and validate
npm update && npm run validate:all

# Run security audit
npm audit

# Check for outdated packages
npm outdated

Testing Actions Locally

# Test individual SCA components
cd sca/<component-name>

# Validate YAML syntax
npm run validate:yml

# Test with act (GitHub Actions local runner)
brew install act
act -W .github/workflows/sca.yml --container-architecture linux/amd64 -s GITHUB_TOKEN=<your-token>

🀝 Contributing

We welcome contributions from the community! Whether it's bug fixes, feature additions, documentation improvements, or security enhancements, your input is valuable.

Contribution Guidelines

  1. Fork and Clone: Fork the repository and clone it locally

  2. Branch: Create a feature branch (git checkout -b feature/amazing-feature)

  3. Pre-commit Hooks: Install MoJ pre-commit hooks for automatic validation

  4. Conventional Commits: Follow Conventional Commits for automatic changelog generation

    git commit -m "feat: add new secret detection pattern"
    git commit -m "fix: resolve CodeQL configuration issue"
    git commit -m "docs: update SBOM usage examples"
  5. Test: Ensure all validation checks pass

    npm run validate:all
    npm run spellcheck
  6. Pull Request: Submit a PR with a clear description of changes

  7. Review: Wait for maintainer review and address feedback

Commit Message Format

<type>(<scope>): <subject>

<body>

<footer>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks
  • ci: CI/CD changes

Examples:

feat(sca): add support for custom SBOM formats
fix(codeql): resolve timeout issue for large repositories
docs(readme): add enterprise configuration examples
chore(deps): update renovate to v43.31.1

Development Workflow

  1. Open an Issue: For major changes, open an issue first to discuss
  2. Get Feedback: Wait for maintainer feedback before significant work
  3. Implement: Make your changes following our coding standards
  4. Document: Update documentation for any user-facing changes
  5. Test: Ensure all checks pass
  6. Submit: Create a pull request with detailed description

Code Review Process

  • All PRs require approval from at least one maintainer
  • Automated checks must pass (YAML validation, linting, spell check)
  • Security scans must pass without introducing new vulnerabilities
  • Documentation must be updated for feature changes

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for full details.


πŸ“ž Support

Getting Help

  • πŸ“– Documentation: Check this README and inline action documentation
  • πŸ› Bug Reports: GitHub Issues
  • ✨ Feature Requests: GitHub Issues
  • πŸ”’ Security Issues: See Security for responsible disclosure

Issue Templates

When reporting issues, please use the appropriate template:

  • πŸ› Bug Report: For reproducible issues with the actions
  • πŸ’‘ Feature Request: For new capabilities or enhancements
  • πŸ“– Documentation: For documentation improvements or corrections
  • πŸ”’ Security: For security vulnerabilities (use private reporting)

Response Times

  • Critical Security Issues: Within 24 hours
  • Bugs: Within 3-5 business days
  • Feature Requests: Within 1-2 weeks
  • Documentation: Within 1 week

Community

  • Maintainer: Ministry of Justice OCTO Cyber team
  • Active Development: βœ… Actively maintained
  • Support: Community-driven with MoJ maintainer oversight

πŸ“Š Project Stats

GitHub stars GitHub forks GitHub watchers

GitHub last commit GitHub commit activity GitHub contributors


Made with ❀️ by the Ministry of Justice UK - OCTO Cyber

About

A collection of reusable GitHub Actions that standardise DevSecOps security scanning i.e. SCA, SAST, DAST, secrets, IaC, and container security.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages