Configuration
Configure and customize the security audit recipe to match your project's specific needs and requirements.
Prerequisites
Before configuring the workflow, make sure you've completed the initial setup.
Need to install first? Follow the Getting Started Guide for the one-command setup or manual installation.
Workflow Configuration
Customize Basic Settings
Modify these core settings in .github/workflows/security-audit.yml
to match your project setup.
Repository Permissions Required
Ensure your repository has the correct permissions for the workflow to create and manage issues.
Setup Steps:
- Go to Settings > Actions > General
- Scroll down to Workflow permissions
- Select "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
Advanced Configuration
Custom pip-audit Options
Enhance your security scans with additional pip-audit features and caching for better performance.
Custom pip-audit options | |
---|---|
Multiple Requirements Files
Configure scanning for projects with separate development, testing, and production dependencies.
Custom Issue Labels
Personalize issue creation with custom labels to match your team's workflow and prioritization system.
Exclude Specific Packages
Ignore known false positives or vulnerabilities that don't apply to your use case.
- name: Run pip-audit with exclusions
run: |
pip-audit -r requirements.txt \
--ignore-vuln GHSA-xxxx-xxxx-xxxx \
--ignore-vuln CVE-2023-1234 \
--format json \
--output audit-results.json
Environment Variables
Available Workflow Variables
These environment variables are automatically set during the workflow execution and can be used for custom scripts or issue formatting.
# Audit results
$AUDIT_STATUS # clean | vulnerabilities_found | error
$VULN_COUNT # Number of vulnerabilities found
$AFFECTED_PACKAGES # Number of packages with vulnerabilities
# GitHub context
${{ github.repository }} # Repository name
${{ github.ref_name }} # Branch name
${{ github.sha }} # Commit SHA
${{ github.run_id }} # Workflow run ID
pip-audit Command Reference
Complete pip-audit Command Guide
Comprehensive reference for all pip-audit commands and options you might need for security auditing.
# Basic usage
pip-audit -r requirements.txt
# Output formats
pip-audit -r requirements.txt --format json
pip-audit -r requirements.txt --format markdown
pip-audit -r requirements.txt --format columns
pip-audit -r requirements.txt --format cyclonedx-json
pip-audit -r requirements.txt --format cyclonedx-xml
# Fix vulnerabilities automatically
pip-audit -r requirements.txt --fix
# Ignore specific vulnerabilities
pip-audit -r requirements.txt --ignore-vuln CVE-2023-1234
# Scan local directory
pip-audit .
# Scan specific package
pip-audit package-name==1.0.0
Next: Explore Real-World Examples
📚 Documentation Progress Checklist
Track your progress through the Python Security Audit Recipe documentation:
- 🏠 Home - Understanding the security challenge
- 📖 Getting Started - Quick overview and concepts
- ⚙️ Installation - Set up your environment
- 🔄 Workflow Details - Understand GitHub Actions mechanics
- 📋 Issue Templates - Master security notification management
- 🔧 Configuration - Customize for your project needs
- 📚 Examples - Real-world implementations
Next Up: Examples
Ready to see it in action? Continue to Examples to explore real-world implementations including Django, FastAPI, and monorepo setups!
Almost done! Check out examples to see complete implementations in various project types.