pre-commit-terraform
sops
pre-commit-terraform | sops | |
---|---|---|
13 | 150 | |
3,009 | 15,114 | |
- | 1.3% | |
8.7 | 9.0 | |
1 day ago | 7 days ago | |
Shell | Go | |
MIT License | Mozilla Public License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pre-commit-terraform
-
whats your development process for github actions and how are you testing them?
Personally I use pre-commit with some of these hooks in addition to some default hooks. It's basically a localised CI pipeline, and also means every commit has passed checks so keeps your commit history neat. Way faster to develop infrastructure code and fix issues than having to keep pushing to the remote repo and waiting for an Action to run.
- Breve guia de sobrevivência com Terraform
- Trying to learn pre-commit - how to handle multiple hooks in a small monorepo with different paths?
-
List of most useful Terraform open-source tools
https://github.com/antonbabenko/pre-commit-terraform because Terraform/Terragrunt configs should be documented, tidy and valid all the time :)
-
Terraform Module Template
Local testing with pre-commit-terraform. Formats code with terraform fmt Validates code with terraform validate Automatic README updates with terraform-docs. Static code analysis with TFLint, tfsec and checkov.
-
Hugo no theme
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca47c31..3e5cfef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,10 @@ repos: rev: v2.7.1 hooks: - id: prettier - types_or: [yaml, markdown, json] + types_or: [yaml, markdown, json, html] + additional_dependencies: + - "[email protected]" + - "[email protected]" - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.74.1 hooks:
-
Terraform Best Practices for Better Infrastructure Management
pre-commit-terraform – Pre-commit git hooks for automation
-
Using pre-commits hooks to improve terraform IaC code quality
Let me share a shameless plug (as an author of the pre-commit-terraform). I will show these hooks in action and answer questions during my live stream on Friday 29th of October - https://www.youtube.com/watch?v=ziJK79tI6tY
-
Best approach to manage S3
We the following of this set of hooks for our Terraform modules:
-
Can you validate ".tf" files via a script ?
Take a look on pre-commit scripts for terraform: https://github.com/antonbabenko/pre-commit-terraform. Of course, you can run it before git operations, for example:
sops
-
Pico.sh – Hacker Labs
My script just sets up default .sops.yaml for https://github.com/getsops/sops
You can further edit .sops.yaml(eg have multiple of them) and decide how you split secrets in your directory tree to further customize who can decrypt the secrets.
It works pretty well for prod/dev splits, etc
-
Encrypting your secrets with Mozilla SOPS using two AWS KMS Keys
Mozilla SOPS (Secrets OPerationS) is an open-source command-line tool for managing and storing secrets. It uses secure encryption methods to encrypt secrets at rest and decrypt them at runtime. SOPS supports a variety of key management systems, including AWS KMS, GCP KMS, Azure Key Vault, and PGP. It's particularly useful in a DevOps context where sensitive data like API keys, passwords, or certificates need to be securely managed and seamlessly integrated into application workflows.
-
An opinionated template for deploying a single k3s cluster with Ansible backed by Flux, SOPS, GitHub Actions, Renovate, Cilium, Cloudflare and more!
Encrypted secrets thanks to SOPS and Age
-
Tracking SQLite Database Changes in Git
We do the exact same thing to keep track of some credentials we use sops[1] and AWS KMS to separate credentials by sensitivity, then use the git differ to view the diffs between the encrypted secrets
Definitely not best practice security-wise, but it works well
[1] https://github.com/getsops/sops
-
The Twelve-Factor App
For anyone new to SOPS like I was - https://github.com/getsops/sops
- Storing and managing private keys
-
Show HN: Shello – Wrangle Environment Variables
I've found this is largely solved by strictly separating plain config and secrets, and then having secrets pull from GCP secret manager / vault / whatever.
You can then commit all the config (including the secret identifiers) and it all just works so long as you're authenticated with your secret storage system.
We do this for the live configuration as well in line with Gitops and find it to work well.
If you don't want to use a cloud secret manager you can also use something like https://github.com/getsops/sops to commit the encrypted secrets safely
-
Check your secrets into Git [video]
Basically, the simpler the better --just encrypt your secrets and check them in to version control.
We use SOPS[0] for this, and have found it to be pretty nice.
[0]: https://github.com/getsops/sops
-
How to secure secrets of docker-compose stacks with git?
The answer is that secrets shouldn't be stored in the git repo at all, but somewhere safe like a password manager or Mozilla's SOPS which people seem to love.
-
Is it safe to commit a Terraform file to GitHub?
Unfortunately, the SOPS project is in some sort of a limbo state and there has been quite a long period with limited maintenance and unclear position from Mozilla. Despite the project being accepted into the CNCF, it's still unclear what will happen with it going forward.
What are some alternatives?
plantuml-githook - A Git hook which spots PlantUML source files and generates diagrams in a structured way
sealed-secrets - A Kubernetes controller and tool for one-way encrypted Secrets
pre-commit-hooks - Some out-of-the-box hooks for pre-commit
Vault - A tool for secrets management, encryption as a service, and privileged access management
tfsec - Security scanner for your Terraform code [Moved to: https://github.com/aquasecurity/tfsec]
age - A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
terragrunt - Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
git-crypt - Transparent file encryption in git
checkov - Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
terraform-provider-sops - A Terraform provider for reading Mozilla sops files
atlantis - Terraform Pull Request Automation
vault-secrets-operator - Create Kubernetes secrets from Vault for a secure GitOps based workflow.