Giter Site home page Giter Site logo

lexivanx / devsecops-pipeline Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 11 KB

DevSecOps pipeline using GitLab CI/CD, integrating security practices and compliance checks at each stage of the pipeline. It builds, tests, and deploys a sample web application, incorporating automated security scanning and compliance checking.

License: MIT License

Dockerfile 21.65% Python 8.92% Shell 16.58% HCL 52.85%

devsecops-pipeline's Introduction

DevSecOps Pipeline

DevSecOps pipeline using GitLab CI/CD, integrating security practices and compliance checks at each stage of the pipeline. It builds, tests, and deploys a sample web application, incorporating automated security scanning and compliance checking.

Technologies used

  • GitLab
  • Docker
  • Terraform
  • OpenSCAP
  • HashiCorp Vault
  • OWASP ZAP
  • SonarQube
  • Safety (Python dependency scanner)
  • Prometheus
  • Grafana

Project structure

  • app/: Contains the source code and Dockerfile for the sample web application
  • terraform/: Contains Terraform configuration files for provisioning infrastructure resources
  • openscap/: Contains scripts and configuration files related to OpenSCAP security scanning
  • monitoring/: Contains monitoring configurations, such as Prometheus configuration files
  • .gitignore: A file specifying files and directories that should be ignored by Git
  • .gitlab-ci.yml: Defines the GitLab CI/CD pipeline configuration
  • README.md: This file, which provides an overview of the project and instructions for getting started

How it works

  1. The GitLab CI/CD pipeline is triggered on code push or merge request.
  2. The pipeline builds the Docker image for the web application using the Dockerfile in the app/ directory.
  3. The pipeline runs OpenSCAP security scanning on the Docker image using the openscap/dockerfile_scan.sh script. The pipeline will fail if any high-risk vulnerabilities or non-compliant configurations are detected.
  4. The pipeline runs static application security testing (SAST) using SonarQube to scan the source code for vulnerabilities.
  5. The pipeline performs automated dependency scanning using Safety to identify vulnerabilities in the application's dependencies and libraries.
  6. The pipeline provisions infrastructure resources using Terraform, based on the configuration files in the terraform/ directory.
  7. The pipeline deploys the Docker container to the created infrastructure.
  8. HashiCorp Vault is used to securely store and manage sensitive information, such as API keys, database credentials, and SSL certificates. The pipeline integrates with Vault to access these secrets as needed.
  9. The pipeline runs dynamic application security testing (DAST) using OWASP ZAP to scan the web application for security vulnerabilities during runtime.
  10. Monitoring and alerting are set up using Prometheus and Grafana to notify of security events and vulnerabilities detected during the pipeline's execution or in the deployed application.
  11. A rollback mechanism is implemented in the pipeline to revert the infrastructure state in case of deployment failures or critical security vulnerabilities.

Getting started

  1. Clone the repository
  2. Set up a GitLab project and configure the necessary environment variables for GitLab CI/CD, such as Docker registry credentials, Terraform backend configuration, and HashiCorp Vault access tokens.
  3. Make changes to the Terraform configuration files in the terraform/ directory as needed, based on your infrastructure requirements.
  4. Configure the OpenSCAP scanning policy in the openscap/ directory.
  5. Set up a SonarQube server and configure a project for your application.
  6. Deploy and configure Prometheus and Grafana for monitoring and alerting.
  7. Push your changes to the GitLab project, which will trigger the CI/CD pipeline.
  8. Monitor the pipeline execution in GitLab and review the logs to ensure all stages are successful and that security scans and compliance checks are being performed as expected.

Contributing

  1. Fork the project and create a new feature branch.
  2. Make changes or additions to the project files.
  3. Ensure that your changes are properly tested and documented.
  4. Create a merge request to the main repository for review.

License

This project is licensed under the MIT License. Please see the LICENSE file for more information.

Acknowledgements

devsecops-pipeline's People

Contributors

lexivanx avatar

Stargazers

Austin Songer,MIS,CEH,ESCA,Project+ (Navy Veteran) avatar met4lwar avatar  avatar Armand AMOUSSOU avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

nguyenhoang2009

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.