model

package
v0.0.0-...-b6dede2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 34 Imported by: 7

Documentation

Index

Constants

View Source
const (
	PostureProviderAWS        = "aws"
	PostureProviderAWSOrg     = "aws_org"
	PostureProviderGCP        = "gcp"
	PostureProviderGCPOrg     = "gcp_org"
	PostureProviderAzure      = "azure"
	PostureProviderAzureOrg   = "azure_org"
	PostureProviderLinux      = "linux"
	PostureProviderKubernetes = "kubernetes"
)
View Source
const (
	GenerativeAiIntegrationExitMessage = "[DEEPFENCE_DONE]"

	CloudPostureQuery      = "cloud_posture"
	LinuxPostureQuery      = "linux_posture"
	KubernetesPostureQuery = "kubernetes_posture"
	VulnerabilityQuery     = "vulnerability"
	SecretQuery            = "secret"
	MalwareQuery           = "malware"

	QueryTypeRemediation = "remediation"
)
View Source
const (
	DateLayout1 = "2006-01-02 15:04:05.999999-07:00"
	DateLayout2 = "2006-01-02 15:04:05 UTC"

	DeepfenceSupportEmail = "community-support@deepfence.io"
)
View Source
const (
	LicenseServerURL      = "https://license.deepfence.io/threatmapper"
	GenerateLicenseAPIURL = LicenseServerURL + "/generate-license?first_name=%s&last_name=%s&email=%s&company=%s&resend_email=%t"
	GetLicenseAPIURL      = LicenseServerURL + "/license?license_key=%s"
	ReportLicenseUsageURL = LicenseServerURL + "/report-license"
)
View Source
const (
	VulnerabilityScanCron   = "0 0 0 * * 0"
	SecretScanCron          = "0 0 0 * * 1"
	MalwareScanCron         = "0 0 0 * * 2"
	ComplianceScanCron      = "0 0 0 * * 3"
	CloudComplianceScanCron = "0 0 0 * * 4"
)
View Source
const (
	EmailConfigurationKey = "email_configuration"
	EmailSettingSES       = "amazon_ses"
	EmailSettingSMTP      = "smtp"
	EmailSettingSendGrid  = "sendgrid"
)
View Source
const (
	AdminRole        = "admin"
	StandardUserRole = "standard-user"
	ReadOnlyRole     = "read-only-user"

	GrantTypePassword = "password"
	GrantTypeAPIToken = "api_token"
)
View Source
const (
	DefaultUserGroup = "default"
)

Variables

View Source
var (
	ErrUserNotFound = errors.New("user not found")
	EULAResponse    = MessageResponse{Message: constants.EndUserLicenceAgreement}
)
View Source
var (
	AccessTokenExpiry  = time.Minute * 30
	RefreshTokenExpiry = time.Hour * 26
)
View Source
var (
	AiIntegrationTypeLabel = map[string]string{
		constants.OpenAI:  "OpenAI",
		constants.Bedrock: "Amazon Bedrock",
	}
)

Functions

func AddScheduledTask

func AddScheduledTask(ctx context.Context, req AddScheduledTaskRequest) error

func BenchmarkTypeToArray

func BenchmarkTypeToArray(bt []BenchmarkType) []string

func DeleteCustomSchedule

func DeleteCustomSchedule(ctx context.Context, id int64) error

func DeleteIntegrations

func DeleteIntegrations(ctx context.Context, pgClient *postgresqlDb.Queries, integrationIDs []int32) error

func DeleteRegistry

func DeleteRegistry(ctx context.Context, pgClient *postgresqlDb.Queries, r int32) error

DeleteRegistry from DB

func DeleteRegistryAccount

func DeleteRegistryAccount(ctx context.Context, nodeIDs []string) error

func DigestToID

func DigestToID(digest string) (string, string)

func GetAESValueForEncryption

func GetAESValueForEncryption(ctx context.Context,
	pgClient *postgresqlDb.Queries) (json.RawMessage, error)

func GetAPIToken

func GetAPIToken(namespace string, apiToken uuid.UUID) string

func GetDefaultUserGroup

func GetDefaultUserGroup(ctx context.Context, pgClient *postgresqlDb.Queries, companyID int32) (*postgresqlDb.UserGroup, error)

func GetDefaultUserGroupMap

func GetDefaultUserGroupMap(ctx context.Context, pgClient *postgresqlDb.Queries, companyID int32) (map[string]string, error)

func GetIntegration

func GetIntegration(ctx context.Context, pgClient *postgresqlDb.Queries, integrationID int32) (postgresqlDb.Integration, bool, error)

func GetRegistryPgIDs

func GetRegistryPgIDs(ctx context.Context, nodeIDs []string) ([]int64, error)

func GetScheduledTask

func GetScheduledTask(ctx context.Context) ([]postgresqlDb.Scheduler, error)

func InitializeScheduledTasks

func InitializeScheduledTasks(ctx context.Context, pgClient *postgresqlDb.Queries) error

func IsFreshSetup

func IsFreshSetup(ctx context.Context) (bool, error)

func IsOnboardingRequired

func IsOnboardingRequired(ctx context.Context) bool

func UpdateScheduledTask

func UpdateScheduledTask(ctx context.Context, id int64, updateScheduledTask UpdateScheduledTaskRequest) error

func UpsertChildCloudAccounts

func UpsertChildCloudAccounts(ctx context.Context, nodeDetails []map[string]interface{}, parentNodeID string, installationID string, hostNodeID string, initialRequest bool) error

func UpsertCloudAccount

func UpsertCloudAccount(ctx context.Context, nodeDetails map[string]interface{}, isOrganizationDeployment bool, hostNodeID string, initialRequest bool) error

Types

type APIAuthRequest

type APIAuthRequest struct {
	APIToken string `json:"api_token" validate:"required,api_token" required:"true"`
}

type APIToken

type APIToken struct {
	APIToken         uuid.UUID `json:"api_token" required:"true"`
	ID               int64     `json:"id" required:"true"`
	Name             string    `json:"name" required:"true"`
	CompanyID        int32     `json:"company_id" required:"true"`
	RoleID           int32     `json:"role_id" required:"true"`
	GroupID          int32     `json:"group_id" required:"true"`
	CreatedByUserID  int64     `json:"created_by_user_id" required:"true"`
	CompanyNamespace string    `json:"company_namespace" required:"true"`
}

func (*APIToken) Create

func (a *APIToken) Create(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.ApiToken, error)

func (*APIToken) GetUser

func (a *APIToken) GetUser(ctx context.Context, pgClient *postgresqlDb.Queries) (*User, error)

type APITokenResponse

type APITokenResponse struct {
	ID              int64     `json:"id"`
	APIToken        string    `json:"api_token"`
	Name            string    `json:"name"`
	CompanyID       int32     `json:"company_id"`
	CreatedByUserID int64     `json:"created_by_user_id"`
	CreatedAt       time.Time `json:"created_at"`
}

type AddGenerativeAiBedrockIntegration

type AddGenerativeAiBedrockIntegration struct {
	AWSAccessKey string `json:"aws_access_key" validate:"omitempty,min=16,max=128"`
	AWSSecretKey string `json:"aws_secret_key" validate:"omitempty,min=16,max=128"`
	AWSRegion    string `` /* 670-byte string literal not displayed */
	UseIAMRole   bool   `json:"use_iam_role"`
	ModelID      string `` /* 490-byte string literal not displayed */
}

func (AddGenerativeAiBedrockIntegration) GetFields

func (a AddGenerativeAiBedrockIntegration) GetFields() interface{}

func (AddGenerativeAiBedrockIntegration) GetIntegrationType

func (a AddGenerativeAiBedrockIntegration) GetIntegrationType() string

func (AddGenerativeAiBedrockIntegration) GetLabel

func (AddGenerativeAiBedrockIntegration) IntegrationExists

func (a AddGenerativeAiBedrockIntegration) IntegrationExists(ctx context.Context, pgClient *postgresqlDb.Queries) (bool, error)

type AddGenerativeAiIntegrationRequest

type AddGenerativeAiIntegrationRequest interface {
	GetIntegrationType() string
	GetFields() interface{}
	GetLabel() string
	IntegrationExists(context.Context, *postgresqlDb.Queries) (bool, error)
}

type AddGenerativeAiOpenAIIntegration

type AddGenerativeAiOpenAIIntegration struct {
	APIKey  string `json:"api_key" validate:"required" required:"true"`
	ModelID string `json:"model_id" validate:"required,oneof=gpt-4" required:"true" enum:"gpt-4"`
}

func (AddGenerativeAiOpenAIIntegration) GetFields

func (a AddGenerativeAiOpenAIIntegration) GetFields() interface{}

func (AddGenerativeAiOpenAIIntegration) GetIntegrationType

func (a AddGenerativeAiOpenAIIntegration) GetIntegrationType() string

func (AddGenerativeAiOpenAIIntegration) GetLabel

func (AddGenerativeAiOpenAIIntegration) IntegrationExists

func (a AddGenerativeAiOpenAIIntegration) IntegrationExists(ctx context.Context, pgClient *postgresqlDb.Queries) (bool, error)

type AddScheduledTaskRequest

type AddScheduledTaskRequest struct {
	Action      string `` /* 214-byte string literal not displayed */
	Description string `json:"description"`
	CronExpr    string `json:"cron_expr"`
	ScheduleTaskPayload
}

type AgentID

type AgentID struct {
	NodeID            string `json:"node_id" required:"true"`
	AvailableWorkload int    `json:"available_workload" required:"true"`
	NodeType          string `json:"node_type"`
}

type AgentPluginDisable

type AgentPluginDisable struct {
	PluginName string `json:"plugin_name" required:"true"`
	NodeID     string `json:"node_id" required:"true"`
}

type AgentPluginEnable

type AgentPluginEnable struct {
	PluginName string `json:"plugin_name" required:"true"`
	Version    string `json:"version" required:"true"`
	NodeID     string `json:"node_id" required:"true"`
}

type AgentUpgrade

type AgentUpgrade struct {
	Version string   `json:"version" required:"true"`
	NodeIDs []string `json:"node_ids" required:"true"`
}

type BasicNode

type BasicNode struct {
	NodeID   string `json:"node_id" required:"true"`
	Name     string `json:"name" required:"true"`
	NodeType string `json:"node_type" required:"true"`
	HostName string `json:"host_name" required:"true"`
	Active   bool   `json:"active" required:"true"`
}

type BenchmarkType

type BenchmarkType string

required to generate proper openapi spec

func (BenchmarkType) Enum

func (bt BenchmarkType) Enum() []interface{}

TODO: add new compliance type here

type BinUploadRequest

type BinUploadRequest struct {
	Tarball multipart.File `formData:"tarball" json:"tarball" validate:"required" required:"true"`
}

type BulkDeleteReportReq

type BulkDeleteReportReq struct {
	ReportIDs []string `json:"report_ids" required:"true"`
}

type BulkDeleteScansRequest

type BulkDeleteScansRequest struct {
	ScanType string                  `` /* 177-byte string literal not displayed */
	Filters  reporters.FieldsFilters `json:"filters" required:"true"`
}

type CloudAccountDeleteReq

type CloudAccountDeleteReq struct {
	NodeIDs []string `json:"node_ids" validate:"required,gt=0" required:"true"`
}

type CloudAccountRefreshReq

type CloudAccountRefreshReq struct {
	NodeIDs []string `json:"node_ids" validate:"required,gt=0" required:"true"`
}

func (*CloudAccountRefreshReq) SetCloudAccountRefresh

func (c *CloudAccountRefreshReq) SetCloudAccountRefresh(ctx context.Context) error

type CloudCompliance

