Your First Security Scan
Learn how to run your first security scan with Alprina.
Create a Test File
Letβs create a file with intentional vulnerabilities:
test.py
# test.py - Sample vulnerable code
import os
# Hardcoded secret (vulnerability)
API_KEY = "sk-1234567890abcdef"
# SQL injection vulnerability
def get_user(username):
query = f"SELECT * FROM users WHERE name = '{username}'"
return db.execute(query)
# Debug mode enabled (security risk)
DEBUG = TrueRun the Scan
Scan the file with Alprina:
alprina scan test.pyUnderstanding the Output
Alprina will identify the vulnerabilities:
π Starting scan on: test.py
β Found 3 issues
ββββββββββββββ³ββββββββββββββββββ³ββββββββββββββββββββββββββββββ
β Severity β Type β Description β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β HIGH β Hardcoded Secretβ API key exposed in code β
β HIGH β SQL Injection β Unsanitized user input β
β MEDIUM β Debug Mode β Debug mode in production β
ββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββββββββββββββGet Detailed Information
View more details about the findings:
alprina scan test.py --verboseGenerate a Report
Create a comprehensive report:
alprina report --format htmlNext Steps
- CLI Commands - Explore all commands
- Fixing Vulnerabilities - Learn how to fix issues
- CI/CD Integration - Automate scanning
Last updated on