Frequently Asked Questions (FAQs)
Common questions and answers about the Python Security Audit Recipe.
Getting Started
What is the Python Security Audit Recipe?
The Python Security Audit Recipe is a GitHub Actions workflow that automatically scans your Python dependencies for security vulnerabilities using pip-audit
. It creates GitHub issues when vulnerabilities are found and provides detailed remediation guidance.
Do I need any special knowledge to use this?
No! The recipe is designed to work out-of-the-box with zero configuration. If you have a Python project with a requirements.txt
file, you can set it up in 30 seconds.
Is this free to use?
Yes! The recipe is completely free and open-source (MIT license). It runs on GitHub Actions, which provides free compute minutes for public repositories.
Installation & Setup
What files do I need in my repository?
You need:
- A
requirements.txt
file (or similar dependency file) - The workflow file in
.github/workflows/security-audit.yml
- Optional: Issue templates in
.github/ISSUE_TEMPLATE/
Can I use this with private repositories?
Yes! The recipe works with both public and private repositories. Private repositories get 2,000 free GitHub Actions minutes per month.
What if I don't have a requirements.txt
file?
You'll need a dependency file that pip-audit
can read:
requirements.txt
(most common)pyproject.toml
setup.py
- Or install dependencies directly in the workflow
How do I enable GitHub Actions in my repository?
GitHub Actions are enabled by default. Just add the workflow file to .github/workflows/
and it will run automatically.
Workflow & Scanning
How often does the security scan run?
By default:
- Weekly on Mondays at 8 AM UTC (scheduled)
- On push when
requirements.txt
changes - Manual trigger from the GitHub Actions tab
Can I change the scan schedule?
Yes! Edit the cron
expression in the workflow file:
schedule:
- cron: "0 8 * * 1" # Weekly on Monday
# - cron: "0 2 * * *" # Daily at 2 AM
# - cron: "0 8 * * 1,4" # Monday and Thursday
What vulnerability databases does it use?
The recipe uses pip-audit
, which checks multiple databases:
- PyPI Advisory Database
- OSV (Open Source Vulnerabilities)
- Python Packaging Advisory Database
Does the scan slow down my CI/CD pipeline?
The scan typically takes 1-3 minutes. You can configure it to run only on schedule (not on every push) to avoid slowing down development.
Issues & Notifications
Will it create a new issue for every scan?
No! The recipe is smart:
- Creates one issue when vulnerabilities are first found
- Updates the same issue with new scan results
- Closes the issue when vulnerabilities are resolved
- Creates clean reports weekly when no vulnerabilities exist
How do I know when vulnerabilities are found?
You'll get notified through:
- GitHub issue creation (with email notification if enabled)
- GitHub Actions failure (if configured to fail on vulnerabilities)
- Issue comments when vulnerabilities are resolved
Can I customize the issue templates?
Yes! The issue templates are in .github/ISSUE_TEMPLATE/
. You can modify:
- Issue titles and labels
- Content structure and formatting
- Additional information sections
Vulnerability Management
What should I do when vulnerabilities are found?
Follow this process:
- Review the created GitHub issue for details
- Update affected packages to recommended versions
- Test your application after updates
- Re-run the workflow to verify fixes
Can I ignore specific vulnerabilities?
Yes! Add exclusions to the workflow:
pip-audit -r requirements.txt \
--ignore-vuln CVE-2023-12345 \
--ignore-vuln GHSA-xxxx-xxxx-xxxx
What if a vulnerability has no fix available?
Document the risk assessment:
- Evaluate if the vulnerability affects your use case
- Consider alternative packages
- Add to ignore list if risk is acceptable
- Monitor for future fixes
Advanced Configuration
Can I scan multiple requirements files?
Yes! Check out our examples:
- Multi-Environment Recipe - For dev/staging/prod
- Django Recipe - For Django projects
- Monorepo Recipe - For multiple services
How do I customize Python version?
Update the PYTHON_VERSION
environment variable:
env:
PYTHON_VERSION: "3.11" # Change to your version
Can I integrate with Slack or Teams?
Yes! Add notification steps to the workflow:
- name: Notify Slack
if: env.AUDIT_STATUS == 'vulnerabilities_found'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Does it work with Poetry or Pipenv?
Currently optimized for requirements.txt
. For other tools:
- Poetry: Export requirements:
poetry export -f requirements.txt > requirements.txt
- Pipenv: Export requirements:
pipenv requirements > requirements.txt
- Future: Direct support planned for upcoming releases
Troubleshooting
The workflow is failing with 'pip-audit not found'
Ensure the workflow installs pip-audit:
- name: Install pip-audit
run: uv pip install --system pip-audit
No issues are being created despite vulnerabilities
Check repository permissions:
- Go to Settings → Actions → General
- Set Workflow permissions to "Read and write permissions"
- Enable "Allow GitHub Actions to create and approve pull requests"
The workflow runs but finds no dependencies
Verify your requirements file:
- Check file exists:
requirements.txt
- Check file has content (not empty)
- Check file path in workflow matches your structure
Can I run this locally before pushing?
Yes! Install pip-audit locally:
Performance & Limits
Are there any GitHub Actions limits I should know about?
GitHub provides:
- Public repos: Unlimited minutes
- Private repos: 2,000 free minutes/month
- Workflow runs: Max 6 hours per run
- Artifacts: 90-day retention (configurable)
How much storage do the artifacts use?
Audit artifacts are typically small:
- JSON results: 1-10 KB
- Markdown reports: 2-20 KB
- Total per run: Usually under 100 KB
Can I reduce the scan frequency to save minutes?
Yes! For private repos, consider:
- Monthly scans:
cron: "0 8 1 * *"
- Manual only: Remove
schedule
section - Critical changes only: Scan only on requirements.txt changes
Integration & Compatibility
Does this work with GitHub Enterprise?
Yes! The recipe works with:
- GitHub.com (public/private repos)
- GitHub Enterprise Server
- GitHub Enterprise Cloud
Can I use this with other security tools?
Absolutely! Combine with:
- Bandit for static code analysis
- Safety for additional vulnerability checking
- Snyk for comprehensive security scanning
- CodeQL for semantic code analysis
Is this compatible with dependabot?
Yes! They complement each other:
- Dependabot: Creates PRs for dependency updates
- Security Recipe: Monitors for vulnerabilities and creates issues
- Use both for comprehensive dependency management
Getting Help
Where can I get support?
Several options:
- GitHub Issues: Report bugs or request features
- Documentation: Comprehensive guides in the
/docs
folder - Examples: Real-world implementations in
/examples
- Community: GitHub Discussions (if enabled)
How do I contribute to the project?
Contributions welcome!
- Fork the repository
- Create a feature branch
- Submit a pull request
- Follow the contribution guidelines
Can I suggest new features?
Yes! Open a GitHub issue with:
- Feature description
- Use case explanation
- Implementation ideas (if any)
Still have questions?
Open an issue on GitHub or check our documentation for more details!