UNPKG

2.32 kBPlain TextView Raw
1import { ImageName } from "../extractor/image";
2import { AutoDetectedUserInstructions, ManifestFile } from "../types";
3import {
4 AppDepsScanResultWithoutTarget,
5 JarCoords,
6} from "./applications/types";
7
8export interface AnalyzedPackage {
9 Name: string;
10 Version?: string;
11 Source?: string;
12 SourceVersion?: string;
13 Provides: string[];
14 Deps: {
15 [name: string]: any;
16 };
17 Purl?: string;
18 AutoInstalled?: boolean;
19}
20export interface AnalyzedPackageWithVersion extends AnalyzedPackage {
21 Version: string;
22}
23
24export interface DockerInspectOutput {
25 Id: string;
26 Architecture: string;
27 RootFS: {
28 Type: string;
29 Layers: string[];
30 };
31}
32
33export interface ImageAnalysis {
34 Image: string;
35 AnalyzeType: AnalysisType;
36 Analysis: AnalyzedPackage[] | Binary[];
37}
38
39export interface ImagePackagesAnalysis extends ImageAnalysis {
40 AnalyzeType: Exclude<AnalysisType, AnalysisType.Binaries>;
41 Analysis: AnalyzedPackageWithVersion[];
42}
43
44export enum AnalysisType {
45 Apk = "Apk",
46 Apt = "Apt",
47 Rpm = "Rpm",
48 Binaries = "binaries",
49 Linux = "linux", // default/unknown/tech-debt
50}
51
52export interface OSRelease {
53 name: string;
54 version: string;
55 prettyName: string;
56}
57
58export interface Binary {
59 name: string;
60 version: string;
61}
62
63export interface IAptFiles {
64 dpkgFile: string;
65 extFile: string;
66}
67
68export interface JarFingerprint {
69 location: string;
70 digest: string | null;
71 parentName?: string;
72 name?: string;
73 version?: string;
74 dependencies: JarCoords[];
75}
76export interface StaticAnalysis {
77 imageId: string;
78 platform?: string;
79 osRelease: OSRelease;
80 results: ImageAnalysis[];
81 binaries: string[];
82 imageLayers: string[];
83 rootFsLayers?: string[];
84 autoDetectedUserInstructions?: AutoDetectedUserInstructions;
85 applicationDependenciesScanResults: AppDepsScanResultWithoutTarget[];
86 manifestFiles: ManifestFile[];
87 imageLabels?: { [key: string]: string };
88 imageCreationTime?: string;
89}
90
91export interface StaticPackagesAnalysis extends StaticAnalysis {
92 results: ImagePackagesAnalysis[];
93}
94
95export interface ArchiveResult {
96 imageName: ImageName;
97 path: string;
98 removeArchive(): void;
99}
100
101export interface ImageDetails {
102 hostname: string;
103 imageName: string;
104 tag: string;
105}
106
107export interface DestinationDir {
108 name: string;
109 removeCallback: () => void;
110}