Documentation ¶
Index ¶
- func MatchAllFor[T Match](filtersValues *filters.Filters, match T) bool
- type CPE
- type Coordinates
- type Descriptor
- type Digest
- type Document
- type File
- type FileLicense
- type FileLicenseEvidence
- type FileMetadataEntry
- type IDLikes
- type License
- type LinuxRelease
- type Location
- type LocationData
- type LocationMetadata
- type Match
- type Package
- type PackageBasicData
- type PackageCustomData
- type Reference
- type Relationship
- type Schema
- type SearchResult
- type Secrets
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coordinates ¶
type Coordinates struct { RealPath string `json:"path"` // The path where all path ancestors have no hardlinks / symlinks FileSystemID string `json:"layerID,omitempty"` // An ID representing the filesystem. For container images, this is a layer digest. For directories or a root filesystem, this is blank. }
Coordinates represents the coordinates for a file. Imported from file.Coordinates in syft
type Descriptor ¶
type Descriptor struct { Name string `json:"name"` Version string `json:"version"` Configuration any `json:"configuration,omitempty"` }
Descriptor describes what created the document as well as surrounding metadata
type Document ¶
type Document struct { Artifacts []Package `json:"artifacts"` // Artifacts is the list of packages discovered and placed into the catalog ArtifactRelationships []Relationship `json:"artifactRelationships"` Files []File `json:"files,omitempty"` // note: must have omitempty Source Source `json:"source"` // Source represents the original object that was cataloged Distro LinuxRelease `json:"distro"` // Distro represents the Linux distribution that was detected from the source Descriptor Descriptor `json:"descriptor"` // Descriptor is a block containing self-describing information about syft Schema Schema `json:"schema"` // Schema is a block reserved for defining the version for the shape of this JSON document and where to find the schema document to validate the shape }
Document represents the syft cataloging findings as a JSON document
func Diff ¶
Diff takes 2 syft reports and returns the difference between them for introduced or removed dependencies.
type File ¶
type File struct { ID string `json:"id"` Location Coordinates `json:"location"` Metadata *FileMetadataEntry `json:"metadata,omitempty"` Contents string `json:"contents,omitempty"` Digests []Digest `json:"digests,omitempty"` Licenses []FileLicense `json:"licenses,omitempty"` }
File is a struct that represents a specific file that has been scanned
type FileLicense ¶
type FileLicense struct { Value string `json:"value"` SPDXExpression string `json:"spdxExpression"` Type string `json:"type"` // converted from license.Type Evidence *FileLicenseEvidence `json:"evidence,omitempty"` }
FileLicense represents a license associated to a file
type FileLicenseEvidence ¶
type FileLicenseEvidence struct { Confidence int `json:"confidence"` Offset int `json:"offset"` Extent int `json:"extent"` }
FileLicenseEvidence represents the evidence associated to a file license
type FileMetadataEntry ¶
type FileMetadataEntry struct { Mode int `json:"mode"` Type string `json:"type"` LinkDestination string `json:"linkDestination,omitempty"` UserID int `json:"userID"` GroupID int `json:"groupID"` MIMEType string `json:"mimeType"` Size int64 `json:"size"` }
FileMetadataEntry metadata associated to a file
type IDLikes ¶
type IDLikes []string
IDLikes is a slice of strings that represents the IDLike field of a LinuxRelease struct.
type License ¶
type License struct { Value string `json:"value"` SPDXExpression string `json:"spdxExpression"` Type string `json:"type"` URLs []string `json:"urls"` Locations []Location `json:"locations"` }
License represents a License of a package
type LinuxRelease ¶
type LinuxRelease struct { PrettyName string `json:"prettyName,omitempty"` Name string `json:"name,omitempty"` ID string `json:"id,omitempty"` IDLike IDLikes `json:"idLike,omitempty"` Version string `json:"version,omitempty"` VersionID string `json:"versionID,omitempty"` VersionCodename string `json:"versionCodename,omitempty"` BuildID string `json:"buildID,omitempty"` ImageID string `json:"imageID,omitempty"` ImageVersion string `json:"imageVersion,omitempty"` Variant string `json:"variant,omitempty"` VariantID string `json:"variantID,omitempty"` HomeURL string `json:"homeURL,omitempty"` SupportURL string `json:"supportURL,omitempty"` BugReportURL string `json:"bugReportURL,omitempty"` PrivacyPolicyURL string `json:"privacyPolicyURL,omitempty"` CPEName string `json:"cpeName,omitempty"` SupportEnd string `json:"supportEnd,omitempty"` }
LinuxRelease is a struct that represents a Linux version for a specific scanned artifact.
type Location ¶
type Location struct { LocationData `cyclonedx:""` LocationMetadata `cyclonedx:""` }
Location represents a path relative to a particular filesystem resolved to a specific file.Reference. This struct is used as a key in content fetching to uniquely identify a file relative to a request (the AccessPath).
type LocationData ¶
type LocationData struct { Coordinates `cyclonedx:""` // Empty string here means there is no intermediate property name, e.g. syft:locations:0:path without "coordinates" // note: it is IMPORTANT to ignore anything but the coordinates for a Location when considering the ID (hash value) // since the coordinates are the minimally correct ID for a location (symlinks should not come into play) AccessPath string `hash:"ignore" json:"accessPath"` // The path to the file which may or may not have hardlinks / symlinks Ref Reference `hash:"ignore"` // The file reference relative to the stereoscope.FileCatalog that has more information about this location. }
LocationData is a struct that represents the location of a file.
func (LocationData) Reference ¶
func (l LocationData) Reference() Reference
Reference The file reference relative to the stereoscope.FileCatalog that has more information about this location. Imported from https://github.com/anchore/stereoscope/blob/main/pkg/file/reference.go
type LocationMetadata ¶
type LocationMetadata struct {
Annotations map[string]string `json:"annotations,omitempty"` // Arbitrary key-value pairs that can be used to annotate a location
}
LocationMetadata is a struct that represents the metadata associated to a location.
type Match ¶
type Match interface { File | Package | Relationship }
Match a syft match could be a file, a package or a relationship
type Package ¶
type Package struct { PackageBasicData PackageCustomData }
Package represents a pkg.Package object specialized for JSON marshaling and unmarshalling.
type PackageBasicData ¶
type PackageBasicData struct { ID string `json:"id"` Name string `json:"name"` Version string `json:"version"` Type string `json:"type"` FoundBy string `json:"foundBy"` Locations locations `json:"locations"` Licenses licenses `json:"licenses"` Language string `json:"language"` CPEs cpes `json:"cpes"` PURL string `json:"purl"` }
PackageBasicData contains non-ambiguous values (type-wise) from pkg.Package.
type PackageCustomData ¶
type PackageCustomData struct { MetadataType string `json:"metadataType,omitempty"` Metadata any `json:"metadata,omitempty"` }
PackageCustomData contains ambiguous values (type-wise) from pkg.Package.
type Reference ¶
type Reference struct { RealPath string // contains filtered or unexported fields }
Reference ported from https://github.com/anchore/stereoscope/blob/main/pkg/file/reference.go
type Relationship ¶
type Relationship struct { Parent string `json:"parent"` Child string `json:"child"` Type string `json:"type"` Metadata any `json:"metadata,omitempty"` }
Relationship is a struct that represents the relationships between packages.
func (*Relationship) UniqueID ¶
func (m *Relationship) UniqueID() string
UniqueID returns a string that uniquely identifies a relationship it's made of the parent, child and type of the relationship hashed together
type Schema ¶
Schema is a block reserved for defining the version for the shape of this JSON document and where to find the schema document to validate the shape
type SearchResult ¶
type SearchResult struct { Classification string `json:"classification"` LineNumber int64 `json:"lineNumber"` LineOffset int64 `json:"lineOffset"` SeekPosition int64 `json:"seekPosition"` Length int64 `json:"length"` Value string `json:"value,omitempty"` }
SearchResult is a struct that represents the result of a secrets scan.
type Secrets ¶
type Secrets struct { Location Coordinates `json:"location"` // from file.Coordinates Secrets []SearchResult `json:"secrets"` // from file.SearchResult }
Secrets is a struct that represents the output of a secrets scan.