Skip to main content Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/tools-only/X-Skills --skill security-scanThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... More from this repository
Related occupations SOC
Based on SOC occupation classification
name security-scan description Comprehensive database security scanner with OWASP compliance checks,...
shortcut secu
Database Security Scanner
Implement production-grade database security scanning for PostgreSQL and MySQL that detects 50+ security vulnerabilities including weak passwords, excessive permissions, SQL injection vectors, missing encryption, exposed ports, and insecure configurations. Provides OWASP Database Security compliance reports, automated remediation scripts, and continuous security monitoring with SOC2/HIPAA/PCI DSS audit trails.
When to Use This Command
Use /security-scan when you need to:
Perform security audits for compliance (SOC2, HIPAA, PCI DSS)
Detect vulnerabilities before security incidents occur
Validate database hardening after deployment
Generate security reports for stakeholders and auditors
Implement continuous security scanning in CI/CD pipeline
Identify privilege escalation risks and over-permissioned users
DON'T use this when:
You lack permission to query security-sensitive system tables
Database is in active development (expect frequent config changes)
You need application-level security testing (use SAST/DAST tools)
Cloud-managed database with built-in security scanning (use AWS RDS/CloudSQL tools)
You lack remediation authority (read-only security assessment)
Design Decisions
This command implements comprehensive multi-layer security scanning because:
Checks 50+ OWASP Database Security vulnerabilities
Validates encryption at rest and in transit (SSL/TLS)
Detects privilege escalation and over-permissioned roles
Identifies SQL injection vectors in stored procedures
Scans for weak authentication and default credentials
Generates automated remediation scripts for findings
Alternative considered: Manual security checklist
Simple for small databases (<10 users, <50 tables)
Time-consuming and error-prone for large databases
No continuous monitoring or automation
Recommended for one-time assessments only
Alternative considered: Commercial security tools (Tenable, Qualys)
More comprehensive (network scanning, OS hardening)
Expensive licensing ($10k-50k/year)
Better for enterprise-wide security programs
Recommended when budget allows and compliance requires
Prerequisites
Before running this command:
Database superuser or security admin permissions
Access to system catalogs (pg_catalog, information_schema)
Understanding of compliance requirements (PCI DSS, HIPAA, SOC2)
Authority to implement remediation recommendations
Backup before applying security hardening changes
Implementation Process
Step 1: Connect with Security Admin Privileges
Ensure connection has permissions to query user roles, grants, and configurations.
Step 2: Run Vulnerability Scans
Check authentication, authorization, encryption, auditing, and network security.
Step 3: Analyze Findings
Categorize vulnerabilities by severity (critical, high, medium, low).
Step 4: Generate Remediation Scripts
Create SQL scripts to fix identified issues with rollback procedures.
Step 5: Validate and Re-scan
Apply fixes in staging, validate, then re-scan to confirm remediation.
Output Format
The command generates:
security_report.md - Human-readable security audit report with severity ratings
vulnerabilities.json - Machine-readable findings for CI/CD integration
remediation.sql - SQL script to fix identified vulnerabilities
compliance_matrix.xlsx - Mapping to SOC2/HIPAA/PCI DSS controls
security_baseline.yml - Configuration baseline for future scans
Code Examples
Example 1: PostgreSQL Comprehensive Security Scanner
"""
Production-ready PostgreSQL security scanner implementing OWASP
Database Security Project checks with automated remediation.
"""
import psycopg2
from psycopg2.extras import RealDictCursor
from typing import List , Dict , Optional
from dataclasses import dataclass
from enum import Enum
import json
import logging
from datetime import datetime
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class Severity (Enum ):
"""Vulnerability severity levels."""
CRITICAL = "critical"
HIGH = "high"
MEDIUM = "medium"
LOW = "low"
INFO = "info"
@dataclass
class SecurityFinding :
"""Represents a security vulnerability finding."""
check_id: str
title: str
severity: Severity
description: str
affected_objects: List [str ]
remediation: str
owasp_category: str
compliance_mappings: Dict [str , str ]
class PostgreSQLSecurityScanner :
"""
Comprehensive PostgreSQL security scanner with OWASP compliance.
"""
def ( ):
.conn_string = conn_string
.findings: [SecurityFinding] = []
( ) -> [SecurityFinding]:
logger.info( )
psycopg2.connect( .conn_string) conn:
._check_weak_passwords(conn)
._check_excessive_permissions(conn)
._check_superuser_roles(conn)
._check_public_schema_permissions(conn)
._check_ssl_encryption(conn)
._check_password_encryption(conn)
._check_data_encryption_at_rest(conn)
._check_audit_logging(conn)
._check_connection_logging(conn)
._check_statement_logging(conn)
._check_listen_addresses(conn)
._check_pg_hba_configuration(conn)
._check_dynamic_sql(conn)
._check_untrusted_extensions(conn)
._check_insecure_settings(conn)
._check_default_configurations(conn)
logger.info( )
.findings
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
weak_roles = [row[ ] row cur.fetchall()]
weak_roles:
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.CRITICAL,
description= ,
affected_objects=weak_roles,
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
excessive_grants = cur.fetchall()
excessive_grants:
affected = [
row excessive_grants
]
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.HIGH,
description= ,
affected_objects=affected,
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
superusers = [row[ ] row cur.fetchall()]
(superusers) > :
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.HIGH,
description= ,
affected_objects=superusers,
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
can_create = cur.fetchone()[ ]
can_create:
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.MEDIUM,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
ssl_enabled = cur.fetchone()[ ] ==
ssl_enabled:
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.CRITICAL,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
method = cur.fetchone()[ ]
method != :
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.HIGH,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
log_dest = cur.fetchone()[ ]
log_dest == :
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.HIGH,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
log_connections = cur.fetchone()[ ] ==
log_connections:
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.MEDIUM,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
listen = cur.fetchone()[ ]
listen ( , ):
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.MEDIUM,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
vulnerable_funcs = [row[ ] row cur.fetchall()]
vulnerable_funcs:
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.CRITICAL,
description= ,
affected_objects=vulnerable_funcs,
remediation= ,
owasp_category= ,
compliance_mappings={
: ,
:
}
))
( ) -> :
conn.cursor(cursor_factory=RealDictCursor) cur:
cur.execute( )
checksums = cur.fetchone()
checksums checksums.get( ) == :
.findings.append(SecurityFinding(
check_id= ,
title= ,
severity=Severity.LOW,
description= ,
affected_objects=[ ],
remediation= ,
owasp_category= ,
compliance_mappings={
:
}
))
( ) -> :
report_lines = [
,
,
,
,
]
severity_counts = {s: s Severity}
finding .findings:
severity_counts[finding.severity] +=
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
i, finding ( ( .findings, key= f: f.severity.value), ):
severity_emoji = {
Severity.CRITICAL: ,
Severity.HIGH: ,
Severity.MEDIUM: ,
Severity.LOW: ,
Severity.INFO:
}
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
finding.affected_objects:
report_lines.append( )
obj finding.affected_objects[: ]:
report_lines.append( )
(finding.affected_objects) > :
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
finding.compliance_mappings:
report_lines.append( )
standard, requirement finding.compliance_mappings.items():
report_lines.append( )
report_lines.append( )
report_lines.append( )
report_lines.append( )
.join(report_lines)
( ) -> :
script_lines = [
,
,
,
,
,
,
,
]
critical_findings = [f f .findings f.severity == Severity.CRITICAL]
high_findings = [f f .findings f.severity == Severity.HIGH]
critical_findings:
script_lines.append( )
script_lines.append( )
finding critical_findings:
script_lines.append( )
script_lines.append( )
script_lines.append( )
high_findings:
script_lines.append( )
script_lines.append( )
finding high_findings:
script_lines.append( )
script_lines.append( )
script_lines.append( )
script_lines.append( )
script_lines.append( )
script_lines.append( )
.join(script_lines)
__name__ == :
argparse
parser = argparse.ArgumentParser(description= )
parser.add_argument( , required= , = )
parser.add_argument( , default= , = )
args = parser.parse_args()
scanner = PostgreSQLSecurityScanner(conn_string=args.conn)
findings = scanner.scan_all()
os
os.makedirs(args.output_dir, exist_ok= )
( , ) f:
f.write(scanner.generate_report())
( , ) f:
f.write(scanner.generate_remediation_script())
( , ) f:
findings_json = [
{
: f.check_id,
: f.title,
: f.severity.value,
: f.description,
: f.affected_objects,
: f.remediation,
: f.owasp_category,
: f.compliance_mappings
}
f findings
]
json.dump(findings_json, f, indent= )
( )
( )
Error Handling
Error Cause Solution "Permission denied for pg_authid" Insufficient scanner privileges Grant pg_read_all_settings and pg_read_all_stats roles "Could not connect to database" Connection blocked by firewall Add scanner IP to pg_hba.conf or connect from allowed host "Function does not exist: pg_reload_conf" Using older PostgreSQL version Use SELECT pg_ctl reload instead (requires OS access) "SSL connection required" Database enforces SSL but scanner doesn't use it Add ?sslmode=require to connection string "Too many findings to process" Very insecure database Prioritize critical/high findings first, fix iteratively
Configuration Options
Scan Scope
Full scan : All 50+ security checks (recommended for compliance)
Quick scan : Critical and high severity only (fast assessment)
Compliance scan : Specific to SOC2/HIPAA/PCI DSS requirements
Custom scan : User-defined check selection
Severity Thresholds
Critical : Immediate exploitation risk (exposed passwords, SQL injection)
High : Significant security impact (excessive permissions, no encryption)
Medium : Security weakness (insecure config, missing hardening)
Low : Best practice violation (minor misconfigurations)
Info : Security recommendations (optional improvements)
Remediation Modes
Manual review : Human approval required for all fixes
Semi-automated : Auto-fix low/medium, manual for critical/high
Automated : Apply all fixes automatically (staging only)
Best Practices
DO:
Run security scans weekly or after configuration changes
Test remediation scripts in staging before production
Document exceptions for findings that cannot be fixed
Integrate scanner into CI/CD pipeline (fail on critical findings)
Track findings over time to measure security posture improvement
Grant scanner minimum required privileges (read-only preferred)
Review and update security baseline quarterly
DON'T:
Auto-apply remediation without testing (risk of breaking changes)
Ignore findings because "it's always been that way"
Run scans during peak load (may impact performance)
Share security reports without redacting sensitive data
Skip validation after applying fixes (verify effectiveness)
Disable security features for convenience
Use default database credentials in any environment
Performance Considerations
Scan duration : 30-120 seconds for typical databases
Resource overhead : <1% CPU during scan
Query load : Read-only queries, minimal impact on production
Large databases : May take 5-10 minutes for 1000+ tables
Concurrent scans : Can run in parallel on different databases
Report generation : <1 second for typical findings count
Security Considerations
Store scan results securely (contains security-sensitive information)
Encrypt security reports in transit and at rest
Restrict access to remediation scripts (contain privileged commands)
Audit all security scan executions for compliance
Rotate scanner credentials quarterly
Use dedicated scanner account with minimal privileges
Alert security team on critical findings immediately
Related Commands
/database-audit-logger - Implement audit logging found by scanner
/database-health-monitor - Monitor security metrics over time
/database-backup-automator - Backup before applying security fixes
/database-connection-pooler - Secure connection management
Version History
v1.0.0 (2024-10): Initial implementation with OWASP compliance checks
Planned v1.1.0: Add MySQL/MariaDB support, CIS Benchmark compliance
__init__
self, conn_string: str
"""
Initialize security scanner.
Args:
conn_string: Database connection string with admin privileges
"""
self
self
List
def
scan_all
self
List
"""
Run all security checks.
Returns:
List of security findings
"""
"Starting comprehensive security scan..."
with
self
as
self
self
self
self
self
self
self
self
self
self
self
self
self
self
self
self
f"Security scan complete: {len (self.findings)} findings"
return
self
def
_check_weak_passwords
self, conn
None
"""Check for weak or default passwords."""
with
as
"""
SELECT rolname
FROM pg_authid
WHERE rolcanlogin = true
AND rolpassword IS NULL
AND rolname NOT LIKE 'pg_%'
"""
'rolname'
for
in
if
self
"AUTH-001"
"Roles with No Password"
f"Found {len (weak_roles)} login roles without passwords"
f"Set strong passwords: ALTER ROLE username WITH PASSWORD 'strong_password';"
"A01:2021 - Broken Access Control"
"PCI DSS"
"8.2.3 - Strong passwords"
"HIPAA"
"164.308(a)(5)(ii)(D) - Password management"
"SOC2"
"CC6.1 - Logical and physical access controls"
def
_check_excessive_permissions
self, conn
None
"""Check for over-privileged roles."""
with
as
"""
SELECT grantee, string_agg(privilege_type, ', ') as privileges, table_name
FROM information_schema.table_privileges
WHERE grantee NOT IN ('postgres', 'pg_database_owner')
AND privilege_type IN ('DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER')
AND table_schema NOT IN ('pg_catalog', 'information_schema')
GROUP BY grantee, table_name
HAVING COUNT(*) >= 3
"""
if
f"{row['grantee' ]} on {row['table_name' ]} ({row['privileges' ]} )"
for
in
self
"AUTH-002"
"Excessive Table Permissions"
f"Found {len (excessive_grants)} roles with excessive privileges"
"Apply principle of least privilege: REVOKE unnecessary permissions"
"A01:2021 - Broken Access Control"
"PCI DSS"
"7.1.2 - Restrict access to least privilege"
"SOC2"
"CC6.3 - Logical access controls"
def
_check_superuser_roles
self, conn
None
"""Check for unnecessary superuser roles."""
with
as
"""
SELECT rolname
FROM pg_authid
WHERE rolsuper = true
AND rolname NOT IN ('postgres', 'rdsadmin')
"""
'rolname'
for
in
if
len
1
self
"AUTH-003"
"Multiple Superuser Roles"
f"Found {len (superusers)} superuser roles (expected 1-2)"
"Remove superuser privilege: ALTER ROLE username WITH NOSUPERUSER;"
"A01:2021 - Broken Access Control"
"PCI DSS"
"7.2.2 - Privileged user access management"
"SOC2"
"CC6.2 - System access management"
def
_check_public_schema_permissions
self, conn
None
"""Check for dangerous public schema permissions."""
with
as
"""
SELECT has_schema_privilege('public', 'public', 'CREATE') as can_create
"""
'can_create'
if
self
"AUTH-004"
"Public Schema CREATE Permission"
"All users can create objects in public schema"
"public schema"
"REVOKE CREATE ON SCHEMA public FROM PUBLIC;"
"A01:2021 - Broken Access Control"
"SOC2"
"CC6.1 - Logical access controls"
def
_check_ssl_encryption
self, conn
None
"""Check if SSL/TLS is enforced."""
with
as
"SHOW ssl"
'ssl'
'on'
if
not
self
"ENC-001"
"SSL/TLS Not Enabled"
"Database connections are not encrypted"
"postgresql.conf"
"Enable SSL: ALTER SYSTEM SET ssl = 'on'; (requires restart)"
"A02:2021 - Cryptographic Failures"
"PCI DSS"
"4.1 - Encrypt transmission of cardholder data"
"HIPAA"
"164.312(e)(1) - Transmission security"
"SOC2"
"CC6.7 - Encryption in transit"
def
_check_password_encryption
self, conn
None
"""Check password encryption method."""
with
as
"SHOW password_encryption"
'password_encryption'
if
'scram-sha-256'
self
"ENC-002"
"Weak Password Encryption"
f"Password encryption method is {method} (should be scram-sha-256)"
"postgresql.conf"
"ALTER SYSTEM SET password_encryption = 'scram-sha-256';"
"A02:2021 - Cryptographic Failures"
"PCI DSS"
"8.2.1 - Strong cryptography for passwords"
"HIPAA"
"164.312(a)(2)(iv) - Encryption of passwords"
def
_check_audit_logging
self, conn
None
"""Check if audit logging is enabled."""
with
as
"SHOW logging_destination"
'logging_destination'
if
''
self
"LOG-001"
"Audit Logging Disabled"
"Database audit logging is not configured"
"postgresql.conf"
"ALTER SYSTEM SET logging_destination = 'stderr';"
"A09:2021 - Security Logging and Monitoring Failures"
"PCI DSS"
"10.2 - Audit trail for all access"
"HIPAA"
"164.312(b) - Audit controls"
"SOC2"
"CC7.2 - Monitoring of controls"
def
_check_connection_logging
self, conn
None
"""Check if connection attempts are logged."""
with
as
"SHOW log_connections"
'log_connections'
'on'
if
not
self
"LOG-002"
"Connection Logging Disabled"
"Database connection attempts are not logged"
"postgresql.conf"
"ALTER SYSTEM SET log_connections = 'on';"
"A09:2021 - Security Logging Failures"
"PCI DSS"
"10.2.5 - Log all access to audit trails"
"SOC2"
"CC7.2 - System monitoring"
def
_check_listen_addresses
self, conn
None
"""Check if database is listening on all interfaces."""
with
as
"SHOW listen_addresses"
'listen_addresses'
if
in
'*'
'0.0.0.0'
self
"NET-001"
"Database Listening on All Interfaces"
"Database is accessible from all network interfaces"
"postgresql.conf"
"ALTER SYSTEM SET listen_addresses = 'localhost,10.0.0.0/8';"
"A05:2021 - Security Misconfiguration"
"PCI DSS"
"1.3.4 - Restrict inbound/outbound traffic"
"SOC2"
"CC6.6 - Logical access security"
def
_check_dynamic_sql
self, conn
None
"""Check for potential SQL injection in stored procedures."""
with
as
"""
SELECT proname, prosrc
FROM pg_proc
WHERE prosrc ILIKE '%EXECUTE%||%'
OR prosrc ILIKE '%EXECUTE%CONCAT%'
LIMIT 10
"""
'proname'
for
in
if
self
"INJ-001"
"Potential SQL Injection in Functions"
f"Found {len (vulnerable_funcs)} functions with potential SQL injection"
"Use parameterized queries: EXECUTE format('...', $1, $2);"
"A03:2021 - Injection"
"PCI DSS"
"6.5.1 - Injection flaws"
"OWASP Top 10"
"A03:2021 - Injection"
def
_check_insecure_settings
self, conn
None
"""Check for insecure configuration settings."""
with
as
"SHOW data_checksums"
if
and
'data_checksums'
'off'
self
"CFG-001"
"Data Checksums Disabled"
"Data corruption detection is disabled"
"postgresql.conf"
"Enable during initdb: initdb --data-checksums (requires recreation)"
"A08:2021 - Software and Data Integrity Failures"
"SOC2"
"CC7.1 - System monitoring"
def
generate_report
self
str
"""
Generate human-readable security report.
Returns:
Markdown-formatted security report
"""
"# Database Security Scan Report"
""
f"**Scan Date:** {datetime.now().isoformat()} "
f"**Total Findings:** {len (self.findings)} "
""
0
for
in
for
in
self
1
"## Severity Summary"
""
f"- 🔴 **Critical**: {severity_counts[Severity.CRITICAL]} "
f"- 🟠 **High**: {severity_counts[Severity.HIGH]} "
f"- 🟡 **Medium**: {severity_counts[Severity.MEDIUM]} "
f"- 🟢 **Low**: {severity_counts[Severity.LOW]} "
f"- ℹ️ **Info**: {severity_counts[Severity.INFO]} "
""
"## Detailed Findings"
""
for
in
enumerate
sorted
self
lambda
1
"🔴"
"🟠"
"🟡"
"🟢"
"ℹ️"
f"### {i} . {severity_emoji[finding.severity]} {finding.title} "
""
f"**Check ID:** {finding.check_id} "
f"**Severity:** {finding.severity.value.upper()} "
f"**OWASP Category:** {finding.owasp_category} "
""
f"**Description:** {finding.description} "
""
if
"**Affected Objects:**"
for
in
10
f"- `{obj} `"
if
len
10
f"- ... and {len (finding.affected_objects) - 10 } more"
""
f"**Remediation:** {finding.remediation} "
""
if
"**Compliance Mappings:**"
for
in
f"- {standard} : {requirement} "
""
"---"
""
return
"\n"
def
generate_remediation_script
self
str
"""
Generate SQL remediation script.
Returns:
SQL script to fix vulnerabilities
"""
"-- Database Security Remediation Script"
f"-- Generated: {datetime.now().isoformat()} "
f"-- Total Findings: {len (self.findings)} "
""
"-- WARNING: Review and test in staging before applying to production"
""
"BEGIN;"
""
for
in
self
if
for
in
self
if
if
"-- === CRITICAL SEVERITY FIXES ==="
""
for
in
f"-- {finding.check_id} : {finding.title} "
f"-- {finding.remediation} "
""
if
"-- === HIGH SEVERITY FIXES ==="
""
for
in
f"-- {finding.check_id} : {finding.title} "
f"-- {finding.remediation} "
""
"COMMIT;"
""
"-- Remember to reload configuration: SELECT pg_reload_conf();"
return
"\n"
if
"__main__"
import
"PostgreSQL Security Scanner"
"--conn"
True
help
"Connection string"
"--output-dir"
"./security_scan"
help
"Output directory"
import
True
with
open
f"{args.output_dir} /security_report.md"
"w"
as
with
open
f"{args.output_dir} /remediation.sql"
"w"
as
with
open
f"{args.output_dir} /vulnerabilities.json"
"w"
as
'check_id'
'title'
'severity'
'description'
'affected_objects'
'remediation'
'owasp_category'
'compliance_mappings'
for
in
2
print
f"Security scan complete: {len (findings)} findings"
print
f"Reports generated in: {args.output_dir} /"