File size: 730 Bytes
26e1c2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Technique entity — ER Diagram §3.2.6
Attributes: Technique_ID, technique_name, tactic
"""

from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column, relationship

from app.db.base import Base


class Technique(Base):
    __tablename__ = "techniques"

    technique_id: Mapped[str] = mapped_column(String(20), primary_key=True)
    technique_name: Mapped[str] = mapped_column(String(255), nullable=False)
    tactic: Mapped[str | None] = mapped_column(String(100), nullable=True)

    rule_mappings: Mapped[list["RuleTechniqueMapping"]] = relationship(
        back_populates="technique"
    )
    query_templates: Mapped[list["QueryTemplate"]] = relationship(
        back_populates="technique"
    )