type CloudCompliance struct {
	Count               int32       `json:"count,omitempty" required:"true"`
	Reason              string      `json:"reason" required:"true"`
	Resource            string      `json:"resource" required:"true"`
	Status              string      `json:"status" required:"true" enum:"alarm,info,ok,skip,delete"`
	Region              string      `json:"region" required:"true"`
	AccountID           string      `json:"account_id" required:"true"`
	Group               string      `json:"group" required:"true"`
	Service             string      `json:"service" required:"true"`
	Title               string      `json:"title" required:"true"`
	ComplianceCheckType string      `json:"compliance_check_type" required:"true" enum:"hipaa,gdpr,pci,nist,cis,soc_2,nsa-cisa,aws_foundational_security"`
	CloudProvider       string      `json:"cloud_provider" required:"true"`
	NodeName            string      `json:"node_name" required:"true"`
	NodeID              string      `json:"node_id" required:"true"`
	Masked              bool        `json:"masked" required:"true"`
	UpdatedAt           int64       `json:"updated_at" required:"true"`
	Type                string      `json:"type" required:"true"`
	ControlID           string      `json:"control_id" required:"true"`
	Description         string      `json:"description" required:"true"`
	Severity            string      `json:"severity" required:"true"`
	Resources           []BasicNode `json:"resources" required:"false"`
}

func (CloudCompliance) ExtendedField

func (CloudCompliance) ExtendedField() string

func (CloudCompliance) GetCategory

func (v CloudCompliance) GetCategory() string

func (CloudCompliance) GetJSONCategory

func (CloudCompliance) GetJSONCategory() string

func (CloudCompliance) NodeType

func (CloudCompliance) NodeType() string

type CloudComplianceControl

type CloudComplianceControl struct {
	ControlID              string   `json:"control_id"`
	Documentation          string   `json:"documentation"`
	Active                 bool     `json:"active"`
	Description            string   `json:"description"`
	CloudProvider          string   `json:"cloud_provider"`
	Title                  string   `json:"title"`
	Executable             bool     `json:"executable"`
	CategoryHierarchyShort string   `json:"category_hierarchy_short"`
	CategoryHierarchy      []string `json:"category_hierarchy"`
	Service                string   `json:"service"`
	ParentControlHierarchy []string `json:"parent_control_hierarchy"`
	ComplianceType         string   `json:"compliance_type"`
	Disabled               bool     `json:"disabled"`
	Category               string   `json:"category"`
	NodeID                 string   `json:"node_id"`
}

func (CloudComplianceControl) ExtendedField

func (CloudComplianceControl) ExtendedField() string

func (CloudComplianceControl) GetCategory

func (v CloudComplianceControl) GetCategory() string

func (CloudComplianceControl) GetJSONCategory

func (CloudComplianceControl) GetJSONCategory() string

func (CloudComplianceControl) NodeType

func (CloudComplianceControl) NodeType() string

type CloudComplianceScanDetails

type CloudComplianceScanDetails struct {
	ScanID        string                             `json:"scan_id"`
	ScanTypes     []string                           `json:"scan_types"`
	AccountID     string                             `json:"account_id"`
	Benchmarks    []ctl.CloudComplianceScanBenchmark `json:"benchmarks"`
	StopRequested bool                               `json:"stop_requested"`
}

type CloudComplianceScanListResp

type CloudComplianceScanListResp struct {
	ScansInfo []ComplianceScanInfo `json:"scans_info" required:"true"`
}

type CloudComplianceScanResult

type CloudComplianceScanResult struct {
	ScanResultsCommon
	ComplianceAdditionalInfo
	Compliances []CloudCompliance `json:"compliances" required:"true"`
}

type CloudNode

type CloudNode struct {
	ID                          string `json:"node_id" required:"true"`
	Name                        string `json:"node_name" required:"true"`
	CloudProvider               string `json:"cloud_provider" required:"true"`
	CloudCompliancesCount       int64  `json:"cloud_compliances_count" required:"true"`
	CloudComplianceScanStatus   string `json:"cloud_compliance_scan_status" required:"true"`
	CloudComplianceLatestScanID string `json:"cloud_compliance_latest_scan_id" required:"true"`
}

func (CloudNode) ExtendedField

func (CloudNode) ExtendedField() string

func (CloudNode) GetCategory

func (CloudNode) GetCategory() string

func (CloudNode) GetJSONCategory

func (CloudNode) GetJSONCategory() string

func (CloudNode) NodeType

func (CloudNode) NodeType() string

type CloudNodeAccountInfo

type CloudNodeAccountInfo struct {
	NodeID               string           `json:"node_id"`
	NodeName             string           `json:"node_name"`
	AccountName          string           `json:"account_name"`
	CloudProvider        string           `json:"cloud_provider" enum:"aws,gcp,azure,aws_org,gcp_org,azure_org"`
	CompliancePercentage float64          `json:"compliance_percentage"`
	Active               bool             `json:"active"`
	LastScanID           string           `json:"last_scan_id"`
	LastScanStatus       string           `json:"last_scan_status"`
	RefreshMessage       string           `json:"refresh_message"`
	RefreshMetadata      string           `json:"refresh_metadata"`
	RefreshStatus        string           `json:"refresh_status"`
	RefreshStatusMap     map[string]int64 `json:"refresh_status_map"`
	ScanStatusMap        map[string]int64 `json:"scan_status_map"`
	Version              string           `json:"version"`
	HostNodeID           string           `json:"host_node_id"`
}

func (CloudNodeAccountInfo) ExtendedField

func (CloudNodeAccountInfo) ExtendedField() string

func (CloudNodeAccountInfo) GetCategory

func (v CloudNodeAccountInfo) GetCategory() string

func (CloudNodeAccountInfo) GetJSONCategory

func (CloudNodeAccountInfo) GetJSONCategory() string

func (CloudNodeAccountInfo) GetPassStatus

func (v CloudNodeAccountInfo) GetPassStatus() []string

func (CloudNodeAccountInfo) LatestScanIDField

func (v CloudNodeAccountInfo) LatestScanIDField() string

func (CloudNodeAccountInfo) NodeType

func (v CloudNodeAccountInfo) NodeType() string

func (CloudNodeAccountInfo) ScanResultType

func (v CloudNodeAccountInfo) ScanResultType() string

func (CloudNodeAccountInfo) ScanType

type CloudNodeAccountRegisterReq

type CloudNodeAccountRegisterReq struct {
	NodeID                    string                      `json:"node_id" validate:"required" required:"true"`
	AccountName               string                      `json:"account_name"`
	HostNodeID                string                      `json:"host_node_id" validate:"required" required:"true"`
	AccountID                 string                      `json:"account_id" validate:"required" required:"true"`
	CloudProvider             string                      `json:"cloud_provider" validate:"required,oneof=aws gcp azure" enum:"aws,gcp,azure" required:"true"`
	IsOrganizationDeployment  bool                        `json:"is_organization_deployment"`
	MonitoredAccounts         []CloudNodeMonitoredAccount `json:"monitored_accounts"`
	OrganizationAccountID     string                      `json:"organization_account_id"`
	Version                   string                      `json:"version" validate:"required" required:"true"`
	PersistentVolumeSupported bool                        `json:"persistent_volume_supported"`
	InstallationID            string                      `json:"installation_id" validate:"required" required:"true"`
	InitialRequest            bool                        `json:"initial_request"`
}

type CloudNodeAccountsListReq

type CloudNodeAccountsListReq struct {
	CloudProvider string      `json:"cloud_provider" enum:"aws,gcp,azure,linux,kubernetes,aws_org,gcp_org,azure_org" required:"true"`
	Window        FetchWindow `json:"window" required:"true"`
}

type CloudNodeAccountsListResp

type CloudNodeAccountsListResp struct {
	CloudNodeAccountInfo []CloudNodeAccountInfo `json:"cloud_node_accounts_info" required:"true"`
	Total                int                    `json:"total" required:"true"`
}

func GetCloudComplianceNodesList

func GetCloudComplianceNodesList(ctx context.Context, cloudProvider string, fw FetchWindow) (CloudNodeAccountsListResp, error)

type CloudNodeComplianceControl

type CloudNodeComplianceControl struct {
	NodeID                 string   `json:"node_id"`
	Title                  string   `json:"title"`
	Description            string   `json:"description"`
	Service                string   `json:"service"`
	CategoryHierarchy      []string `json:"category_hierarchy"`
	CategoryHierarchyShort string   `json:"category_hierarchy_short"`
	ControlID              string   `json:"control_id"`
	Enabled                bool     `json:"enabled"`
	ComplianceType         string   `json:"compliance_type"`
	ProblemTitle           string   `json:"problem_title"`
}

type CloudNodeControlReq

type CloudNodeControlReq struct {
	NodeID         string `json:"node_id"`
	CloudProvider  string `json:"cloud_provider" required:"true" enum:"aws,gcp,azure,linux,kubernetes"`
	ComplianceType string `json:"compliance_type" enum:"hipaa,gdpr,pci,nist,cis,soc_2,nsa-cisa,aws_foundational_security" required:"true"`
}

type CloudNodeControlResp

type CloudNodeControlResp struct {
	Controls []CloudNodeComplianceControl `json:"controls"`
}

type CloudNodeEnableDisableReq

type CloudNodeEnableDisableReq struct {
	NodeID      string   `json:"node_id"`
	ControlsIDs []string `json:"control_ids"`
}

type CloudNodeMonitoredAccount

type CloudNodeMonitoredAccount struct {
	NodeID      string `json:"node_id" validate:"required" required:"true"`
	AccountName string `json:"account_name"`
	AccountID   string `json:"account_id" validate:"required" required:"true"`
}

type CloudNodeProvidersListReq

type CloudNodeProvidersListReq struct{}

type CloudNodeProvidersListResp

type CloudNodeProvidersListResp struct {
	Providers []PostureProvider `json:"providers" required:"true"`
}

type CloudResource

type CloudResource struct {
	ID                          string `json:"node_id" required:"true"`
	Name                        string `json:"node_name" required:"true"`
	Type                        string `json:"node_type" required:"true"`
	TypeLabel                   string `json:"type_label" required:"true"`
	AccountID                   string `json:"account_id" required:"true"`
	CloudProvider               string `json:"cloud_provider" validate:"required,oneof=aws gcp azure" required:"true" enum:"aws,gcp,azure"`
	CloudRegion                 string `json:"cloud_region" required:"true"`
	CloudCompliancesCount       int64  `json:"cloud_compliances_count" required:"true"`
	CloudWarnAlarmCount         int64  `json:"cloud_warn_alarm_count" required:"true"`
	CloudComplianceScanStatus   string `json:"cloud_compliance_scan_status" required:"true"`
	CloudComplianceLatestScanID string `json:"cloud_compliance_latest_scan_id" required:"true"`
}

func (CloudResource) ExtendedField

func (CloudResource) ExtendedField() string

func (CloudResource) GetCategory

func (CloudResource) GetCategory() string

func (CloudResource) GetJSONCategory

func (CloudResource) GetJSONCategory() string

func (CloudResource) NodeType

func (CloudResource) NodeType() string

type Company

type Company struct {
	ID          int32  `json:"id" required:"true"`
	Name        string `json:"name" required:"true"`
	EmailDomain string `json:"email_domain" required:"true"`
	Namespace   string `json:"namespace" required:"true"`
}

func GetCompany

func GetCompany(ctx context.Context, pgClient *postgresqlDb.Queries, companyID int32) (*Company, error)

func (*Company) Create

func (c *Company) Create(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.Company, error)

func (*Company) CreateDefaultUserGroup

func (c *Company) CreateDefaultUserGroup(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.UserGroup, error)

func (*Company) GetDefaultUserGroup

func (c *Company) GetDefaultUserGroup(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.UserGroup, error)

func (*Company) GetDefaultUserGroupMap

func (c *Company) GetDefaultUserGroupMap(ctx context.Context, pgClient *postgresqlDb.Queries) (map[string]string, error)

type Compliance

