webdata

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AddResponsesTempTableKey     = "resp_add_temp"
	AddResponsesTempTableColumns = []string{"organization_id", "scan_group_id", "address_hash", "url_request_timestamp", "response_timestamp",
		"is_document", "scheme", "ip_address", "host_address", "load_ip_address", "load_host_address", "response_port", "requested_port",
		"url", "headers", "status", "status_text", "mime_type", "raw_body_hash", "raw_body_link"}

	AddResponsesTempTable = `` /* 575-byte string literal not displayed */

	AddResponsesTempToStatus = `` /* 129-byte string literal not displayed */

	AddResponsesTempToMime = `insert into am.web_mime_type as resp (mime_type)
		select temp.mime_type from resp_add_temp as temp on conflict do nothing;`

	AddTempToResponses = `` /* 1038-byte string literal not displayed */

)
View Source
var (
	AddCertificatesTempTableKey     = "cert_add_temp"
	AddCertificatesTempTableColumns = []string{"organization_id", "scan_group_id", "response_timestamp",
		"address_hash", "host_address", "ip_address", "port", "protocol", "key_exchange", "key_exchange_group",
		"cipher", "mac", "certificate_value", "subject_name", "san_list", "issuer", "valid_from", "valid_to", "ct_compliance"}

	AddCertificatesTempTable = `` /* 493-byte string literal not displayed */

	AddTempToCertificates = `` /* 1012-byte string literal not displayed */

)
View Source
var (
	ErrFilterMissingGroupID = errors.New("address filter missing GroupID")
	ErrAddressMissing       = errors.New("address did not have IPAddress or HostAddress set")
	ErrNoResponses          = errors.New("no responses extracted from webdata")
	ErrCopyCount            = errors.New("count of records copied did not match expected")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for interfacing with postgresql/rds

func New

func New(authorizer auth.Authorizer) *Service

New returns an empty Service

func (*Service) Add

func (s *Service) Add(ctx context.Context, userContext am.UserContext, webData *am.WebData) (int, error)

Add webdata to the database, includes serialized dom & snapshot links, all responses and links, and web certificates extracted by the web module

func (*Service) Archive

func (s *Service) Archive(ctx context.Context, userContext am.UserContext, group *am.ScanGroup, archiveTime time.Time) (oid int, count int, err error)

Archive records for a group.

func (*Service) GetCertificates

func (s *Service) GetCertificates(ctx context.Context, userContext am.UserContext, filter *am.WebCertificateFilter) (int, []*am.WebCertificate, error)

GetCertificates that match the provided filter.

func (*Service) GetDomainDependency

func (s *Service) GetDomainDependency(ctx context.Context, userContext am.UserContext, filter *am.WebResponseFilter) (int, *am.WebDomainDependency, error)

GetDomainDependency returns the load host and domains

func (*Service) GetResponses

func (s *Service) GetResponses(ctx context.Context, userContext am.UserContext, filter *am.WebResponseFilter) (int, []*am.HTTPResponse, error)

GetResponses that match the provided filter.

func (*Service) GetSnapshots

func (s *Service) GetSnapshots(ctx context.Context, userContext am.UserContext, filter *am.WebSnapshotFilter) (int, []*am.WebSnapshot, error)

GetSnapshots that match the provided filter

func (*Service) GetURLList

func (s *Service) GetURLList(ctx context.Context, userContext am.UserContext, filter *am.WebResponseFilter) (int, []*am.URLListResponse, error)

GetURLList returns a list of urls for a series of responses (key'd off of urlrequesttimestamp)

func (*Service) GroupStats

func (s *Service) GroupStats(ctx context.Context, userContext am.UserContext, groupID int) (oid int, groupStats *am.ScanGroupWebDataStats, err error)

func (*Service) Init

func (s *Service) Init(config []byte) error

Init by parsing the config and initializing the database pool

func (*Service) IsAuthorized

func (s *Service) IsAuthorized(ctx context.Context, userContext am.UserContext, resource, action string) bool

IsAuthorized checks if an action is allowed by a particular user

func (*Service) OrgStats

func (s *Service) OrgStats(ctx context.Context, userContext am.UserContext) (oid int, orgStats []*am.ScanGroupWebDataStats, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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