An incremental adoption guide for developers looking to onboard SDLC in your projects.
Table of Contents
Consider the following roadmap for implementation:
-
Install the IDE extensions into your editor and read about any findings the tools have, addressing them as appropriate.
-
Download some of the mentioned CLI tools and run them against the whole project to see about any areas of improvement outside of your current working files.
-
Once you feel that your project meets the standards you would like, employ Continuous Integration tools (coming soon) to enforce these standards on your code and future contributions. This increases consistency and confidence as your project evolves.
This section has a number of options that can be used in concert or independent with each other. They are ordered in the ease of implementation, from easiest to most difficult. Simultaneously they are ordered from individual to team impact (as implementing it yourself is naturally easier to do.)
The easiest place to start is by adding tools to your IDE that help identify areas for improvement in your code. Some of these tools are similar across editors while others are only available for a specific tool.
These sections and tools have no particular order.
For language specific tools, please see the cli_tools/README.md.
pre-commit is a flexible tool that installs itself as a git hook that can run a series of tools against only the changed files in your project. Further, it can be installed to run before each commit, enforcing checks on the files staged for commit.
- Install:
pipx install pre-commitoruv tool install pre-commit
- Configure:
.pre-commit-config.yaml.- Please see cli_tools/pre-commit/README.md for sample configuration files that you can employ in your project.
pre-commit install --install-hooksto install git hooks
- Run:
git committo run against staged changes once the git hook is installedpre-commit runto run against staged changespre-commit run --allto run against all files
As an additional level, you can have your continuous integration (CI) service execute these same tasks across your merge request changes or entire code base to validate the compliance with the pre-commit configuration.
Note:
pre-commitis a well known tool for running and managing pre-commit hooks though tools likeprekoffer compatibility and improved performance that may benefit your workflow.
Gitleaks will scan your commit history and staged changes for signs of possible secrets.
- Install:
brew install gitleaksfor macOSdocker pull ghcr.io/zricethezav/gitleaks:latest- clone and
make build
- Configure:
.gitleaks.toml
- Run:
- Supports pre-commit and GitHub Actions
gitleaks gitwill scan git historygitleaks dirwill scan selected paths
Semgrep is a static application security testing tool that provides support for multiple languages.
- Install:
brew install semgreppipx install semgreporuv tool install semgrepdocker pull semgrep/semgrep
- Configure:
- YAML - See https://semgrep.dev/docs/
- Run:
semgrep scan --config autowill scan with default settings