A comprehensive, enterprise-grade GitLab CI/CD template library implementing DevSecOps best practices with automated security scanning, testing, and deployment.
Include the templates you need in your .gitlab-ci.yml and enable desired security scans:
# your-project/.gitlab-ci.yml
include:
- project: platform/devsecops-template
ref: v1.0.1
file:
- /templates/base.yml
- /templates/security/secrets.yml
- /templates/security/dependency.yml
- /templates/security/sast.yml
variables:
LANGUAGE: "node" # or python, php
ENABLE_DAST: "true"
STAGING_URL: "https://staging.example.com"
# Your custom jobs here...Detailed documentation for template usage can be found here.
Ccontains GitHub-specific configuration files for automation, CI/CD workflows, and dependency management.
Continuous Integration workflow that runs on every push and pull request.
Jobs:
-
Validation - Fast linting and security checks
lint-yaml- Validates YAML syntax and structurelint-templates- Checks template structure and OWASP SPVS compliancelint-stages- Validates stage naming conventionssecurity-secrets- Scans for exposed secrets (Gitleaks)security-trivy- Vulnerability scanning (Trivy)
-
Test - Template composition validation
test-composition- Validates template composition and job conflicts
-
Release - Automated release packaging
release-package- Creates release artifacts on new releases
Triggers:
- Push to
mainordevelopbranches - Pull requests to
mainordevelop - Release events (created, published)
Concurrency: Automatically cancels in-progress runs when new commits are pushed
Automated dependency updates configuration.
Ecosystems Monitored:
- GitHub Actions (weekly updates on Monday)
- Go modules in
/dagger(weekly updates on Monday) - Docker images in workflows (weekly updates on Monday)
Configuration:
- Opens up to 5 PRs per ecosystem
- Auto-labels PRs with
dependenciesand ecosystem-specific tags - Commit messages prefixed with
chore(deps):
# Run all linters locally (uses Docker)
./lint-local.sh
# Individual checks
yamllint templates/ examples/
python3 -c "import yaml; yaml.safe_load(open('templates/base.yml'))"# Using Dagger (requires Dagger CLI)
cd dagger
dagger call test --source=../examples/node --language=node# Validate GitLab CI syntax
docker run --rm -v "$PWD":/work -w /work python:3.12-slim sh -c \
"pip install -q pyyaml && python3 .gitlab/ci/validate.py"When adding new workflows or automation:
- Test locally first - Use
./lint-local.shto validate changes - Follow naming conventions - Use descriptive job and workflow names
- Add documentation - Update this README when adding new workflows
- Use concurrency groups - Prevent wasted CI minutes
- Pin action versions - Use
@v4not@latestfor stability