What are pre-commit hooks and what security checks suit them?
BeginnerConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer
Pre-commit hooks run scripts before a commit is created. The pre-commit framework manages them from .pre-commit-config.yaml.
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
Good fits: secret detection, large-file checks, Terraform fmt/validate, tfsec/Checkov on changed files. Keep them under a few seconds or developers will skip them.
More on Application Security Testing (SAST, DAST, SCA, Secrets)
What is SAST and what are its strengths and limits?BeginnerWhat is DAST and how does it differ from SAST?BeginnerWhat is IAST and RASP?IntermediateWhat is SCA and what does it scan?BeginnerHow does a SAST tool find a SQL injection using taint analysis?AdvancedHow do you write a simple Semgrep rule?Intermediate