This repository is a hands-on trial for implementing a full DevSecOps pipeline using GitHub Actions. It demonstrates how to integrate static and dynamic analysis, container security, semantic versioning, and automated deployment into a single CI/CD flow.
The GitHub Actions workflow automates the following steps:
- Purpose: Performs Static Application Security Testing (SAST).
- Tool: SonarQube.
- Outcome: Detects bugs, code smells, and security vulnerabilities before build.
- Includes:
- Run application tests (unit/integration tests).
- Hadolint scanning: Lints Dockerfiles to ensure best practices.
- Code standards: Enforces formatting/linting rules (e.g., ESLint/Prettier).
- Steps:
Build container: Builds Docker image of the application.Build application: Compiles or bundles the application if necessary.
- Purpose: Automatically generates version numbers and changelogs based on commit messages (using semantic-release).
- Action: Deploys the Docker container to a virtual machine (e.g., using SSH or cloud-specific CLI).
- Infrastructure: Typically configured with Ansible or remote Docker deployment.
- Purpose: Clears temporary resources, artifacts, or sensitive files from the runner.
-
Clone the repository:
git clone https://github.com/tukangk3tik/devsecops-trial.git cd devsecops-trial -
Add Secrets in GitHub:
SONAR_TOKENPAT_GITHUB_TOKENSONAR_HOST_URLVM_HOSTVM_SSH_KEYVM_SSH_PORTVM_USER
-
Add Vars in GitHub:
NODE_VERSIONPROJECT_NAME
-
Configure your
.github/workflows/ci.ymlfile to match your tools and infra.
- GitHub Actions
- SonarQube
- Hadolint
- Docker
- Semantic Release
- Ansible (optional for VM deployment)
This project is licensed under the MIT License.