type Compliance struct {
	TestCategory        string      `json:"test_category" required:"true"`
	TestNumber          string      `json:"test_number" required:"true"`
	TestInfo            string      `json:"description" required:"true"`
	RemediationScript   string      `json:"remediation_script,omitempty" required:"true"`
	RemediationAnsible  string      `json:"remediation_ansible,omitempty" required:"true"`
	RemediationPuppet   string      `json:"remediation_puppet,omitempty" required:"true"`
	Resource            string      `json:"resource" required:"true"`
	TestRationale       string      `json:"test_rationale" required:"true"`
	TestSeverity        string      `json:"test_severity" required:"true"`
	TestDesc            string      `json:"test_desc" required:"true"`
	Status              string      `json:"status" required:"true" enum:"pass,warn,info,note"`
	ComplianceCheckType string      `json:"compliance_check_type" required:"true" enum:"hipaa,gdpr,pci,nist"`
	ComplianceNodeID    string      `json:"node_id" required:"true"`
	ComplianceNodeType  string      `json:"node_type" required:"true"`
	Masked              bool        `json:"masked" required:"true"`
	UpdatedAt           int64       `json:"updated_at" required:"true"`
	Resources           []BasicNode `json:"resources" required:"false"`
	RuleID              string      `json:"rule_id" required:"true"`
}

func (Compliance) ExtendedField

func (Compliance) ExtendedField() string

func (Compliance) GetCategory

func (v Compliance) GetCategory() string

func (Compliance) GetJSONCategory

func (Compliance) GetJSONCategory() string

func (Compliance) NodeType

func (Compliance) NodeType() string

type ComplianceAdditionalInfo

type ComplianceAdditionalInfo struct {
	BenchmarkTypes       []string         `json:"benchmark_type" required:"true"`
	StatusCounts         map[string]int32 `json:"status_counts" required:"true"`
	CompliancePercentage float64          `json:"compliance_percentage" required:"true"`
}

type ComplianceBenchmarkTypes

type ComplianceBenchmarkTypes struct {
	BenchmarkTypes []BenchmarkType `json:"benchmark_types" required:"true"`
}

type ComplianceRule

type ComplianceRule struct {
	TestCategory  string `json:"test_category" required:"true"`
	TestNumber    string `json:"test_number" required:"true"`
	TestInfo      string `json:"description" required:"true"`
	TestRationale string `json:"test_rationale" required:"true"`
	TestSeverity  string `json:"test_severity" required:"true"`
	TestDesc      string `json:"test_desc" required:"true"`
	Masked        bool   `json:"masked" required:"true"`
	UpdatedAt     int64  `json:"updated_at" required:"true"`
}

func (ComplianceRule) ExtendedField

func (ComplianceRule) ExtendedField() string

func (ComplianceRule) GetCategory

func (v ComplianceRule) GetCategory() string

func (ComplianceRule) GetJSONCategory

func (ComplianceRule) GetJSONCategory() string

func (ComplianceRule) NodeType

func (ComplianceRule) NodeType() string

type ComplianceScanInfo

type ComplianceScanInfo struct {
	ScanInfo
	BenchmarkTypes []string `json:"benchmark_types" required:"true"`
	CloudProvider  string   `json:"cloud_provider" required:"true"`
}

type ComplianceScanResult

type ComplianceScanResult struct {
	ScanResultsCommon
	ComplianceAdditionalInfo
	Compliances []Compliance `json:"compliances" required:"true"`
}

type ComplianceScanResultControlGroup

type ComplianceScanResultControlGroup struct {
	ProblemTitle   string           `json:"problem_title,omitempty"`
	Counts         map[string]int64 `json:"counts,omitempty"`
	BenchmarkTypes []string         `json:"benchmark_types,omitempty"`
}

type ComplianceScanResultsGroupResp

type ComplianceScanResultsGroupResp struct {
	Groups map[string]ComplianceScanResultControlGroup `json:"groups"`
}

type ComplianceScanStatusResp

type ComplianceScanStatusResp struct {
	Statuses []ComplianceScanInfo `json:"statuses" required:"true"`
}

type ComplianceScanTriggerReq

type ComplianceScanTriggerReq struct {
	ScanTriggerCommon
	ComplianceBenchmarkTypes
}

type ComplinaceScanResultsGroupReq

type ComplinaceScanResultsGroupReq struct {
	ScanID       string                  `json:"scan_id" required:"true"`
	FieldsFilter reporters.FieldsFilters `json:"fields_filter" required:"true"`
}

type ConfigIDPathReq

type ConfigIDPathReq struct {
	ConfigID string `path:"config_id" validate:"required" required:"true"`
}

type Connection

type Connection struct {
	NodeName string        `json:"node_name"`
	NodeID   string        `json:"node_id"`
	Count    int64         `json:"count"`
	IPs      []interface{} `json:"ips"`
}

type ConnectionQueryResp

type ConnectionQueryResp struct {
	FromNodeID string        `json:"from_node_id"`
	NodeName   string        `json:"node_name"`
	NodeID     string        `json:"node_id"`
	Count      int64         `json:"count"`
	IPs        []interface{} `json:"ips"`
}

type Container

type Container struct {
	ID                         string                 `json:"node_id" required:"true"`
	NodeName                   string                 `json:"node_name" required:"true"`
	Name                       string                 `json:"docker_container_name" required:"true"`
	Tags                       []string               `json:"tags" required:"true"`
	ContainerImage             ContainerImage         `json:"image" required:"true"`
	Processes                  []Process              `json:"processes" required:"true"`
	DockerLabels               map[string]interface{} `json:"docker_labels" required:"true" nested_json:"true"`
	HostName                   string                 `json:"host_name" required:"true"`
	DockerImageNameWithTag     string                 `json:"docker_image_name_with_tag" required:"true"`
	DockerContainerCommand     string                 `json:"docker_container_command" required:"true"`
	DockerContainerState       string                 `json:"docker_container_state" required:"true"`
	DockerContainerStateHuman  string                 `json:"docker_container_state_human" required:"true"`
	DockerContainerNetworkMode string                 `json:"docker_container_network_mode" required:"true"`
	DockerContainerNetworks    string                 `json:"docker_container_networks" required:"true"`
	DockerContainerIps         []interface{}          `json:"docker_container_ips" required:"true"`
	DockerContainerCreated     string                 `json:"docker_container_created" required:"true"`
	DockerContainerPorts       string                 `json:"docker_container_ports" required:"true"`
	Uptime                     int                    `json:"uptime" required:"true"`
	CPUMax                     float64                `json:"cpu_max" required:"true"`
	CPUUsage                   float64                `json:"cpu_usage" required:"true"`
	MemoryMax                  int64                  `json:"memory_max" required:"true"`
	MemoryUsage                int64                  `json:"memory_usage" required:"true"`
	VulnerabilitiesCount       int64                  `json:"vulnerabilities_count" required:"true"`
	VulnerabilityScanStatus    string                 `json:"vulnerability_scan_status" required:"true"`
	VulnerabilityLatestScanID  string                 `json:"vulnerability_latest_scan_id" required:"true"`
	SecretsCount               int64                  `json:"secrets_count" required:"true"`
	SecretScanStatus           string                 `json:"secret_scan_status" required:"true"`
	SecretLatestScanID         string                 `json:"secret_latest_scan_id" required:"true"`
	MalwaresCount              int64                  `json:"malwares_count" required:"true"`
	MalwareScanStatus          string                 `json:"malware_scan_status" required:"true"`
	MalwareLatestScanID        string                 `json:"malware_latest_scan_id" required:"true"`
	KubernetesClusterName      string                 `json:"kubernetes_cluster_name" required:"true"`
	KubernetesClusterID        string                 `json:"kubernetes_cluster_id" required:"true"`
	KubernetesNamespace        string                 `json:"kubernetes_namespace" required:"true"`
	IsDeepfenceSystem          bool                   `json:"is_deepfence_system" required:"true"`
}

func (Container) ExtendedField

func (Container) ExtendedField() string

func (Container) GetCategory

func (Container) GetCategory() string

func (Container) GetJSONCategory

func (Container) GetJSONCategory() string

func (Container) NodeType

func (Container) NodeType() string

type ContainerImage

type ContainerImage struct {
	ID                        string                 `json:"node_id" required:"true"`
	ImageNodeID               string                 `json:"image_node_id" required:"true"`
	NodeName                  string                 `json:"node_name" required:"true"`
	Tags                      []string               `json:"tags" required:"true"`
	Name                      string                 `json:"docker_image_name" required:"true"`
	Tag                       string                 `json:"docker_image_tag" required:"true"`
	Size                      string                 `json:"docker_image_size" required:"true"`
	DockerImageCreatedAt      string                 `json:"docker_image_created_at" required:"true"`
	DockerImageVirtualSize    string                 `json:"docker_image_virtual_size" required:"true"`
	DockerImageID             string                 `json:"docker_image_id" required:"true"`
	DockerImageTagList        []string               `json:"docker_image_tag_list" required:"true"`
	Metadata                  map[string]interface{} `json:"metadata" nested_json:"true"`
	VulnerabilitiesCount      int64                  `json:"vulnerabilities_count" required:"true"`
	VulnerabilityScanStatus   string                 `json:"vulnerability_scan_status" required:"true"`
	VulnerabilityLatestScanID string                 `json:"vulnerability_latest_scan_id" required:"true"`
	SecretsCount              int64                  `json:"secrets_count" required:"true"`
	SecretScanStatus          string                 `json:"secret_scan_status" required:"true"`
	SecretLatestScanID        string                 `json:"secret_latest_scan_id" required:"true"`
	MalwaresCount             int64                  `json:"malwares_count" required:"true"`
	MalwareScanStatus         string                 `json:"malware_scan_status" required:"true"`
	MalwareLatestScanID       string                 `json:"malware_latest_scan_id" required:"true"`
	Containers                []Container            `json:"containers" required:"true"`
	IsDeepfenceSystem         bool                   `json:"is_deepfence_system" required:"true"`
}

func GetContainerImagesFromRegistryAndNamespace

func GetContainerImagesFromRegistryAndNamespace(ctx context.Context, registryType, namespace string, pgID int32) ([]ContainerImage, error)

func ListImages

func ListImages(ctx context.Context, registryID string, filter, stubFilter reporters.FieldsFilters, fw FetchWindow) ([]ContainerImage, error)

func (ContainerImage) ExtendedField

func (ContainerImage) ExtendedField() string

func (ContainerImage) GetCategory

func (ContainerImage) GetCategory() string

func (ContainerImage) GetJSONCategory

func (ContainerImage) GetJSONCategory() string

func (ContainerImage) NodeType

func (ContainerImage) NodeType() string

type DeleteIntegrationReq

type DeleteIntegrationReq struct {
	IntegrationIDs []int32 `json:"integration_ids" required:"true"`
}

type DeleteRegistryBulkReq

type DeleteRegistryBulkReq struct {
	RegistryIds []string `json:"registry_ids" validate:"required" required:"true"`
}

type DownloadReportResponse

type DownloadReportResponse struct {
	URLLink string `json:"url_link"`
}

type DownloadScanResultsResponse

type DownloadScanResultsResponse struct {
	ScanInfo    ScanResultsCommon `json:"scan_info"`
	ScanResults []interface{}     `json:"scan_results"`
}

type EmailConfigurationAdd

type EmailConfigurationAdd struct {
	EmailProvider   string `json:"email_provider"`
	CreatedByUserID int64  `json:"created_by_user_id"`
	EmailID         string `json:"email_id"`
	SMTP            string `json:"smtp"`
	Port            string `json:"port"`
	Password        string `json:"password"`
	AmazonAccessKey string `json:"amazon_access_key"`
	AmazonSecretKey string `json:"amazon_secret_key"`
	SesRegion       string `json:"ses_region"`
	APIKey          string `json:"apikey"`
}

func (*EmailConfigurationAdd) Create

func (e *EmailConfigurationAdd) Create(ctx context.Context, pgClient *postgresqlDb.Queries) error

type EmailConfigurationResp

type EmailConfigurationResp struct {
	ID              int64  `json:"id"`
	EmailProvider   string `json:"email_provider"`
	CreatedByUserID int64  `json:"created_by_user_id"`
	EmailID         string `json:"email_id"`
	SMTP            string `json:"smtp"`
	Port            string `json:"port"`
	SesRegion       string `json:"ses_region"`
}

