rhel

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 33 Imported by: 5

Documentation

Index

Constants

View Source
const (
	None      = "None"
	Low       = "Low"
	Moderate  = "Moderate"
	Important = "Important"
	Critical  = "Critical"
)
View Source
const DefaultContainerAPI = "https://catalog.redhat.com/api/containers/"

DefaultContainerAPI is a default Red Hat's container API URL

View Source
const DefaultManifest = `https://www.redhat.com/security/data/oval/v2/PULP_MANIFEST`

DefaultManifest is the url for the Red Hat OVAL pulp repository.

View Source
const DefaultRepo2CPEMappingURL = "https://www.redhat.com/security/data/metrics/repository-to-cpe.json"

DefaultRepo2CPEMappingURL is default URL with a mapping file provided by Red Hat

View Source
const RedHatRepositoryKey = "rhel-cpe-repository"

RedHatRepositoryKey is a key of Red Hat's CPE based repository

Variables

This section is empty.

Functions

func NewEcosystem added in v0.1.0

func NewEcosystem(ctx context.Context) *indexer.Ecosystem

NewEcosystem provides the set of scanners and coalescers for the rhel ecosystem

func NormalizeSeverity added in v0.0.15

func NormalizeSeverity(severity string) claircore.Severity

Types

type Coalescer added in v0.1.0

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

Coalescer takes individual layer artifacts and coalesces them to form the final image's package results

func NewCoalescer added in v0.1.0

func NewCoalescer() *Coalescer

NewCoalescer is a constructor for a Coalescer

func (*Coalescer) Coalesce added in v0.1.0

func (c *Coalescer) Coalesce(ctx context.Context, artifacts []*indexer.LayerArtifacts) (*claircore.IndexReport, error)

Coalesce coalesces artifacts found in layers and creates a final IndexReport with the final package details found in the image. This method blocks and when its finished the c.ir field will hold the final IndexReport

type DistributionScanner added in v0.0.14

type DistributionScanner struct{}

DistributionScanner attempts to discover if a layer displays characteristics of a Oracle distribution

func (*DistributionScanner) Kind added in v0.0.14

func (*DistributionScanner) Kind() string

Kind implements scanner.VersionedScanner.

func (*DistributionScanner) Name added in v0.0.14

func (*DistributionScanner) Name() string

Name implements scanner.VersionedScanner.

func (*DistributionScanner) Scan added in v0.0.14

Scan will inspect the layer for an os-release or lsb-release file and perform a regex match for keywords indicating the associated Oracle release

If neither file is found a (nil,nil) is returned. If the files are found but all regexp fail to match an empty slice is returned.

func (*DistributionScanner) Version added in v0.0.14

func (*DistributionScanner) Version() string

Version implements scanner.VersionedScanner.

type Factory added in v0.1.0

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

Factory contains the configuration for fetching and parsing a pulp manifest.

func NewFactory added in v0.1.0

func NewFactory(ctx context.Context, manifest string, opts ...FactoryOption) (*Factory, error)

NewFactory creates a Factory making updaters based on the contents of the provided pulp manifest.

func (*Factory) Configure added in v0.1.0

func (f *Factory) Configure(ctx context.Context, cfg driver.ConfigUnmarshaler, c *http.Client) error

func (*Factory) UpdaterSet added in v0.1.0

func (f *Factory) UpdaterSet(ctx context.Context) (driver.UpdaterSet, error)

UpdaterSet implements driver.UpdaterSetFactory.

type FactoryConfig added in v0.1.0

type FactoryConfig struct {
	URL string `json:"url" yaml:"url"`
}

type FactoryOption added in v0.1.0

type FactoryOption func(*Factory) error

A FactoryOption is used with New to configure a Factory.

func FactoryWithClient added in v0.1.0

func FactoryWithClient(h *http.Client) FactoryOption

FactoryWithClient sets the http.Client used for fetching the pulp manifest.

func FactoryWithUpdaterOptions added in v0.1.0

func FactoryWithUpdaterOptions(opts ...Option) FactoryOption

FactoryWithUpdaterOptions provides Options down into created Updaters.

type Matcher added in v0.0.8

type Matcher struct {
}

Matcher implements driver.Matcher.

func (*Matcher) Filter added in v0.0.8

func (*Matcher) Filter(record *claircore.IndexRecord) bool

Filter implements driver.Matcher.

func (*Matcher) Name added in v0.0.8

func (*Matcher) Name() string

Name implements driver.Matcher.

func (*Matcher) Query added in v0.0.8

func (*Matcher) Query() []driver.MatchConstraint

Query implements driver.Matcher.

func (*Matcher) Vulnerable added in v0.0.8

func (m *Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)

Vulnerable implements driver.Matcher.

type Option

type Option func(*Updater) error

Option is a type to configure an Updater.

func WithClient

func WithClient(c *http.Client) Option

WithClient sets an http.Client for use with an Updater.

If this Option is not supplied, http.DefaultClient will be used.

func WithName added in v0.1.0

func WithName(n string) Option

func WithURL

func WithURL(uri, compression string) Option

WithURL overrides the default URL to fetch an OVAL database.

type Release

type Release int
const (
	RHEL3 Release = 3
	RHEL4 Release = 4
	RHEL5 Release = 5
	RHEL6 Release = 6
	RHEL7 Release = 7
	RHEL8 Release = 8
)

type RepoScannerConfig added in v0.1.0

type RepoScannerConfig struct {
	Timeout            time.Duration `json:"timeout" yaml:"timeout"`
	API                string        `json:"api" yaml:"api"`
	Repo2CPEMappingURL string        `json:"repo2cpe_mapping_url" yaml:"repo2cpe_mapping_url"`
}

RepoScannerConfig is the struct that will be passed to (*RepositoryScanner).Configure's ConfigDeserializer argument.

type RepositoryScanner added in v0.1.0

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

RepositoryScanner implements Red Hat repositories

func NewRepositoryScanner added in v0.1.0

func NewRepositoryScanner(ctx context.Context, c *http.Client, cs2cpeURL string) *RepositoryScanner

NewRepositoryScanner create new Repo scanner struct and initialize mapping updater

func (*RepositoryScanner) Configure added in v0.1.0

Configure implements the RPCScanner interface.

func (*RepositoryScanner) Kind added in v0.1.0

func (*RepositoryScanner) Kind() string

Kind implements scanner.VersionedScanner.

func (*RepositoryScanner) Name added in v0.1.0

func (*RepositoryScanner) Name() string

Name implements scanner.Name.

func (*RepositoryScanner) Scan added in v0.1.0

func (r *RepositoryScanner) Scan(ctx context.Context, l *claircore.Layer) (repositories []*claircore.Repository, err error)

Scan gets Red Hat repositories information.

func (*RepositoryScanner) Version added in v0.1.0

func (*RepositoryScanner) Version() string

Version implements scanner.VersionedScanner.

type Updater

type Updater struct {
	ovalutil.Fetcher // fetch method promoted via embed
	// contains filtered or unexported fields
}

Updater fetches and parses RHEL-flavored OVAL databases.

func NewUpdater

func NewUpdater(v Release, opt ...Option) (*Updater, error)

NewUpdater returns an Updater.

func (*Updater) Name

func (u *Updater) Name() string

Name satisifies the driver.Updater interface.

func (*Updater) Parse

Notes

Bugs

  • The semantics of the internal filesByRegexp function may be surprising:

    Paths have Clean called on them, but may still be absolute.

    Symlinks are not considered.

    Paths are considered as a string, with no special treatment of separators.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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