-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_database.sql
More file actions
26 lines (24 loc) · 841 Bytes
/
setup_database.sql
File metadata and controls
26 lines (24 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- Create database
CREATE DATABASE vulnerability_scanner;
USE vulnerability_scanner;
-- Create scans table
CREATE TABLE scans (
scan_id INT AUTO_INCREMENT PRIMARY KEY,
target_url VARCHAR(255) NOT NULL,
scan_status ENUM('pending', 'in_progress', 'completed', 'failed') DEFAULT 'pending',
start_time TIMESTAMP NULL,
end_time TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Create vulnerabilities table
CREATE TABLE vulnerabilities (
vuln_id INT AUTO_INCREMENT PRIMARY KEY,
scan_id INT,
vulnerability_type VARCHAR(100) NOT NULL,
severity ENUM('low', 'medium', 'high', 'critical') NOT NULL,
affected_url VARCHAR(255) NOT NULL,
description TEXT,
remediation TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (scan_id) REFERENCES scans(scan_id)
);