type EmailConfigurationSES

type EmailConfigurationSES struct {
	EmailID         string `json:"email_id" validate:"required,email"`
	AmazonAccessKey string `json:"amazon_access_key" validate:"required,min=16,max=128"`
	AmazonSecretKey string `json:"amazon_secret_key" validate:"required,min=16,max=128"`
	SesRegion       string `` /* 345-byte string literal not displayed */
}

type EmailConfigurationSMTP

type EmailConfigurationSMTP struct {
	EmailID  string `json:"email_id" validate:"required,email"`
	SMTP     string `json:"smtp" validate:"required,min=3,max=128"`
	Port     string `json:"port" validate:"required,min=1,max=5,number"`
	Password string `json:"password" validate:"required,min=3,max=128"`
}

type EmailConfigurationSendGrid

type EmailConfigurationSendGrid struct {
	EmailID string `json:"email_id" validate:"required,email"`
	APIKey  string `json:"apikey" validate:"required,min=3,max=128"`
}

type EndpointID

type EndpointID struct {
	Endpoint string `json:"endpoint" required:"true"`
	Type     string `json:"type" required:"true"`
}

type ErrorResponse

type ErrorResponse struct {
	Message     string            `json:"message"`
	ErrorFields map[string]string `json:"error_fields"`
	ErrorIndex  map[string][]int  `json:"error_index"`
}

type ExportReport

type ExportReport struct {
	UpdatedAt     int64  `json:"updated_at"`
	ReportID      string `json:"report_id"`
	CreatedAt     int64  `json:"created_at"`
	Filters       string `json:"filters"`
	Type          string `json:"type"`
	URL           string `json:"url"`
	FileName      string `json:"-"`
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
	StoragePath   string `json:"storage_path"`
	FromTimestamp int64  `json:"from_timestamp"` // timestamp in milliseconds
	ToTimestamp   int64  `json:"to_timestamp"`   // timestamp in milliseconds
}

type FetchWindow

type FetchWindow struct {
	Offset int `json:"offset" required:"true"`
	Size   int `json:"size" required:"true"`
}

func (FetchWindow) FetchWindow2CypherQuery

func (fw FetchWindow) FetchWindow2CypherQuery() string

type FiltersReq

type FiltersReq struct {
	RequiredFilters []string               `json:"filters" required:"true"`
	Having          map[string]interface{} `json:"having"`
}

type FiltersResult

type FiltersResult struct {
	Filters map[string][]string `json:"filters" required:"true"`
}

type GenerateLicenseRequest

type GenerateLicenseRequest struct {
	FirstName   string `json:"first_name" validate:"required,user_name,min=2,max=32" required:"true"`
	LastName    string `json:"last_name" validate:"required,user_name,min=2,max=32" required:"true"`
	Email       string `json:"email" validate:"required,email" required:"true"`
	Company     string `json:"company" validate:"required,company_name,min=2,max=32" required:"true"`
	ResendEmail bool   `json:"resend_email" required:"true"`
}

type GenerateLicenseResponse

type GenerateLicenseResponse struct {
	Message             string `json:"message" required:"true"`
	Success             bool   `json:"success" required:"true"`
	GenerateLicenseLink string `json:"generate_license_link"`
}

type GenerateReportReq

type GenerateReportReq struct {
	ReportType    string              `json:"report_type" validate:"required" required:"true" enum:"pdf,xlsx,sbom"`
	FromTimestamp int64               `json:"from_timestamp"` // timestamp in milliseconds
	ToTimestamp   int64               `json:"to_timestamp"`   // timestamp in milliseconds
	Filters       utils.ReportFilters `json:"filters"`
	Options       utils.ReportOptions `json:"options" validate:"omitempty"`
	ZippedReport  bool                `json:"zipped_report"`
}

type GenerateReportResp

type GenerateReportResp struct {
	ReportID string `json:"report_id"`
}

type GenerativeAiIntegrationCloudPostureRequest

type GenerativeAiIntegrationCloudPostureRequest struct {
	GenerativeAiIntegrationRequestCommon
	RemediationFormat   string `json:"remediation_format" validate:"required,oneof=all cli pulumi terraform" required:"true" enum:"all,cli,pulumi,terraform"`
	Group               string `json:"group"`
	Service             string `json:"service"`
	Title               string `json:"title" validate:"required" required:"true"`
	ComplianceCheckType string `json:"compliance_check_type" validate:"required" required:"true"`
	CloudProvider       string `json:"cloud_provider" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationCloudPostureRequest) GetFields

func (a GenerativeAiIntegrationCloudPostureRequest) GetFields() interface{}

func (GenerativeAiIntegrationCloudPostureRequest) GetRequestType

type GenerativeAiIntegrationKubernetesPostureRequest

type GenerativeAiIntegrationKubernetesPostureRequest struct {
	GenerativeAiIntegrationRequestCommon
	RemediationFormat   string `json:"remediation_format" validate:"required,oneof=all cli pulumi terraform" required:"true" enum:"all,cli,pulumi,terraform"`
	Description         string `json:"description" validate:"required" required:"true"`
	ComplianceCheckType string `json:"compliance_check_type" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationKubernetesPostureRequest) GetFields

func (a GenerativeAiIntegrationKubernetesPostureRequest) GetFields() interface{}

func (GenerativeAiIntegrationKubernetesPostureRequest) GetRequestType

type GenerativeAiIntegrationLinuxPostureRequest

type GenerativeAiIntegrationLinuxPostureRequest struct {
	GenerativeAiIntegrationRequestCommon
	RemediationFormat   string `json:"remediation_format" validate:"required,oneof=all cli pulumi terraform" required:"true" enum:"all,cli,pulumi,terraform"`
	Description         string `json:"description" validate:"required" required:"true"`
	TestNumber          string `json:"test_number" validate:"required" required:"true"`
	ComplianceCheckType string `json:"compliance_check_type" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationLinuxPostureRequest) GetFields

func (a GenerativeAiIntegrationLinuxPostureRequest) GetFields() interface{}

func (GenerativeAiIntegrationLinuxPostureRequest) GetRequestType

type GenerativeAiIntegrationListRequest

type GenerativeAiIntegrationListRequest struct {
	IntegrationType string `query:"integration_type" validate:"omitempty,oneof=openai amazon-bedrock" enum:"openai,amazon-bedrock"`
}

type GenerativeAiIntegrationListResponse

type GenerativeAiIntegrationListResponse struct {
	ID                 int32  `json:"id"`
	IntegrationType    string `json:"integration_type"`
	Label              string `json:"label"`
	LastErrorMsg       string `json:"last_error_msg"`
	DefaultIntegration bool   `json:"default_integration"`
}

type GenerativeAiIntegrationMalwareRequest

type GenerativeAiIntegrationMalwareRequest struct {
	GenerativeAiIntegrationRequestCommon
	RuleName string `json:"rule_name" validate:"required" required:"true"`
	Info     string `json:"info" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationMalwareRequest) GetFields

func (a GenerativeAiIntegrationMalwareRequest) GetFields() interface{}

func (GenerativeAiIntegrationMalwareRequest) GetRequestType

func (a GenerativeAiIntegrationMalwareRequest) GetRequestType() string

type GenerativeAiIntegrationMessageResponse

type GenerativeAiIntegrationMessageResponse struct {
	Content      string `json:"content"`
	FinishReason string `json:"finish_reason"`
}

type GenerativeAiIntegrationRequest

type GenerativeAiIntegrationRequest interface {
	GetRequestType() string
	GetFields() interface{}
	GetIntegrationID() int32
	GetQueryType() string
}

type GenerativeAiIntegrationRequestCommon

type GenerativeAiIntegrationRequestCommon struct {
	IntegrationID int32  `json:"integration_id"`
	QueryType     string `json:"query_type" validate:"required,oneof=remediation" required:"true" enum:"remediation"`
}

func (GenerativeAiIntegrationRequestCommon) GetIntegrationID

func (a GenerativeAiIntegrationRequestCommon) GetIntegrationID() int32

func (GenerativeAiIntegrationRequestCommon) GetQueryType

type GenerativeAiIntegrationSecretRequest

