models

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ATTACKSearchRequest

type ATTACKSearchRequest struct {
	TechniqueID *string `json:"technique_id,omitempty"`
	Tactic      *string `json:"tactic,omitempty"`
	Platform    *string `json:"platform,omitempty"`
	Query       *string `json:"query,omitempty"`
	Limit       int     `json:"limit,omitempty"`
	Offset      int     `json:"offset,omitempty"`
}

ATTACKSearchRequest represents a request to search ATT&CK data

type ATTACKTactic

type ATTACKTactic struct {
	ID              string    `json:"id" db:"id"`
	Name            string    `json:"name" db:"name"`
	Description     string    `json:"description" db:"description"`
	ExternalID      *string   `json:"external_id" db:"external_id"`
	KillChainPhases []string  `json:"kill_chain_phases" db:"kill_chain_phases"`
	CreatedAt       time.Time `json:"created_at" db:"created_at"`
	UpdatedAt       time.Time `json:"updated_at" db:"updated_at"`
}

ATTACKTactic represents a MITRE ATT&CK tactic

type ATTACKTechnique

type ATTACKTechnique struct {
	ID              string    `json:"id" db:"id"`
	Name            string    `json:"name" db:"name"`
	Description     string    `json:"description" db:"description"`
	Tactic          string    `json:"tactic" db:"tactic"`
	Tactics         []string  `json:"tactics" db:"tactics"`
	Platforms       []string  `json:"platforms" db:"platforms"`
	KillChainPhases []string  `json:"kill_chain_phases" db:"kill_chain_phases"`
	DataSources     []string  `json:"data_sources" db:"data_sources"`
	Detection       *string   `json:"detection" db:"detection"`
	Mitigation      *string   `json:"mitigation" db:"mitigation"`
	References      []string  `json:"references" db:"refs"`
	SubTechniques   []string  `json:"sub_techniques" db:"sub_techniques"`
	ParentTechnique *string   `json:"parent_technique" db:"parent_technique"`
	RawData         string    `json:"raw_data" db:"raw_data"`
	CreatedAt       time.Time `json:"created_at" db:"created_at"`
	UpdatedAt       time.Time `json:"updated_at" db:"updated_at"`
}

ATTACKTechnique represents a MITRE ATT&CK technique

func (*ATTACKTechnique) MarshalJSON

func (a *ATTACKTechnique) MarshalJSON() ([]byte, error)

func (*ATTACKTechnique) UnmarshalJSON

func (a *ATTACKTechnique) UnmarshalJSON(data []byte) error

type AnalyzeRiskCorrelationRequest

type AnalyzeRiskCorrelationRequest struct {
	SessionID string `json:"session_id"`
}

type AnalyzeRiskCorrelationResponse

type AnalyzeRiskCorrelationResponse struct {
	Correlations []*RiskCorrelation `json:"correlations"`
	Error        string             `json:"error,omitempty"`
}

type CVEMapping

type CVEMapping struct {
	ID          string    `json:"id" db:"id"`
	SessionID   string    `json:"session_id" db:"session_id"`
	CWEID       string    `json:"cwe_id" db:"cwe_id"`
	CVEList     []string  `json:"cve_list" db:"cve_list"`
	LastUpdated time.Time `json:"last_updated" db:"last_updated"`
	Confidence  float64   `json:"confidence" db:"confidence"`
	Source      string    `json:"source" db:"source"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
}

CVEMapping represents a mapping between CWE and CVE entries

type ComplianceMapping

type ComplianceMapping struct {
	ID               string    `json:"id" db:"id"`
	SessionID        string    `json:"session_id" db:"session_id"`
	Standard         string    `json:"standard" db:"standard"`
	Requirement      string    `json:"requirement" db:"requirement"`
	VulnerabilityIDs []string  `json:"vulnerability_ids" db:"vulnerability_ids"`
	ComplianceScore  float64   `json:"compliance_score" db:"compliance_score"`
	GapAnalysis      []string  `json:"gap_analysis" db:"gap_analysis"`
	Recommendations  []string  `json:"recommendations" db:"recommendations"`
	CreatedAt        time.Time `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time `json:"updated_at" db:"updated_at"`
}

ComplianceMapping represents mapping to security compliance standards

type ContextSnapshot

type ContextSnapshot struct {
	ID            string                 `json:"id" db:"id"`
	SessionID     string                 `json:"session_id" db:"session_id"`
	Name          string                 `json:"name" db:"name"`
	Description   string                 `json:"description" db:"description"`
	ContextData   map[string]interface{} `json:"context_data" db:"context_data"`
	MemorySummary string                 `json:"memory_summary" db:"memory_summary"`
	CreatedAt     time.Time              `json:"created_at" db:"created_at"`
}

