A collection of resources to make it easy to add secure development practices to your project.
Table of Contents
This is intended to help you get started or further mature your security practices for your development projects. Whether you are a full time developer, hobbiest, or write the occasional script, there is something here to help you improve visibility into the security posture of your projects.
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 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 eachother. 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.)
Please consider opening a PR with your reccomendations about tools to add.
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:
pip 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.
Gitleaks will scan your commit history and staged changes for signs of possible secrets.
- Install:
brew install gitleaksdocker pull ghcr.io/zricethezav/gitleaks:latest- clone and
make build
- Configure:
.gitleaks.toml
- Run:
- Supports pre-commit
gitleaks detectwill scan git historygitleaks protectwill scan your staged changes
Semgrep is a static application security testing tool that provides support for multiple languages.
- Install:
brew install semgreppip install semgrepdocker pull returntocorp/semgrep
- Configure:
- YAML - See https://semgrep.dev/docs/
- Run:
semgrep scan --config autowill scan with default settings