type GenerativeAiIntegrationSecretRequest struct {
	GenerativeAiIntegrationRequestCommon
	Name string `json:"name" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationSecretRequest) GetFields

func (a GenerativeAiIntegrationSecretRequest) GetFields() interface{}

func (GenerativeAiIntegrationSecretRequest) GetRequestType

func (a GenerativeAiIntegrationSecretRequest) GetRequestType() string

type GenerativeAiIntegrationVulnerabilityRequest

type GenerativeAiIntegrationVulnerabilityRequest struct {
	GenerativeAiIntegrationRequestCommon
	RemediationFormat  string `json:"remediation_format" validate:"required,oneof=all cli pulumi terraform" required:"true" enum:"all,cli,pulumi,terraform"`
	CveID              string `json:"cve_id" validate:"required" required:"true"`
	CveType            string `json:"cve_type" validate:"required" required:"true"`
	CveCausedByPackage string `json:"cve_caused_by_package" validate:"required" required:"true"`
}

func (GenerativeAiIntegrationVulnerabilityRequest) GetFields

func (a GenerativeAiIntegrationVulnerabilityRequest) GetFields() interface{}

func (GenerativeAiIntegrationVulnerabilityRequest) GetRequestType

type GetAgentBinaryDownloadURLResponse

type GetAgentBinaryDownloadURLResponse struct {
	AgentBinaryAmd64DownloadURL     string `json:"agent_binary_amd64_download_url"`
	AgentBinaryArm64DownloadURL     string `json:"agent_binary_arm64_download_url"`
	StartAgentScriptDownloadURL     string `json:"start_agent_script_download_url"`
	UninstallAgentScriptDownloadURL string `json:"uninstall_agent_script_download_url"`
}

type GetAuditLogsRequest

type GetAuditLogsRequest struct {
	Window FetchWindow `json:"window"  required:"true"`
}

type GraphResult

type GraphResult struct {
	Nodes detailed.NodeSummaries               `json:"nodes" required:"true"`
	Edges detailed.TopologyConnectionSummaries `json:"edges" required:"true"`
}

type Host

type Host struct {
	ID                              string           `json:"node_id" required:"true"`
	HostName                        string           `json:"host_name" required:"true"`
	NodeName                        string           `json:"node_name" required:"true"`
	Tags                            []string         `json:"tags" required:"true"`
	Containers                      []Container      `json:"containers" required:"true"`
	Processes                       []Process        `json:"processes" required:"true"`
	Pods                            []Pod            `json:"pods" required:"true"`
	ContainerImages                 []ContainerImage `json:"container_images" required:"true"`
	KernelVersion                   string           `json:"kernel_version" required:"true"`
	Uptime                          int              `json:"uptime" required:"true"`
	Version                         string           `json:"version" required:"true"`
	AgentRunning                    bool             `json:"agent_running" required:"true"`
	IsConsoleVM                     bool             `json:"is_console_vm" required:"true"`
	LocalCIDRs                      []interface{}    `json:"local_cidr" required:"true"`
	Os                              string           `json:"os" required:"true"`
	LocalNetworks                   []interface{}    `json:"local_networks" required:"true"`
	InstanceID                      string           `json:"instance_id" required:"true"`
	CloudProvider                   string           `json:"cloud_provider" required:"true"`
	CloudAccountID                  string           `json:"cloud_account_id" required:"true"`
	InstanceType                    string           `json:"instance_type" required:"true"`
	PublicIP                        []interface{}    `json:"public_ip" required:"true"`
	PrivateIP                       []interface{}    `json:"private_ip" required:"true"`
	AvailabilityZone                string           `json:"availability_zone" required:"true"`
	KernelID                        string           `json:"kernel_id" required:"true"`
	CloudRegion                     string           `json:"cloud_region" required:"true"`
	ResourceGroup                   string           `json:"resource_group" required:"true"`
	CPUMax                          float64          `json:"cpu_max" required:"true"`
	CPUUsage                        float64          `json:"cpu_usage" required:"true"`
	MemoryMax                       int64            `json:"memory_max" required:"true"`
	MemoryUsage                     int64            `json:"memory_usage" required:"true"`
	VulnerabilitiesCount            int64            `json:"vulnerabilities_count" required:"true"`
	VulnerabilityScanStatus         string           `json:"vulnerability_scan_status" required:"true"`
	VulnerabilityLatestScanID       string           `json:"vulnerability_latest_scan_id" required:"true"`
	SecretsCount                    int64            `json:"secrets_count" required:"true"`
	SecretScanStatus                string           `json:"secret_scan_status" required:"true"`
	SecretLatestScanID              string           `json:"secret_latest_scan_id" required:"true"`
	MalwaresCount                   int64            `json:"malwares_count" required:"true"`
	MalwareScanStatus               string           `json:"malware_scan_status" required:"true"`
	MalwareLatestScanID             string           `json:"malware_latest_scan_id" required:"true"`
	CompliancesCount                int64            `json:"compliances_count" required:"true"`
	ComplianceScanStatus            string           `json:"compliance_scan_status" required:"true"`
	ComplianceLatestScanID          string           `json:"compliance_latest_scan_id" required:"true"`
	ExploitableVulnerabilitiesCount int64            `json:"exploitable_vulnerabilities_count" required:"true"`
	ExploitableSecretsCount         int64            `json:"exploitable_secrets_count" required:"true"`
	ExploitableMalwaresCount        int64            `json:"exploitable_malwares_count" required:"true"`
	WarnAlarmCount                  int64            `json:"warn_alarm_count" required:"true"`
	CloudWarnAlarmCount             int64            `json:"cloud_warn_alarm_count" required:"true"`
	InboundConnections              []Connection     `json:"inbound_connections" required:"true"`
	OutboundConnections             []Connection     `json:"outbound_connections" required:"true"`
}

func (Host) ExtendedField

func (Host) ExtendedField() string

func (Host) GetCategory

func (Host) GetCategory() string

func (Host) GetJSONCategory

func (Host) GetJSONCategory() string

func (Host) NodeType

func (Host) NodeType() string

type Identifiable

type Identifiable interface {
	// contains filtered or unexported methods
}

type ImageStub

type ImageStub struct {
	ID     string   `json:"id"`
	Name   string   `json:"name"`
	Images int      `json:"images"`
	Tags   []string `json:"tags"`
}

func ListImageStubs

func ListImageStubs(ctx context.Context, registryID string,
	filter reporters.FieldsFilters, fw FetchWindow) ([]ImageStub, error)

func (*ImageStub) AddTags

func (i *ImageStub) AddTags(tags ...string) ImageStub

type IngestedContainerImage

type IngestedContainerImage struct {
	ID                     string                 `json:"node_id" required:"true"`
	NodeName               string                 `json:"node_name" required:"true"`
	Name                   string                 `json:"docker_image_name" required:"true"`
	Tag                    string                 `json:"docker_image_tag" required:"true"`
	Size                   string                 `json:"docker_image_size" required:"true"`
	DockerImageCreatedAt   string                 `json:"docker_image_created_at" required:"true"`
	DockerImageVirtualSize string                 `json:"docker_image_virtual_size" required:"true"`
	DockerImageID          string                 `json:"docker_image_id" required:"true"`
	ShortImageID           string                 `json:"short_image_id"`
	Metadata               map[string]interface{} `json:"metadata" nested_json:"true"`
}

func (IngestedContainerImage) ExtendedField

func (IngestedContainerImage) ExtendedField() string

func (IngestedContainerImage) GetCategory

func (IngestedContainerImage) GetCategory() string

func (IngestedContainerImage) GetJSONCategory

func (IngestedContainerImage) GetJSONCategory() string

func (IngestedContainerImage) NodeType

func (IngestedContainerImage) NodeType() string

type InitAgentReq

type InitAgentReq struct {
	AgentID
	Version  string `json:"version" required:"true"`
	NodeType string `json:"node_type" required:"true"`
}

type IntegrationAddReq

type IntegrationAddReq struct {
	Config           map[string]interface{} `json:"config"`
	IntegrationType  string                 `json:"integration_type" required:"true"`
	NotificationType string                 `json:"notification_type" required:"true"`
	Filters          IntegrationFilters     `json:"filters"`
	SendSummary      bool                   `json:"send_summary"`
}

IntegrationAddReq is the request body for adding a new integration

func (*IntegrationAddReq) CreateIntegration

func (i *IntegrationAddReq) CreateIntegration(ctx context.Context, pgClient *postgresqlDb.Queries, userID int64) error

func (*IntegrationAddReq) IntegrationExists

func (i *IntegrationAddReq) IntegrationExists(ctx context.Context, pgClient *postgresqlDb.Queries) (bool, error)

type IntegrationFilters

type IntegrationFilters struct {
	FieldsFilters  reporters.FieldsFilters `json:"fields_filters"`
	NodeIds        []NodeIdentifier        `json:"node_ids" required:"true"`
	ContainerNames []string                `json:"container_names" required:"false"`
	CloudProvider  string                  `json:"cloud_provider" required:"false"`
}

type IntegrationIDPathReq

type IntegrationIDPathReq struct {
	IntegrationID string `path:"integration_id" validate:"required" required:"true"`
}

type IntegrationListReq

type IntegrationListReq struct {
	IntegrationTypes []string `json:"integration_types"`
}

func (*IntegrationListReq) GetIntegrations

func (i *IntegrationListReq) GetIntegrations(ctx context.Context, pgClient *postgresqlDb.Queries) ([]postgresqlDb.Integration, error)

type IntegrationListResp

type IntegrationListResp struct {
	ID               int32                  `json:"id"`
	IntegrationType  string                 `json:"integration_type"`
	NotificationType string                 `json:"notification_type"`
	Config           map[string]interface{} `json:"config"`
	Filters          IntegrationFilters     `json:"filters"`
	LastErrorMsg     string                 `json:"last_error_msg"`
}

func (*IntegrationListResp) RedactSensitiveFieldsInConfig

func (i *IntegrationListResp) RedactSensitiveFieldsInConfig()

type IntegrationUpdateReq

type IntegrationUpdateReq struct {
	ID               int32                  `json:"id"`
	Config           map[string]interface{} `json:"config"`
	IntegrationType  string                 `json:"integration_type"`
	NotificationType string                 `json:"notification_type"`
	Filters          IntegrationFilters     `json:"filters"`
	IntegrationID    string                 `path:"integration_id" validate:"required" required:"true"`
	SendSummary      bool                   `json:"send_summary"`
}

func (*IntegrationUpdateReq) UpdateIntegration

func (i *IntegrationUpdateReq) UpdateIntegration(ctx context.Context, pgClient *postgresqlDb.Queries, integration postgresqlDb.Integration) error

type InviteUserRequest

type InviteUserRequest struct {
	Email  string `json:"email" validate:"required,email" required:"true"`
	Role   string `` /* 130-byte string literal not displayed */
	Action string `` /* 130-byte string literal not displayed */
}

type InviteUserResponse

type InviteUserResponse struct {
	InviteExpiryHours int32  `json:"invite_expiry_hours"`
	InviteURL         string `json:"invite_url"`
	Message           string `json:"message"`
}

type KubernetesCluster

type KubernetesCluster struct {
	ID           string   `json:"node_id" required:"true"`
	Name         string   `json:"node_name" required:"true"`
	Tags         []string `json:"tags" required:"true"`
	AgentRunning bool     `json:"agent_running" required:"true"`
	Hosts        []Host   `json:"hosts" required:"true"`
}

func (KubernetesCluster) ExtendedField

func (KubernetesCluster) ExtendedField() string

func (KubernetesCluster) GetCategory

func (KubernetesCluster) GetCategory() string

func (KubernetesCluster) GetJSONCategory

func (KubernetesCluster) GetJSONCategory() string

func (KubernetesCluster) NodeType

func (KubernetesCluster) NodeType() string

type License

type License struct {
	LicenseKey                      string              `json:"key"`
	LicenseKeyUUID                  uuid.UUID           `json:"-"`
	LicenseEmail                    string              `json:"license_email"`
	LicenseEmailDomain              string              `json:"license_email_domain"`
	IsActive                        bool                `json:"is_active"`
	EndDate                         string              `json:"end_date"`
	NoOfHosts                       int64               `json:"no_of_hosts"`
	NoOfCloudAccounts               int64               `json:"no_of_cloud_accounts"`
	NoOfRegistries                  int64               `json:"no_of_registries"`
	NoOfImagesInRegistry            int64               `json:"no_of_images_in_registry"`
	CurrentHosts                    int64               `json:"current_hosts"`
	DeepfenceSupportEmail           string              `json:"deepfence_support_email"`
	NotificationThresholdPercentage int32               `json:"notification_threshold_percentage"`
	NotificationThresholdUpdatedAt  int64               `json:"notification_threshold_updated_at"`
	StartDate                       string              `json:"start_date"`
	Message                         string              `json:"message"`
	Description                     string              `json:"description"`
	LicenseType                     string              `json:"license_type"`
	RegistryCredentials             RegistryCredentials `json:"registry_credentials"`
}

func FetchLicense

func FetchLicense(ctx context.Context, licenseKey string, email string, pgClient *postgresqlDb.Queries) (*License, int, error)

func GetLicense

func GetLicense(ctx context.Context, pgClient *postgresqlDb.Queries) (*License, error)

func (*License) Delete

func (l *License) Delete(ctx context.Context, pgClient *postgresqlDb.Queries) error

func (*License) Save

func (l *License) Save(ctx context.Context, pgClient *postgresqlDb.Queries) error

func (*License) UpdateNotificationThresholdPercentage

func (l *License) UpdateNotificationThresholdPercentage(ctx context.Context, pgClient *postgresqlDb.Queries, threshold int32) error

type LicenseServerResponse

type LicenseServerResponse struct {
	Data  License `json:"data"`
	Error struct {
		ErrorFields map[string]string `json:"error_fields"`
		Message     string            `json:"message"`
	} `json:"error"`
	Success bool `json:"success"`
}

type ListAgentVersionResp

type ListAgentVersionResp struct {
	Versions []string `json:"versions" required:"true"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" validate:"required,email" required:"true"`
	Password string `json:"password" validate:"required,min=1,max=32" required:"true"`
}

type LoginResponse

type LoginResponse struct {
	ResponseAccessToken
	OnboardingRequired  bool   `json:"onboarding_required" required:"true"`
	PasswordInvalidated bool   `json:"password_invalidated" required:"true"`
	LicenseRegistered   bool   `json:"license_registered" required:"true"`
	LicenseKey          string `json:"license_key" required:"true"`
	EmailDomain         string `json:"email_domain" required:"true"`
}

type Malware

type Malware struct {
	// Malware + MalwareRule node in neo4j
	Class            string        `json:"class" required:"true"`
	CompleteFilename string        `json:"complete_filename" required:"true"`
	FileSevScore     int           `json:"file_sev_score" required:"true"`
	FileSeverity     string        `` /* 135-byte string literal not displayed */
	ImageLayerID     string        `json:"image_layer_id" required:"true"`
	NodeID           string        `json:"node_id" required:"true"`
	RuleID           string        `json:"rule_id" required:"true"`
	RuleName         string        `json:"rule_name" required:"true"`
	Author           string        `json:"author"`
	Date             string        `json:"date"`
	Description      string        `json:"description"`
	Filetype         string        `json:"filetype"`
	Info             string        `json:"info"`
	Version          string        `json:"version"`
	Reference        string        `json:"reference"`
	SeverityScore    int           `json:"severity_score"`
	StringsToMatch   []interface{} `json:"strings_to_match"`
	Summary          string        `json:"summary"`
	Masked           bool          `json:"masked" required:"true"`
	Resources        []BasicNode   `json:"resources" required:"false"`
}

