Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NexposeClient ¶
type NexposeClient struct { Client *http.Client Endpoint *url.URL PageSize int ScanBlocklist *container.StringContainer }
NexposeClient implements the interfaces to fetch scans from Nexpose
func (*NexposeClient) CheckDependencies ¶ added in v0.4.0
func (n *NexposeClient) CheckDependencies(ctx context.Context) error
CheckDependencies makes a call to the nexpose endppoint "/api/3". Because asset producer endpoints vary user to user, we want to hit an endpoint that is consistent for any Nexpose user
func (*NexposeClient) FetchScans ¶
func (n *NexposeClient) FetchScans(ctx context.Context, ts time.Time) ([]domain.CompletedScan, error)
FetchScans fetches Nexpose scans, filters out running scans, and returns all completed scans after the provided timestamp.
type NexposeComponent ¶
type NexposeComponent struct{}
NexposeComponent satisfies the settings library Component API, and may be used by the settings.NewComponent function.
func (*NexposeComponent) New ¶
func (*NexposeComponent) New(_ context.Context, c *NexposeConfig) (*NexposeClient, error)
New constructs a NexposeClient from a config.
func (*NexposeComponent) Settings ¶
func (*NexposeComponent) Settings() *NexposeConfig
Settings can be used to populate default values if there are any
type NexposeConfig ¶
type NexposeConfig struct { Endpoint string `description:"The scheme and host of a Nexpose instance."` PageSize int `description:"The number of scans that should be returned from the Nexpose API at one time."` ScanBlocklist string `description:"CSV-formatted list of scan names to discard."` }
NexposeConfig holds configuration to connect to Nexpose and make a call to the fetch scans API
func (*NexposeConfig) Name ¶
func (c *NexposeConfig) Name() string
Name is used by the settings library and will add a "NEXPOSE_" prefix to NexposeConfig environment variables