This repository contains intentionally vulnerable code for practicing security scanning with GitHub Actions.
DO NOT use this code in production. These vulnerabilities are for educational purposes only.
This repository includes several types of security issues:
| File | Vulnerability Type |
|---|---|
package.json + package-lock.json |
Outdated dependencies with known CVEs |
config.js |
Hardcoded secrets (AWS keys, database credentials, API keys) |
Dockerfile |
Container running as root |
terraform/main.tf |
Infrastructure misconfigurations (public S3, open SSH, unencrypted DB) |
Note: The package-lock.json file is required for Trivy to detect npm vulnerabilities. Without it, Trivy cannot determine exact package versions.
Click the Fork button in the top-right corner to create your own copy.
After forking, create a new branch for your security lab work:
git clone https://github.com/YOUR-USERNAME/Github-Actions-Lab.git
cd Github-Actions-Lab
git checkout -b security-lab
git push -u origin security-labWhy use a branch?
- Keeps the vulnerable baseline on
mainfor reference - Allows you to create Pull Requests and see security scan comments
- Simulates real-world development workflow
- You can compare "before" and "after" states
On your security-lab branch, create workflows in .github/workflows/:
- Gitleaks - Detects hardcoded secrets
- Trivy - Scans dependencies, containers, and infrastructure code
Follow the lab instructions to create and configure these workflows.
After adding workflows, create a PR from security-lab to main to see:
- Security scan results as PR comments
- Status checks blocking merge
- Detailed findings in the Security tab
When you run security scans, you should find:
- AWS Access Key ID
- AWS Secret Access Key
- Database connection string with password
- Stripe API key
- JWT secret
- lodash: CVE-2020-8203, CVE-2021-23337 (Prototype Pollution)
- axios: CVE-2021-3749 (ReDoS)
- minimist: CVE-2021-44906 (Prototype Pollution)
- S3 bucket with public access enabled
- Security group with SSH open to 0.0.0.0/0
- RDS instance without encryption
- RDS instance publicly accessible
- Hardcoded database password
- Secret Detection - Configure Gitleaks to find hardcoded secrets
- Dependency Scanning - Set up Trivy to detect vulnerable packages
- Container Scanning - Build and scan the Docker image
- IaC Scanning - Detect Terraform misconfigurations
- Security Pipeline - Combine all scans into a complete security gate
- Remediation - Fix the vulnerabilities and verify scans pass
- Repository must be PUBLIC - Code scanning (Security tab) is only available for public repositories on free GitHub plans
- GitHub Actions is free for public repositories
- SARIF upload requires
security-events: writepermission in the workflow - Enable "Read and write permissions" in Settings → Actions → General → Workflow permissions
This repository is for educational purposes only. The vulnerabilities, secrets, and misconfigurations are intentional and should never be used in real applications. All secrets in this repository are fake/example values.