func (Malware) ExtendedField

func (Malware) ExtendedField() string

func (Malware) GetCategory

func (v Malware) GetCategory() string

func (Malware) GetJSONCategory

func (Malware) GetJSONCategory() string

func (Malware) NodeType

func (Malware) NodeType() string

type MalwareRule

type MalwareRule struct {
	RuleID       string `json:"rule_id"`
	RuleName     string `json:"rule_name"`
	Author       string `json:"author"`
	Date         string `json:"date"`
	Description  string `json:"description"`
	Filetype     string `json:"filetype"`
	Info         string `json:"info"`
	Version      string `json:"version"`
	FileSeverity string `json:"file_severity"`
	Masked       bool   `json:"masked" required:"true"`
	Payload      string `json:"payload" required:"true"`
	Severity     string `json:"severity" required:"true"`
	Summary      string `json:"summary" required:"true"`
	UpdatedAt    int64  `json:"updated_at" required:"true"`
}

func (MalwareRule) ExtendedField

func (MalwareRule) ExtendedField() string

func (MalwareRule) GetCategory

func (v MalwareRule) GetCategory() string

func (MalwareRule) GetJSONCategory

func (MalwareRule) GetJSONCategory() string

func (MalwareRule) NodeType

func (MalwareRule) NodeType() string

type MalwareScanResult

type MalwareScanResult struct {
	ScanResultsCommon
	Malwares       []Malware        `json:"malwares" required:"true"`
	SeverityCounts map[string]int32 `json:"severity_counts" required:"true"`
}

type MalwareScanResultClass

type MalwareScanResultClass struct {
	Class []string `json:"class" required:"true"`
}

type MalwareScanResultRules

type MalwareScanResultRules struct {
	Rules []string `json:"rules" required:"true"`
}

type MalwareScanTriggerReq

type MalwareScanTriggerReq struct {
	ScanTriggerCommon
}

type MessageResponse

type MessageResponse struct {
	Message string `json:"message" required:"true"`
}

type Metadata

type Metadata map[string]interface{}

type NodeIdentifier

type NodeIdentifier struct {
	NodeID   string `json:"node_id" required:"true"`
	NodeType string `json:"node_type" required:"true" enum:"image,host,container,cloud_account,cluster,registry,pod"`
}

type NodesInScanResultRequest

type NodesInScanResultRequest struct {
	ResultIDs []string `json:"result_ids" validate:"required,dive,min=1" required:"true"`
	ScanType  string   `` /* 217-byte string literal not displayed */
}

type NotificationThresholdUpdateRequest

type NotificationThresholdUpdateRequest struct {
	NotificationThresholdPercentage int32 `json:"notification_threshold_percentage" validate:"required,min=50,max=100" required:"true"`
}

type PackageVulnerabilityScanResult

type PackageVulnerabilityScanResult struct {
	ScanResultsCommon
	PackageVulnerability map[string][]Vulnerability `json:"packages_vulnerability" required:"true"`
}

type PasswordResetRequest

type PasswordResetRequest struct {
	Email string `json:"email" validate:"required,email" required:"true"`
}

type PasswordResetVerifyRequest

type PasswordResetVerifyRequest struct {
	Namespace string `json:"namespace" validate:"required,namespace" required:"true"`
	Code      string `json:"code" validate:"required,uuid4" required:"true"`
	Password  string `json:"password" validate:"required,password,min=8,max=32" required:"true"`
}

type PendingCloudComplianceScan

type PendingCloudComplianceScan struct {
	ScanID    string   `json:"scan_id"`
	ScanType  string   `json:"scan_type"`
	Controls  []string `json:"controls"`
	AccountID string   `json:"account_id"`
}

type Pod

type Pod struct {
	ID                        string                 `json:"node_id" required:"true"`
	NodeName                  string                 `json:"node_name" required:"true"`
	Tags                      []string               `json:"tags" required:"true"`
	Namespace                 string                 `json:"kubernetes_namespace" required:"true"`
	PodName                   string                 `json:"pod_name" required:"true"`
	Host                      string                 `json:"host_name" required:"true"`
	Containers                []Container            `json:"containers" required:"true"`
	Processes                 []Process              `json:"processes" required:"true"`
	KubernetesClusterName     string                 `json:"kubernetes_cluster_name" required:"true"`
	KubernetesClusterID       string                 `json:"kubernetes_cluster_id" required:"true"`
	KubernetesState           string                 `json:"kubernetes_state" required:"true"`
	KubernetesIP              string                 `json:"kubernetes_ip" required:"true"`
	KubernetesIsInHostNetwork bool                   `json:"kubernetes_is_in_host_network" required:"true"`
	KubernetesLabels          map[string]interface{} `json:"kubernetes_labels" required:"true" nested_json:"true"`
	KubernetesCreated         string                 `json:"kubernetes_created" required:"true"`
	MalwareScanStatus         string                 `json:"malware_scan_status" required:"true"`
	SecretScanStatus          string                 `json:"secret_scan_status" required:"true"`
	VulnerabilityScanStatus   string                 `json:"vulnerability_scan_status" required:"true"`
	IsDeepfenceSystem         bool                   `json:"is_deepfence_system" required:"true"`
}

func (Pod) ExtendedField

func (Pod) ExtendedField() string

func (Pod) GetCategory

func (Pod) GetCategory() string

func (Pod) GetJSONCategory

func (Pod) GetJSONCategory() string

func (Pod) NodeType

func (Pod) NodeType() string

type PostureProvider

type PostureProvider struct {
	Name                 string  `json:"name"`
	NodeCount            int64   `json:"node_count"`
	NodeCountInactive    int64   `json:"node_count_inactive"`
	NodeLabel            string  `json:"node_label"`
	ScanCount            int64   `json:"scan_count"`
	CompliancePercentage float64 `json:"compliance_percentage"`
	ResourceCount        int64   `json:"resource_count"`
}

func GetCloudProvidersList

func GetCloudProvidersList(ctx context.Context) ([]PostureProvider, error)

type PresentationContext

type PresentationContext struct {
	MetadataOrder map[string]int    `json:"metadata_order" required:"true"`
	IDToLabels    map[string]string `json:"id_to_labels" required:"true"`
}

type Process

type Process struct {
	ID             string  `json:"node_id" required:"true"`
	Name           string  `json:"node_name" required:"true"`
	ShortNodeName  string  `json:"short_name" required:"true"`
	PID            int     `json:"pid" required:"true"`
	Command        string  `json:"cmdline" required:"true"`
	PPID           int     `json:"ppid" required:"true"`
	ThreadNumber   int     `json:"threads" required:"true"`
	CPUMax         float64 `json:"cpu_max" required:"true"`
	CPUUsage       float64 `json:"cpu_usage" required:"true"`
	MemoryMax      int64   `json:"memory_max" required:"true"`
	MemoryUsage    int64   `json:"memory_usage" required:"true"`
	OpenFilesCount int     `json:"open_files_count" required:"true"`
}

func (Process) ExtendedField

func (Process) ExtendedField() string

func (Process) GetCategory

func (Process) GetCategory() string

func (Process) GetJSONCategory

func (Process) GetJSONCategory() string

func (Process) NodeType

func (Process) NodeType() string

type RegisterInvitedUserRequest

type RegisterInvitedUserRequest struct {
	Namespace           string `json:"namespace" validate:"required,namespace" required:"true"`
	FirstName           string `json:"first_name" validate:"required,user_name,min=2,max=32" required:"true"`
	LastName            string `json:"last_name" validate:"required,user_name,min=2,max=32" required:"true"`
	Password            string `json:"password" validate:"required,password,min=8,max=32" required:"true"`
	IsTemporaryPassword bool   `json:"is_temporary_password"`
	Code                string `json:"code" validate:"required,uuid4" required:"true"`
}

type RegisterLicenseRequest

type RegisterLicenseRequest struct {
	Email      string `json:"email" validate:"omitempty,email"`
	LicenseKey string `json:"license_key" validate:"required,uuid4" required:"true"`
}

type RegisterLicenseResponse

type RegisterLicenseResponse struct {
	LicenseKey  string `json:"license_key" required:"true"`
	EmailDomain string `json:"email_domain" required:"true"`
}

type RegistryAccount

type RegistryAccount struct {
	ID              string           `json:"node_id" required:"true"`
	Name            string           `json:"name" required:"true"`
	ContainerImages []ContainerImage `json:"container_images" required:"true"`
	RegistryType    string           `json:"registry_type" required:"true"`
	Syncing         bool             `json:"syncing" required:"true"`
}

func (RegistryAccount) ExtendedField

func (RegistryAccount) ExtendedField() string

func (RegistryAccount) GetCategory

func (RegistryAccount) GetCategory() string

func (RegistryAccount) GetJSONCategory

func (RegistryAccount) GetJSONCategory() string

func (RegistryAccount) NodeType

func (RegistryAccount) NodeType() string

type RegistryAddReq

type RegistryAddReq struct {
	Name         string                 `json:"name" validate:"required,min=2,max=64" required:"true"`
	NonSecret    map[string]interface{} `json:"non_secret"`
	Secret       map[string]interface{} `json:"secret"`
	Extras       map[string]interface{} `json:"extras"`
	RegistryType string                 `json:"registry_type" validate:"required" required:"true"`
}

func (*RegistryAddReq) CreateRegistry

func (ra *RegistryAddReq) CreateRegistry(ctx context.Context, rContext context.Context,
	pgClient *postgresqlDb.Queries, ns string) (int32, error)

func (*RegistryAddReq) RegistryExists

func (ra *RegistryAddReq) RegistryExists(ctx context.Context,
	pgClient *postgresqlDb.Queries) (bool, error)

type RegistryCountResp

type RegistryCountResp struct {
	Count int `json:"count"`
}

type RegistryCredentials

type RegistryCredentials struct {
	Password    string `json:"password"`
	RegistryURL string `json:"registry_url"`
	Username    string `json:"username"`
}

type RegistryGCRAddReq

type RegistryGCRAddReq struct {
	Name               string         `formData:"name" json:"name" validate:"required,min=2,max=64" required:"true"`
	RegistryURL        string         `formData:"registry_url" json:"registry_url" validate:"required,url" required:"true"`
	ServiceAccountJSON multipart.File `formData:"service_account_json" json:"service_account_json" validate:"required" required:"true"`
}

type RegistryIDPathReq

type RegistryIDPathReq struct {
	RegistryID string `path:"registry_id" validate:"required" required:"true"`
}

type RegistryImage

type RegistryImage struct {
	Name              string    `json:"name"`
	Namespace         string    `json:"namespace"`
	RepositoryType    string    `json:"repository_type"`
	Status            int       `json:"status"`
	StatusDescription string    `json:"status_description"`
	Description       string    `json:"description"`
	IsPrivate         bool      `json:"is_private"`
	StarCount         int       `json:"star_count"`
	PullCount         int       `json:"pull_count"`
	LastUpdated       time.Time `json:"last_updated"`
	DateRegistered    time.Time `json:"date_registered"`
	Affiliation       string    `json:"affiliation"`
	MediaTypes        []string  `json:"media_types"`
	ContentTypes      []string  `json:"content_types"`
}

type RegistryImageListReq

type RegistryImageListReq struct {
	ResourceType string `json:"resource_type,omitempty"`
	Namespace    string `json:"namespace,omitempty"`
	ID           int32  `json:"id"`
}

func (*RegistryImageListReq) GetRegistryImages

func (r *RegistryImageListReq) GetRegistryImages(ctx context.Context) ([]ContainerImage, error)

type RegistryImageStubsReq

type RegistryImageStubsReq struct {
	RegistryID  string                  `json:"registry_id" validate:"required" required:"true"`
	ImageFilter reporters.FieldsFilters `json:"image_filter" required:"true"`
	Window      FetchWindow             `json:"window" required:"true"`
}

type RegistryImages

