mirror of
https://github.com/mblanke/ThreatHunt.git
synced 2026-03-01 14:00:20 -05:00
21 lines
762 B
Python
21 lines
762 B
Python
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Text, JSON
|
|
from sqlalchemy.orm import relationship
|
|
from datetime import datetime, timezone
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class Artifact(Base):
|
|
__tablename__ = "artifacts"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
artifact_type = Column(String, nullable=False) # hash, ip, domain, email, etc.
|
|
value = Column(String, nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
case_id = Column(Integer, ForeignKey("cases.id"), nullable=True)
|
|
artifact_metadata = Column(JSON, nullable=True)
|
|
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
|
|
|
# Relationships
|
|
case = relationship("Case", back_populates="artifacts")
|