26 lines
726 B
Python
26 lines
726 B
Python
"""
|
|
Historique détaillé des scans (logs par IP)
|
|
"""
|
|
from sqlalchemy import Column, Integer, String, DateTime, Index
|
|
from datetime import datetime
|
|
from backend.app.core.database import Base
|
|
|
|
|
|
class ScanLog(Base):
|
|
"""
|
|
Table de logs des scans réseau
|
|
"""
|
|
__tablename__ = "scan_log"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
ip = Column(String, index=True, nullable=True)
|
|
status = Column(String, nullable=True)
|
|
message = Column(String, nullable=False)
|
|
created_at = Column(DateTime, default=datetime.now, index=True, nullable=False)
|
|
|
|
def __repr__(self):
|
|
return f"<ScanLog {self.id} {self.ip} {self.status}>"
|
|
|
|
|
|
Index('idx_scan_log_created_at', ScanLog.created_at)
|