type RegistryImages struct {
	Count    int             `json:"count"`
	Next     string          `json:"next"`
	Previous interface{}     `json:"previous"`
	Results  []RegistryImage `json:"results"`
}

type RegistryImagesReq

type RegistryImagesReq struct {
	RegistryID      string                  `json:"registry_id" validate:"required" required:"true"`
	ImageFilter     reporters.FieldsFilters `json:"image_filter" required:"true"`
	ImageStubFilter reporters.FieldsFilters `json:"image_stub_filter" required:"true"`
	Window          FetchWindow             `json:"window" required:"true"`
}

type RegistryListReq

type RegistryListReq struct{}

todo: add support to list by name and type, id

func (*RegistryListReq) IsRegistrySyncing

func (rl *RegistryListReq) IsRegistrySyncing(ctx context.Context, rid string) bool

func (*RegistryListReq) ListRegistriesSafe

ListRegistriesSafe doesnot get secret field from DB

type RegistryListResp

type RegistryListResp struct {
	ID           int32           `json:"id"`
	NodeID       string          `json:"node_id"`
	Name         string          `json:"name"`
	RegistryType string          `json:"registry_type"`
	IsSyncing    bool            `json:"is_syncing"`
	NonSecret    json.RawMessage `json:"non_secret"`
	CreatedAt    int64           `json:"created_at"`
	UpdatedAt    int64           `json:"updated_at"`
}

type RegistrySummaryAllResp

type RegistrySummaryAllResp map[string]Summary

func RegistrySummaryAll

func RegistrySummaryAll(ctx context.Context) (RegistrySummaryAllResp, error)

type RegistryTypeReq

type RegistryTypeReq struct {
	RegistryType string `path:"registry_type" validate:"required" required:"true"`
}

type RegistryUpdateReq

type RegistryUpdateReq struct {
	ID           string                 `path:"registry_id" validate:"required" required:"true"`
	Name         string                 `json:"name" validate:"required,min=2,max=64" required:"true"`
	NonSecret    map[string]interface{} `json:"non_secret"`
	Secret       map[string]interface{} `json:"secret"`
	Extras       map[string]interface{} `json:"extras"`
	RegistryType string                 `json:"registry_type" validate:"required" required:"true"`
}

func (*RegistryUpdateReq) RegistryExists

func (ru *RegistryUpdateReq) RegistryExists(ctx context.Context,
	pgClient *postgresqlDb.Queries, id int32) (bool, error)

func (*RegistryUpdateReq) UpdateRegistry

func (ru *RegistryUpdateReq) UpdateRegistry(ctx context.Context,
	pgClient *postgresqlDb.Queries, r int32) error

type ReportReq

type ReportReq struct {
	ReportID string `json:"report_id" path:"report_id" validate:"required" required:"true"`
}

type ResponseAccessToken

type ResponseAccessToken struct {
	AccessToken  string `json:"access_token" required:"true"`
	RefreshToken string `json:"refresh_token" required:"true"`
}

type RulesActionRequest

type RulesActionRequest struct {
	RulesIDs []string `json:"rule_ids" validate:"required,gt=0,dive,min=1" required:"true"`
}

type SbomRequest

type SbomRequest struct {
	// either scan_id or node_id+node_type is required
	ScanID string `json:"scan_id" validate:"required" required:"true"`
}

type SbomResponse

type SbomResponse struct {
	PackageName string   `json:"package_name,omitempty"`
	Version     string   `json:"version,omitempty"`
	Locations   []string `json:"locations,omitempty"`
	Licenses    []string `json:"licenses,omitempty"`
	CveID       string   `json:"cve_id,omitempty"`
	Severity    string   `json:"severity,omitempty"`
	CveNodeID   string   `json:"cve_node_id,omitempty"`
}

type ScanActionRequest

type ScanActionRequest struct {
	ScanID   string `path:"scan_id" validate:"required" required:"true"`
	ScanType string `` /* 217-byte string literal not displayed */

}

type ScanCompareReq

type ScanCompareReq struct {
	BaseScanID   string                  `json:"base_scan_id" required:"true"`
	ToScanID     string                  `json:"to_scan_id" required:"true"`
	FieldsFilter reporters.FieldsFilters `json:"fields_filter" required:"true"`
	Window       FetchWindow             `json:"window"  required:"true"`
}

type ScanCompareRes

type ScanCompareRes[T any] struct {
	New []T `json:"new" required:"true"`
}

type ScanCompareResCloudCompliance

type ScanCompareResCloudCompliance = ScanCompareRes[CloudCompliance]

type ScanCompareResCompliance

type ScanCompareResCompliance = ScanCompareRes[Compliance]

type ScanCompareResMalware

type ScanCompareResMalware = ScanCompareRes[Malware]

type ScanCompareResSecret

type ScanCompareResSecret = ScanCompareRes[Secret]

type ScanCompareResVulnerability

type ScanCompareResVulnerability = ScanCompareRes[Vulnerability]

type ScanFilter

type ScanFilter struct {
	ImageScanFilter             reporters.ContainsFilter `json:"image_scan_filter" required:"true"`
	ContainerScanFilter         reporters.ContainsFilter `json:"container_scan_filter" required:"true"`
	HostScanFilter              reporters.ContainsFilter `json:"host_scan_filter" required:"true"`
	CloudAccountScanFilter      reporters.ContainsFilter `json:"cloud_account_scan_filter" required:"true"`
	KubernetesClusterScanFilter reporters.ContainsFilter `json:"kubernetes_cluster_scan_filter" required:"true"`
}

type ScanInfo

type ScanInfo struct {
	ScanID         string           `json:"scan_id" required:"true"`
	Status         string           `` /* 236-byte string literal not displayed */
	StatusMessage  string           `json:"status_message" required:"true"`
	UpdatedAt      int64            `json:"updated_at" required:"true" format:"int64"`
	CreatedAt      int64            `json:"created_at" required:"true" format:"int64"`
	NodeID         string           `json:"node_id" required:"true"`
	NodeType       string           `json:"node_type" required:"true"`
	SeverityCounts map[string]int32 `json:"severity_counts" required:"true"`
	NodeName       string           `json:"node_name" required:"true"`
}

type ScanListReq

type ScanListReq struct {
	NodeIds      []NodeIdentifier        `json:"node_ids" required:"true"`
	FieldsFilter reporters.FieldsFilters `json:"fields_filter" required:"true"`
	Window       FetchWindow             `json:"window"  required:"true"`
}

type ScanListResp

type ScanListResp struct {
	ScansInfo []ScanInfo `json:"scans_info" required:"true"`
}

type ScanReportFieldsResponse

type ScanReportFieldsResponse struct {
	Vulnerability []string `json:"vulnerability"`
	Secret        []string `json:"secret"`
	Malware       []string `json:"malware"`
	Compliance    []string `json:"compliance"`
}

type ScanResultBasicNode

type ScanResultBasicNode struct {
	ResultID   string      `json:"result_id" required:"true"`
	BasicNodes []BasicNode `json:"basic_nodes" required:"true"`
}

type ScanResultsActionRequest

type ScanResultsActionRequest struct {
	ScanID           string   `json:"scan_id" validate:"required" required:"true"`
	ResultIDs        []string `json:"result_ids" validate:"required,gt=0,dive,min=1" required:"true"`
	ScanType         string   `` /* 217-byte string literal not displayed */
	NotifyIndividual bool     `json:"notify_individual"`
	IntegrationIDs   []int32  `json:"integration_ids"`
}

type ScanResultsCommon

type ScanResultsCommon struct {
	ContainerName         string `json:"docker_container_name" required:"true"`
	ImageName             string `json:"docker_image_name" required:"true"`
	HostName              string `json:"host_name" required:"true"`
	KubernetesClusterName string `json:"kubernetes_cluster_name" required:"true"`
	NodeID                string `json:"node_id" required:"true"`
	NodeName              string `json:"node_name" required:"true"`
	NodeType              string `json:"node_type" required:"true"`
	ScanID                string `json:"scan_id" required:"true"`
	UpdatedAt             int64  `json:"updated_at" required:"true" format:"int64"`
	CreatedAt             int64  `json:"created_at" required:"true" format:"int64"`
	CloudAccountID        string `json:"cloud_account_id" required:"true"`
}

type ScanResultsMaskRequest

type ScanResultsMaskRequest struct {
	ScanID     string   `json:"scan_id" validate:"required" required:"true"`
	ResultIDs  []string `json:"result_ids" validate:"required,gt=0,dive,min=1" required:"true"`
	ScanType   string   `` /* 217-byte string literal not displayed */
	MaskAction string   `` /* 183-byte string literal not displayed */
}

type ScanResultsReq

type ScanResultsReq struct {
	ScanID       string                  `json:"scan_id" required:"true"`
	FieldsFilter reporters.FieldsFilters `json:"fields_filter" required:"true"`
	Window       FetchWindow             `json:"window"  required:"true"`
}

type ScanStatus

type ScanStatus string

type ScanStatusReq

type ScanStatusReq struct {
	ScanIds    []string `json:"scan_ids" required:"true"`
	BulkScanID string   `json:"bulk_scan_id" required:"true"`
}

type ScanStatusResp

type ScanStatusResp struct {
	Statuses map[string]ScanInfo `json:"statuses" required:"true"`
}

type ScanTriggerCommon

type ScanTriggerCommon struct {
	NodeIDs             []NodeIdentifier `json:"node_ids" required:"true"`
	Filters             ScanFilter       `json:"filters" required:"true"`
	IsPriority          bool             `json:"is_priority"`
	DeepfenceSystemScan bool             `json:"deepfence_system_scan"` // Scan Deepfence images/containers/pods if present in NodeIDs
}

type ScanTriggerResp

type ScanTriggerResp struct {
	ScanIds    []string `json:"scan_ids" required:"true"`
	BulkScanID string   `json:"bulk_scan_id" required:"true"`
}

type ScheduleJobID

type ScheduleJobID struct {
	ID int64 `path:"id"`
}

type ScheduleTaskPayload

type ScheduleTaskPayload struct {
	ScanTriggerCommon
	ScanConfigLanguages []VulnerabilityScanConfigLanguage `json:"scan_config" required:"true"`
	ComplianceBenchmarkTypes
}

type Secret

type Secret struct {
	// Secret + Rule neo4j node
	NodeID         string      `json:"node_id" required:"true"`
	StartingIndex  int32       `json:"starting_index" required:"true"`
	FullFilename   string      `json:"full_filename" required:"true"`
	MatchedContent string      `json:"matched_content" required:"true"`
	Masked         bool        `json:"masked" required:"true"`
	UpdatedAt      int64       `json:"updated_at" required:"true"`
	Level          string      `` /* 127-byte string literal not displayed */
	Score          float64     `json:"score" required:"true"`
	RuleID         string      `json:"rule_id" required:"true"`
	Resources      []BasicNode `json:"resources" required:"false"`
}

func (Secret) ExtendedField

func (Secret) ExtendedField() string

func (Secret) GetCategory

func (v Secret) GetCategory() string

func (Secret) GetJSONCategory

func (Secret) GetJSONCategory() string

func (Secret) NodeType

func (Secret) NodeType() string

type SecretRule

type SecretRule struct {
	RuleID           string `json:"rule_id"`
	Part             string `json:"part"`
	SignatureToMatch string `json:"signature_to_match"`
	Level            string `json:"level" required:"true"`
	Masked           bool   `json:"masked" required:"true"`
	Summary          string `json:"summary" required:"true"`
	Payload          string `json:"payload" required:"true"`
	Severity         string `json:"severity" required:"true"`
	UpdatedAt        int64  `json:"updated_at" required:"true"`
}

func (SecretRule) ExtendedField

func (SecretRule) ExtendedField() string

func (SecretRule) GetCategory

func (v SecretRule) GetCategory() string

func (SecretRule) GetJSONCategory

func (SecretRule) GetJSONCategory() string

func (SecretRule) NodeType

func (SecretRule) NodeType() string

type SecretScanResult