ContextSnapshot represents a saved state of the LLM's context

func (*ContextSnapshot) MarshalJSON

func (c *ContextSnapshot) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaling for ContextSnapshot.ContextData

func (*ContextSnapshot) UnmarshalJSON

func (c *ContextSnapshot) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaling for ContextSnapshot.ContextData

type CreateMemoryEntryRequest

type CreateMemoryEntryRequest struct {
	SessionID   string   `json:"session_id"`
	Title       string   `json:"title"`
	Content     string   `json:"content"`
	ContentType string   `json:"content_type,omitempty"`
	Category    string   `json:"category"`
	Priority    int      `json:"priority,omitempty"`
	Confidence  float64  `json:"confidence,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Source      string   `json:"source,omitempty"`
}

CreateMemoryEntryRequest represents a request to create a new memory entry

type CreateRelationshipRequest

type CreateRelationshipRequest struct {
	SourceEntryID    string  `json:"source_entry_id"`
	TargetEntryID    string  `json:"target_entry_id"`
	RelationshipType string  `json:"relationship_type"`
	Strength         float64 `json:"strength,omitempty"`
	Description      string  `json:"description,omitempty"`
}

CreateRelationshipRequest represents a request to create a relationship

type DatabaseStats

type DatabaseStats struct {
	TableCounts        map[string]int           `json:"table_counts"`
	DatabaseSizeBytes  int64                    `json:"database_size_bytes"`
	TopAccessedEntries []map[string]interface{} `json:"top_accessed_entries"`
	RecentActivity     []map[string]interface{} `json:"recent_activity"`
}

DatabaseStats represents database statistics

type MapToCVERequest

type MapToCVERequest struct {
	SessionID string `json:"session_id"`
	CWEID     string `json:"cwe_id"`
}

Request/Response types for new features

type MapToCVEResponse

type MapToCVEResponse struct {
	CVEMapping *CVEMapping `json:"cve_mapping"`
	Error      string      `json:"error,omitempty"`
}

type MapToComplianceRequest

type MapToComplianceRequest struct {
	SessionID string `json:"session_id"`
	Standard  string `json:"standard"`
}

type MapToComplianceResponse

type MapToComplianceResponse struct {
	ComplianceMapping *ComplianceMapping `json:"compliance_mapping"`
	Error             string             `json:"error,omitempty"`
}

type MemoryEntry

type MemoryEntry struct {
	ID          string    `json:"id" db:"id"`
	SessionID   string    `json:"session_id" db:"session_id"`
	Title       string    `json:"title" db:"title"`
	Content     string    `json:"content" db:"content"`
	ContentType string    `json:"content_type" db:"content_type"`
	Category    string    `json:"category" db:"category"`
	Priority    int       `json:"priority" db:"priority"`
	Confidence  float64   `json:"confidence" db:"confidence"`
	Tags        []string  `json:"tags" db:"tags"`
	Source      string    `json:"source" db:"source"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	AccessedAt  time.Time `json:"accessed_at" db:"accessed_at"`
	AccessCount int       `json:"access_count" db:"access_count"`
}

MemoryEntry represents a piece of information stored in the memory system

func (*MemoryEntry) MarshalJSON

func (m *MemoryEntry) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaling for MemoryEntry.Tags

func (*MemoryEntry) UnmarshalJSON

