models

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	ID     uint `json:"id" gorm:"primarykey"`
	FileID uint `json:"file_id" gorm:"index:idx_cred"`

	Rule string    `json:"rule"`
	Time time.Time `json:"time"`

	UserDomain string `json:"user_domain"`
	Username   string `json:"username"`
	Password   string `json:"password"`

	CPF string `json:"cpf"`

	Url       string `json:"url"`
	UrlDomain string `json:"url_domain"`

	Severity int     `json:"severity"`
	Entropy  float32 `json:"entropy"`

	NearText string `json:"near_text"`
}

func (Credential) CalcHash added in v0.1.21

func (cred Credential) CalcHash(additional_data string) string

func (Credential) MarshalJSON

func (cred Credential) MarshalJSON() ([]byte, error)

Custom Marshaller for Credential

type Email

type Email struct {
	ID     uint `json:"id" gorm:"primarykey"`
	FileID uint `json:"file_id" gorm:"index:idx_email"`

	Time time.Time `json:"time"`

	Domain string `json:"domain"`
	Email  string `json:"email"`

	NearText string `json:"near_text"`
}

func (Email) CalcHash added in v0.1.21

func (eml Email) CalcHash(additional_data string) string

func (Email) MarshalJSON

func (eml Email) MarshalJSON() ([]byte, error)

Custom Marshaller for URL

type File

type File struct {
	ID uint `json:"id" gorm:"primarykey"`

	Provider  string    `json:"provider"` //IntelX, ...
	FilePath  string    `json:"file_path"`
	FileName  string    `json:"file_name"`
	Name      string    `json:"name"`
	Date      time.Time `json:"date"`
	Bucket    string    `json:"bucket"`
	MediaType string    `json:"media_type"`
	IndexedAt time.Time `json:"indexed_at"`

	Size        uint   `json:"size"`
	ProviderId  string `json:"provider_id"`
	MIMEType    string `json:"mime_type"`
	Fingerprint string `json:"fingerprint";gorm:"unique;not null"`

	Content string `json:"content"`

	// Failed flag set if the result should be considered failed
	Failed       bool   `json:"failed"`
	FailedReason string `json:"failed_reason"`

	Credentials []Credential `json:"credentials" gorm:"constraint:OnDelete:CASCADE"`
	Emails      []Email      `json:"emails" gorm:"constraint:OnDelete:CASCADE"`
	URLs        []URL        `json:"urls" gorm:"constraint:OnDelete:CASCADE"`
}

Name,Date,Bucket,Media,Content Type,Size,System ID

func (File) Clone added in v0.1.1

func (file File) Clone() *File

func (File) MarshalJSON

func (file File) MarshalJSON() ([]byte, error)

Custom Marshaller for File

type Finding

type Finding struct {
	// Rule is the name of the rule that was matched
	RuleID      string
	Description string

	StartLine   int
	EndLine     int
	StartColumn int
	EndColumn   int

	Line string `json:"-"`

	Match string

	// Secret contains the full content of what is matched in
	// the tree-sitter query.
	Secret string

	// File is the name of the file containing the finding
	File        string
	SymlinkFile string
	Commit      string
	Link        string `json:",omitempty"`

	// Entropy is the shannon entropy of Value
	Entropy float32

	Author  string
	Date    string
	Message string
	Tags    []string

	// unique identifier
	Fingerprint string

	Credential Credential
	Email      Email
	Url        URL
}

Finding contains information about strings that have been captured by a tree-sitter query.

type URL

type URL struct {
	ID     uint `json:"id" gorm:"primarykey"`
	FileID uint `json:"file_id" gorm:"index:idx_url"`

	Time time.Time `json:"time"`

	Domain string `json:"domain"`
	Url    string `json:"url"`

	NearText string `json:"near_text"`
}

func (URL) CalcHash added in v0.1.21

func (u URL) CalcHash(additional_data string) string

func (URL) MarshalJSON

func (u URL) MarshalJSON() ([]byte, error)

Custom Marshaller for URL

Jump to

Keyboard shortcuts

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