type SecretScanResult struct {
	ScanResultsCommon
	Secrets        []Secret         `json:"secrets" required:"true"`
	SeverityCounts map[string]int32 `json:"severity_counts" required:"true"`
}

type SecretScanResultRules

type SecretScanResultRules struct {
	Rules []string `json:"rules" required:"true"`
}

type SecretScanTriggerReq

type SecretScanTriggerReq struct {
	ScanTriggerCommon
}

type StopScanRequest

type StopScanRequest struct {
	ScanIds  []string `json:"scan_ids" validate:"required" required:"true"`
	ScanType string   `` /* 217-byte string literal not displayed */
}

type Summary

type Summary struct {
	Repositories    int `json:"repositories"`
	Registries      int `json:"registries"`
	Images          int `json:"images"`
	ScansComplete   int `json:"scans_complete"`
	ScansInProgress int `json:"scans_in_progress"`
	ScansTotal      int `json:"scans_total"`
}

func RegistrySummary

func RegistrySummary(ctx context.Context, registryID mo.Option[string],
	registryType mo.Option[string]) (Summary, error)

type SummaryOld

type SummaryOld struct {
	Images          int `json:"images"`
	Registries      int `json:"registries"`
	ScansComplete   int `json:"scans_complete"`
	ScansInProgress int `json:"scans_in_progress"`
	ScansTotal      int `json:"scans_total"`
	Tags            int `json:"tags"`
}

type TopologyDeltaReq

type TopologyDeltaReq struct {
	AdditionTimestamp int64    `json:"addition_timestamp" required:"true" format:"int64"`
	DeletionTimestamp int64    `json:"deletion_timestamp" required:"true" format:"int64"`
	Addition          bool     `json:"addition" required:"true"`
	Deletion          bool     `json:"deletion" required:"true"`
	EntityTypes       []string `json:"entity_types" required:"true"`
}

type TopologyDeltaResponse

type TopologyDeltaResponse struct {
	Additions         []NodeIdentifier `json:"additons"`
	Deletions         []NodeIdentifier `json:"deletions"`
	AdditionTimestamp int64            `json:"addition_timestamp" format:"int64"`
	DeletionTimestamp int64            `json:"deletion_timestamp" format:"int64"`
}

type UpdateScheduledTaskRequest

type UpdateScheduledTaskRequest struct {
	ID        int64 `path:"id" validate:"required" required:"true"`
	IsEnabled bool  `json:"is_enabled" required:"true"`
}

type UpdateUserIDRequest

type UpdateUserIDRequest struct {
	ID        int64  `path:"id" validate:"required"`
	FirstName string `json:"first_name" validate:"required,user_name,min=2,max=32"`
	LastName  string `json:"last_name" validate:"required,user_name,min=2,max=32"`
	IsActive  bool   `json:"is_active"`
	Role      string `json:"role" validate:"required,oneof=admin standard-user read-only-user" enum:"admin,standard-user,read-only-user"`
}

type UpdateUserPasswordRequest

type UpdateUserPasswordRequest struct {
	OldPassword string `json:"old_password" validate:"required,password,min=8,max=32" required:"true"`
	NewPassword string `json:"new_password" validate:"required,password,min=8,max=32" required:"true"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	FirstName string `json:"first_name" validate:"required,user_name,min=2,max=32"`
	LastName  string `json:"last_name" validate:"required,user_name,min=2,max=32"`
	IsActive  bool   `json:"is_active"`
	Role      string `json:"role" validate:"required,oneof=admin standard-user read-only-user" enum:"admin,standard-user,read-only-user"`
}

type User

type User struct {
	ID                  int64             `json:"id"`
	FirstName           string            `json:"first_name" validate:"required,user_name,min=2,max=32" required:"true"`
	LastName            string            `json:"last_name" validate:"required,user_name,min=2,max=32" required:"true"`
	Email               string            `json:"email" validate:"required,email" required:"true"`
	Company             string            `json:"company" validate:"required,company_name,min=2,max=32" required:"true"`
	CompanyID           int32             `json:"company_id"`
	IsActive            bool              `json:"is_active"`
	Password            string            `json:"-" validate:"required,password,min=8,max=32"`
	Groups              map[string]string `json:"groups"`
	Role                string            `json:"role" validate:"oneof=admin standard-user read-only-user" enum:"admin,standard-user,read-only-user"`
	RoleID              int32             `json:"role_id"`
	PasswordInvalidated bool              `json:"password_invalidated"`
	CompanyNamespace    string            `json:"-"`
	CurrentUser         *bool             `json:"current_user,omitempty"`
}

func GetUserByEmail

func GetUserByEmail(ctx context.Context, email string) (*User, int, *postgresqlDb.Queries, error)

func GetUserByID

func GetUserByID(ctx context.Context, userID int64) (*User, int, *postgresqlDb.Queries, error)

func (*User) CompareHashAndPassword

func (u *User) CompareHashAndPassword(ctx context.Context, pgClient *postgresqlDb.Queries, inputPassword string) (bool, error)

func (*User) Create

func (u *User) Create(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.User, error)

func (*User) CreateAPIToken

func (u *User) CreateAPIToken(ctx context.Context, pgClient *postgresqlDb.Queries, roleID int32, company *Company) (*postgresqlDb.ApiToken, error)

func (*User) CreateAccessToken

func (u *User) CreateAccessToken(tokenAuth *jwtauth.JWTAuth, grantType string, licenseActive bool) (string, string, error)

func (*User) CreateRefreshToken

func (u *User) CreateRefreshToken(tokenAuth *jwtauth.JWTAuth, accessTokenID string, grantType string) (string, error)

func (*User) Delete

func (u *User) Delete(ctx context.Context, pgClient *postgresqlDb.Queries) error

func (*User) GetAccessToken

func (u *User) GetAccessToken(tokenAuth *jwtauth.JWTAuth, grantType string, licenseActive bool) (*ResponseAccessToken, error)

func (*User) LoadFromDBByEmail

func (u *User) LoadFromDBByEmail(ctx context.Context, pgClient *postgresqlDb.Queries) error

func (*User) LoadFromDBByID

func (u *User) LoadFromDBByID(ctx context.Context, pgClient *postgresqlDb.Queries) error

func (*User) SetPassword

func (u *User) SetPassword(inputPassword string) error

func (*User) Update

func (u *User) Update(ctx context.Context, pgClient *postgresqlDb.Queries) (*postgresqlDb.User, error)

func (*User) UpdatePassword

func (u *User) UpdatePassword(ctx context.Context, pgClient *postgresqlDb.Queries) error

type UserIDRequest

type UserIDRequest struct {
	ID int64 `path:"id"`
}

type UserRegisterRequest

type UserRegisterRequest struct {
	FirstName           string `json:"first_name" validate:"required,user_name,min=2,max=32" required:"true"`
	LastName            string `json:"last_name" validate:"required,user_name,min=2,max=32" required:"true"`
	Email               string `json:"email" validate:"required,email" required:"true"`
	Company             string `json:"company" validate:"required,company_name,min=2,max=32" required:"true"`
	Password            string `json:"password" validate:"required,password,min=8,max=32" required:"true"`
	IsTemporaryPassword bool   `json:"is_temporary_password"`
	ConsoleURL          string `json:"console_url" validate:"required,url" required:"true"`
}

type Vulnerability

type Vulnerability struct {
	NodeID                 string        `json:"node_id" required:"true"`
	CveID                  string        `json:"cve_id" required:"true"`
	CveSeverity            string        `` /* 134-byte string literal not displayed */
	CveCausedByPackage     string        `json:"cve_caused_by_package" required:"true"`
	CveCausedByPackagePath string        `json:"cve_caused_by_package_path" required:"true"`
	CveContainerLayer      string        `json:"cve_container_layer" required:"true"`
	CveLink                string        `json:"cve_link" required:"true"`
	Masked                 bool          `json:"masked" required:"true"`
	UpdatedAt              int64         `json:"updated_at" required:"true"`
	HasLiveConnection      bool          `json:"has_live_connection" required:"true"`
	CveType                string        `json:"cve_type" required:"true"`
	CveFixedIn             string        `json:"cve_fixed_in" required:"true"`
	CveDescription         string        `json:"cve_description" required:"true"`
	CveCVSSScore           float64       `json:"cve_cvss_score" required:"true"`
	CveOverallScore        float64       `json:"cve_overall_score" required:"true"`
	CveAttackVector        string        `json:"cve_attack_vector" required:"true"`
	URLs                   []interface{} `json:"urls" required:"true"`
	ExploitPOC             string        `json:"exploit_poc" required:"true"`
	ParsedAttackVector     string        `json:"parsed_attack_vector" required:"true"`
	Resources              []BasicNode   `json:"resources" required:"false"`
	RuleID                 string        `json:"rule_id" required:"true"`
	Namespace              string        `json:"namespace" required:"true"`
	CISAKEV                bool          `json:"cisa_kev" required:"true"`
	EPSSScore              float64       `json:"epss_score" required:"true"`
}

func (Vulnerability) ExtendedField

func (Vulnerability) ExtendedField() string

func (Vulnerability) GetCategory

func (v Vulnerability) GetCategory() string

func (Vulnerability) GetJSONCategory

func (Vulnerability) GetJSONCategory() string

func (Vulnerability) NodeType

func (Vulnerability) NodeType() string

type VulnerabilityRule

type VulnerabilityRule struct {
	NodeID              string      `json:"node_id" required:"true"`
	CveID               string      `json:"cve_id" required:"true"`
	CveTypes            []string    `json:"cve_types" required:"true"`
	CveSeverities       []string    `json:"cve_severities" required:"true"`
	CveFixedIns         []string    `json:"cve_fixed_ins" required:"true"`
	CveLinks            []string    `json:"cve_links" required:"true"`
	CveDescriptions     []string    `json:"cve_descriptions" required:"true"`
	CveCvssScores       []any       `json:"cve_cvss_scores" required:"true"`
	CveOverallScores    []any       `json:"cve_overall_scores" required:"true"`
	CveAttackVectors    []string    `json:"cve_attack_vectors" required:"true"`
	URLs                []string    `json:"urls" required:"true"`
	ExploitPOCs         []string    `json:"exploit_pocs" required:"true"`
	Masked              bool        `json:"masked" required:"true"`
	UpdatedAt           int64       `json:"updated_at" required:"true"`
	PackageNames        []string    `json:"package_names" required:"true"`
	ParsedAttackVectors []string    `json:"parsed_attack_vectors" required:"true"`
	Resources           []BasicNode `json:"resources" required:"false"`
	CISAKEV             bool        `json:"cisa_kev" required:"true"`
	EPSSScore           float64     `json:"epss_score" required:"true"`
	Namespaces          []string    `json:"namespaces" required:"true"`
}

func (VulnerabilityRule) ExtendedField

func (VulnerabilityRule) ExtendedField() string

func (VulnerabilityRule) GetCategory

func (v VulnerabilityRule) GetCategory() string

func (VulnerabilityRule) GetJSONCategory

func (VulnerabilityRule) GetJSONCategory() string

func (VulnerabilityRule) NodeType

func (VulnerabilityRule) NodeType() string

type VulnerabilityScanConfig

type VulnerabilityScanConfig struct {
	ScanConfigLanguages []VulnerabilityScanConfigLanguage `json:"scan_config" validate:"required,min=1" required:"true"`
}

type VulnerabilityScanConfigLanguage

type VulnerabilityScanConfigLanguage struct {
	Language string `` /* 228-byte string literal not displayed */
}

type VulnerabilityScanResult

type VulnerabilityScanResult struct {
	ScanResultsCommon
	Vulnerabilities []Vulnerability  `json:"vulnerabilities" required:"true"`
	SeverityCounts  map[string]int32 `json:"severity_counts" required:"true"`
}

type VulnerabilityScanTriggerReq

type VulnerabilityScanTriggerReq struct {
	ScanTriggerCommon
	VulnerabilityScanConfig
}

Jump to

Keyboard shortcuts

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