func (m *MemoryEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaling for MemoryEntry.Tags

type MemorySummary

type MemorySummary struct {
	SessionID        string         `json:"session_id"`
	RelevantMemories []MemoryEntry  `json:"relevant_memories"`
	RelatedTasks     []TaskProgress `json:"related_tasks"`
	KeyFindings      []MemoryEntry  `json:"key_findings"`
	Summary          string         `json:"summary"`
	GeneratedAt      time.Time      `json:"generated_at"`
}

MemorySummary represents a summary of relevant memories for context

type NVDCVE

type NVDCVE struct {
	ID               string     `json:"id" db:"id"`
	Description      string     `json:"description" db:"description"`
	CVSSV2Score      *float64   `json:"cvss_v2_score" db:"cvss_v2_score"`
	CVSSV2Vector     *string    `json:"cvss_v2_vector" db:"cvss_v2_vector"`
	CVSSV3Score      *float64   `json:"cvss_v3_score" db:"cvss_v3_score"`
	CVSSV3Vector     *string    `json:"cvss_v3_vector" db:"cvss_v3_vector"`
	Severity         *string    `json:"severity" db:"severity"`
	PublishedDate    *time.Time `json:"published_date" db:"published_date"`
	LastModifiedDate *time.Time `json:"last_modified_date" db:"last_modified_date"`
	CWEIDs           []string   `json:"cwe_ids" db:"cwe_ids"`
	AffectedProducts []string   `json:"affected_products" db:"affected_products"`
	References       []string   `json:"references" db:"refs"`
	RawData          string     `json:"raw_data" db:"raw_data"`
	CreatedAt        time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time  `json:"updated_at" db:"updated_at"`
}

NVDCVE represents a CVE entry from the National Vulnerability Database

func (*NVDCVE) MarshalJSON

func (n *NVDCVE) MarshalJSON() ([]byte, error)

Custom JSON marshaling for slices to handle database storage

func (*NVDCVE) UnmarshalJSON

func (n *NVDCVE) UnmarshalJSON(data []byte) error

type NVDSearchRequest

type NVDSearchRequest struct {
	CWEID           *string    `json:"cwe_id,omitempty"`
	Component       *string    `json:"component,omitempty"`
	Severity        *string    `json:"severity,omitempty"`
	MinCVSS         *float64   `json:"min_cvss,omitempty"`
	MaxCVSS         *float64   `json:"max_cvss,omitempty"`
	PublishedAfter  *time.Time `json:"published_after,omitempty"`
	PublishedBefore *time.Time `json:"published_before,omitempty"`
	Limit           int        `json:"limit,omitempty"`
	Offset          int        `json:"offset,omitempty"`
}

NVDSearchRequest represents a request to search NVD data

type OWASPProcedure

type OWASPProcedure struct {
	ID          string    `json:"id" db:"id"`
	Category    string    `json:"category" db:"category"`
	Subcategory *string   `json:"subcategory" db:"subcategory"`
	Title       string    `json:"title" db:"title"`
	Description string    `json:"description" db:"description"`
	Objective   *string   `json:"objective" db:"objective"`
	HowToTest   *string   `json:"how_to_test" db:"how_to_test"`
	Tools       []string  `json:"tools" db:"tools"`
	References  []string  `json:"references" db:"refs"`
	Severity    *string   `json:"severity" db:"severity"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
}

OWASPProcedure represents an OWASP testing procedure

func (*OWASPProcedure) MarshalJSON

func (o *OWASPProcedure) MarshalJSON() ([]byte, error)

func (*OWASPProcedure) UnmarshalJSON

func (o *OWASPProcedure) UnmarshalJSON(data []byte) error

type OWASPSearchRequest

type OWASPSearchRequest struct {
	Category          *string `json:"category,omitempty"`
	VulnerabilityType *string `json:"vulnerability_type,omitempty"`
	TestingPhase      *string `json:"testing_phase,omitempty"`
	Severity          *string `json:"severity,omitempty"`
	Query             *string `json:"query,omitempty"`
	Limit             int     `json:"limit,omitempty"`
	Offset            int     `json:"offset,omitempty"`
}

OWASPSearchRequest represents a request to search OWASP data

type Relationship

type Relationship struct {
	ID               string    `json:"id" db:"id"`
	SourceEntryID    string    `json:"source_entry_id" db:"source_entry_id"`
	TargetEntryID    string    `json:"target_entry_id" db:"target_entry_id"`
	RelationshipType string    `json:"relationship_type" db:"relationship_type"`
	Strength         float64   `json:"strength" db:"strength"`
	Description      string    `json:"description" db:"description"`
	CreatedAt        time.Time `json:"created_at" db:"created_at"`
}

Relationship represents a connection between two memory entries

type RiskCorrelation

type RiskCorrelation struct {
	ID               string    `json:"id" db:"id"`
	SessionID        string    `json:"session_id" db:"session_id"`
	PrimaryVulnID    string    `json:"primary_vuln_id" db:"primary_vuln_id"`
	SecondaryVulnIDs []string  `json:"secondary_vuln_ids" db:"secondary_vuln_ids"`
	RiskMultiplier   float64   `json:"risk_multiplier" db:"risk_multiplier"`
	AttackChain      []string  `json:"attack_chain" db:"attack_chain"`
	BusinessImpact   string    `json:"business_impact" db:"business_impact"`
	Confidence       float64   `json:"confidence" db:"confidence"`
	CreatedAt        time.Time `json:"created_at" db:"created_at"`
	UpdatedAt        time.Time `json:"updated_at" db:"updated_at"`
}

RiskCorrelation represents correlation analysis between vulnerabilities

type SearchHistory

type SearchHistory struct {
	ID           string    `json:"id" db:"id"`
	SessionID    string    `json:"session_id" db:"session_id"`
	Query        string    `json:"query" db:"query"`
	SearchType   string    `json:"search_type" db:"search_type"`
	ResultsCount int       `json:"results_count" db:"results_count"`
	CreatedAt    time.Time `json:"created_at" db:"created_at"`
}

SearchHistory represents a record of search queries

type SearchRequest

type SearchRequest struct {
	Query         string   `json:"query"`
	SessionID     string   `json:"session_id,omitempty"`
	Categories    []string `json:"categories,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	MinPriority   int      `json:"min_priority,omitempty"`
	MinConfidence float64  `json:"min_confidence,omitempty"`
	Limit         int      `json:"limit,omitempty"`
	Offset        int      `json:"offset,omitempty"`
	SearchType    string   `json:"search_type,omitempty"` // semantic, exact, fuzzy, tag, category, relationship
}

SearchRequest represents a search query with filters

type SearchResult

type SearchResult struct {
	MemoryEntry MemoryEntry `json:"memory_entry"`
	Relevance   float64     `json:"relevance"`
	Highlights  []string    `json:"highlights,omitempty"`
}

SearchResult represents a search result with relevance score

type SecurityDataSummary

type SecurityDataSummary struct {
	DataSource    string         `json:"data_source"`
	TotalRecords  int            `json:"total_records"`
	LastUpdate    *time.Time     `json:"last_update"`
	TopCategories map[string]int `json:"top_categories,omitempty"`
	RecentEntries []interface{}  `json:"recent_entries,omitempty"`
	Summary       string         `json:"summary"`
}

SecurityDataSummary represents a summary of security data for context

type SecurityDataUpdate

type SecurityDataUpdate struct {
	ID           string     `json:"id" db:"id"`
	DataSource   string     `json:"data_source" db:"data_source"`
	LastUpdate   *time.Time `json:"last_update" db:"last_update"`
	TotalRecords *int       `json:"total_records" db:"total_records"`
	UpdateStatus string     `json:"update_status" db:"update_status"`
	ErrorMessage *string    `json:"error_message" db:"error_message"`
	CreatedAt    time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at" db:"updated_at"`
}

SecurityDataUpdate represents the status of security data updates

type SecurityQueryRequest

type SecurityQueryRequest struct {
	Query      string                 `json:"query"`
	DataSource string                 `json:"data_source"` // "nvd", "attack", "owasp"
	Filters    map[string]interface{} `json:"filters,omitempty"`
	Limit      int                    `json:"limit,omitempty"`
	Offset     int                    `json:"offset,omitempty"`
	SortBy     string                 `json:"sort_by,omitempty"`
	SortOrder  string                 `json:"sort_order,omitempty"` // "asc", "desc"
}

SecurityQueryRequest represents a request to query security data

type SecurityQueryResponse

type SecurityQueryResponse struct {
	Results    []interface{}          `json:"results"`
	TotalCount int                    `json:"total_count"`
	DataSource string                 `json:"data_source"`
	Query      string                 `json:"query"`
	Filters    map[string]interface{} `json:"filters,omitempty"`
	Limit      int                    `json:"limit"`
	Offset     int                    `json:"offset"`
	HasMore    bool                   `json:"has_more"`
}

SecurityQueryResponse represents the response from a security data query

type Session

type Session struct {
	ID          string                 `json:"id" db:"id"`
	Name        string                 `json:"name" db:"name"`
	Description string                 `json:"description" db:"description"`
	TaskType    string                 `json:"task_type" db:"task_type"`
	Status      string                 `json:"status" db:"status"`
	CreatedAt   time.Time              `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time              `json:"updated_at" db:"updated_at"`
	Metadata    map[string]interface{} `json:"metadata" db:"metadata"`
}

Session represents a security-focused LLM interaction session

func (*Session) MarshalJSON

func (s *Session) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaling for Session.Metadata

func (*Session) UnmarshalJSON

func (s *Session) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaling for Session.Metadata

type TaskProgress

type TaskProgress struct {
	ID                 string     `json:"id" db:"id"`
	SessionID          string     `json:"session_id" db:"session_id"`
	TaskName           string     `json:"task_name" db:"task_name"`
	Stage              string     `json:"stage" db:"stage"`
	Status             string     `json:"status" db:"status"`
	ProgressPercentage int        `json:"progress_percentage" db:"progress_percentage"`
	Notes              string     `json:"notes" db:"notes"`
	StartedAt          *time.Time `json:"started_at" db:"started_at"`
	CompletedAt        *time.Time `json:"completed_at" db:"completed_at"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time  `json:"updated_at" db:"updated_at"`
}

TaskProgress represents progress on a multi-stage task

type UpdateMemoryEntryRequest

type UpdateMemoryEntryRequest struct {
	ID          string   `json:"id"`
	Title       string   `json:"title,omitempty"`
	Content     string   `json:"content,omitempty"`
	ContentType string   `json:"content_type,omitempty"`
	Category    string   `json:"category,omitempty"`
	Priority    *int     `json:"priority,omitempty"`
	Confidence  *float64 `json:"confidence,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Source      string   `json:"source,omitempty"`
}

UpdateMemoryEntryRequest represents a request to update a memory entry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL