-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathtypes.ts
More file actions
130 lines (115 loc) · 2.83 KB
/
types.ts
File metadata and controls
130 lines (115 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { ImageName } from "../extractor/image";
import { AutoDetectedUserInstructions, ManifestFile } from "../types";
import {
AppDepsScanResultWithoutTarget,
JarCoords,
} from "./applications/types";
export interface AnalyzedPackage {
Name: string;
Version?: string;
Source?: string;
SourceVersion?: string;
Provides: string[];
Deps: {
[name: string]: any;
};
Purl?: string;
AutoInstalled?: boolean;
}
export interface AnalyzedPackageWithVersion extends AnalyzedPackage {
Version: string;
}
export interface DockerInspectOutput {
Architecture: string;
}
export interface ImageAnalysis {
Image: string;
AnalyzeType: AnalysisType;
Analysis: AnalyzedPackage[] | Binary[];
}
export interface ImagePackagesAnalysis extends ImageAnalysis {
AnalyzeType: Exclude<AnalysisType, AnalysisType.Binaries>;
Analysis: AnalyzedPackageWithVersion[];
}
/**
* Represents the source of OS package data from static image analysis.
*
* Primary sources (Apk, Apt, Rpm, Chisel): Native package manager databases - source of truth
* Supplemental sources (Spdx): SBOMs that augment primary findings, never selected as primary
* Fallback (Linux): Used when no package source is detected
*
* See lib/analyzer/package-sources/ for implementations.
*/
export enum AnalysisType {
Apk = "Apk",
Apt = "Apt",
Rpm = "Rpm",
Spdx = "Spdx",
Chisel = "Chisel",
Binaries = "binaries",
Linux = "linux", // default/unknown/tech-debt
}
export interface OSRelease {
name: string;
version: string;
prettyName: string;
}
export interface Binary {
name: string;
version: string;
}
export interface IAptFiles {
dpkgFile: string;
extFile: string;
}
export interface JarFingerprint {
location: string;
digest: string | null;
parentName?: string;
name?: string;
version?: string;
dependencies: JarCoords[];
}
export interface StaticAnalysis {
imageId: string;
platform?: string;
osRelease: OSRelease;
results: ImageAnalysis[];
binaries: string[];
imageLayers: string[];
rootFsLayers?: string[];
autoDetectedUserInstructions?: AutoDetectedUserInstructions;
applicationDependenciesScanResults: AppDepsScanResultWithoutTarget[];
manifestFiles: ManifestFile[];
imageLabels?: { [key: string]: string };
imageCreationTime?: string;
}
export interface StaticPackagesAnalysis extends StaticAnalysis {
results: ImagePackagesAnalysis[];
}
export interface ArchiveResult {
imageName: ImageName;
path: string;
removeArchive(): void;
}
export interface ImageDetails {
hostname: string;
imageName: string;
tag: string;
}
export interface DestinationDir {
name: string;
removeCallback: () => void;
}
export interface SourcePackage {
name: string;
version: string;
release: string;
}
export interface ChiselPackage {
kind: "package";
name: string;
version: string;
sha256: string;
arch: string;
}