1 | import { ImageName } from "../extractor/image";
|
2 | import { AutoDetectedUserInstructions, ManifestFile } from "../types";
|
3 | import {
|
4 | AppDepsScanResultWithoutTarget,
|
5 | JarCoords,
|
6 | } from "./applications/types";
|
7 |
|
8 | export 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 | }
|
20 | export interface AnalyzedPackageWithVersion extends AnalyzedPackage {
|
21 | Version: string;
|
22 | }
|
23 |
|
24 | export interface DockerInspectOutput {
|
25 | Id: string;
|
26 | Architecture: string;
|
27 | RootFS: {
|
28 | Type: string;
|
29 | Layers: string[];
|
30 | };
|
31 | }
|
32 |
|
33 | export interface ImageAnalysis {
|
34 | Image: string;
|
35 | AnalyzeType: AnalysisType;
|
36 | Analysis: AnalyzedPackage[] | Binary[];
|
37 | }
|
38 |
|
39 | export interface ImagePackagesAnalysis extends ImageAnalysis {
|
40 | AnalyzeType: Exclude<AnalysisType, AnalysisType.Binaries>;
|
41 | Analysis: AnalyzedPackageWithVersion[];
|
42 | }
|
43 |
|
44 | export enum AnalysisType {
|
45 | Apk = "Apk",
|
46 | Apt = "Apt",
|
47 | Rpm = "Rpm",
|
48 | Binaries = "binaries",
|
49 | Linux = "linux",
|
50 | }
|
51 |
|
52 | export interface OSRelease {
|
53 | name: string;
|
54 | version: string;
|
55 | prettyName: string;
|
56 | }
|
57 |
|
58 | export interface Binary {
|
59 | name: string;
|
60 | version: string;
|
61 | }
|
62 |
|
63 | export interface IAptFiles {
|
64 | dpkgFile: string;
|
65 | extFile: string;
|
66 | }
|
67 |
|
68 | export interface JarFingerprint {
|
69 | location: string;
|
70 | digest: string | null;
|
71 | parentName?: string;
|
72 | name?: string;
|
73 | version?: string;
|
74 | dependencies: JarCoords[];
|
75 | }
|
76 | export 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 |
|
91 | export interface StaticPackagesAnalysis extends StaticAnalysis {
|
92 | results: ImagePackagesAnalysis[];
|
93 | }
|
94 |
|
95 | export interface ArchiveResult {
|
96 | imageName: ImageName;
|
97 | path: string;
|
98 | removeArchive(): void;
|
99 | }
|
100 |
|
101 | export interface ImageDetails {
|
102 | hostname: string;
|
103 | imageName: string;
|
104 | tag: string;
|
105 | }
|
106 |
|
107 | export interface DestinationDir {
|
108 | name: string;
|
109 | removeCallback: () => void;
|
110 | }
|