first
This commit is contained in:
2
safekiso-server/node_modules/snyk/dist/lib/iac/assets/snyk-favicon.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/iac/assets/snyk-favicon.d.ts
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
safekiso-server/node_modules/snyk/dist/lib/iac/assets/snyk-logo.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/iac/assets/snyk-logo.d.ts
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
safekiso-server/node_modules/snyk/dist/lib/iac/constants.d.ts
generated
vendored
Normal file
17
safekiso-server/node_modules/snyk/dist/lib/iac/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ParserFileType } from '@snyk/cloud-config-parser';
|
||||
export type IacProjectTypes = 'k8sconfig' | 'terraformconfig' | 'cloudformationconfig' | 'armconfig' | 'customconfig' | 'multiiacconfig';
|
||||
export type IacFileTypes = ParserFileType | 'tf' | 'tfvars';
|
||||
export declare enum IacProjectType {
|
||||
K8S = "k8sconfig",
|
||||
TERRAFORM = "terraformconfig",
|
||||
CLOUDFORMATION = "cloudformationconfig",
|
||||
ARM = "armconfig",
|
||||
CUSTOM = "customconfig",
|
||||
MULTI_IAC = "multiiacconfig"
|
||||
}
|
||||
export declare const TEST_SUPPORTED_IAC_PROJECTS: IacProjectTypes[];
|
||||
export declare const iacRemediationTypes: {
|
||||
[k in IacProjectTypes]?: string;
|
||||
};
|
||||
export declare const IacV2Name = "IaC+";
|
||||
export declare const IacV2ShortLink = "https://snyk.co/iac+";
|
||||
7
safekiso-server/node_modules/snyk/dist/lib/iac/drift.d.ts
generated
vendored
Normal file
7
safekiso-server/node_modules/snyk/dist/lib/iac/drift.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { DescribeOptions, DriftAnalysis, DriftctlExecutionResult, GenDriftIgnoreOptions } from './types';
|
||||
import { Policy } from 'snyk-policy';
|
||||
export declare const parseDriftAnalysisResults: (input: string) => DriftAnalysis;
|
||||
export declare function driftignoreFromPolicy(policy: Policy | undefined): string[];
|
||||
export declare const updateExcludeInPolicy: (policy: Policy, analysis: DriftAnalysis, options: GenDriftIgnoreOptions) => void;
|
||||
export declare function processAnalysis(options: DescribeOptions, describe: DriftctlExecutionResult): Promise<string>;
|
||||
export declare function processHTMLOutput(options: DescribeOptions, stdout: string): string;
|
||||
17
safekiso-server/node_modules/snyk/dist/lib/iac/drift/driftctl.d.ts
generated
vendored
Normal file
17
safekiso-server/node_modules/snyk/dist/lib/iac/drift/driftctl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { DriftctlExecutionResult, DriftCTLOptions } from '../types';
|
||||
import * as child_process from 'child_process';
|
||||
import { StdioOptions } from 'child_process';
|
||||
export declare const DCTL_EXIT_CODES: {
|
||||
EXIT_IN_SYNC: number;
|
||||
EXIT_NOT_IN_SYNC: number;
|
||||
EXIT_ERROR: number;
|
||||
};
|
||||
export declare const driftctlVersion = "v0.40.0";
|
||||
export declare const generateArgs: (options: DriftCTLOptions, driftIgnore?: string[]) => Promise<string[]>;
|
||||
export declare function translateExitCode(exitCode: number | null): number;
|
||||
export declare const runDriftCTL: ({ options, driftIgnore, input, stdio, }: {
|
||||
options: DriftCTLOptions;
|
||||
driftIgnore?: string[] | undefined;
|
||||
input?: string | undefined;
|
||||
stdio?: child_process.StdioOptions | undefined;
|
||||
}) => Promise<DriftctlExecutionResult>;
|
||||
2
safekiso-server/node_modules/snyk/dist/lib/iac/drift/output.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/iac/drift/output.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { DescribeOptions, DriftAnalysis } from '../types';
|
||||
export declare function getHumanReadableAnalysis(option: DescribeOptions, analysis: DriftAnalysis): string;
|
||||
2
safekiso-server/node_modules/snyk/dist/lib/iac/env-utils.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/iac/env-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="node" />
|
||||
export declare function restoreEnvProxy(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
||||
5
safekiso-server/node_modules/snyk/dist/lib/iac/envelope-formatters.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/lib/iac/envelope-formatters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { IacShareResultsFormat, IaCTestFlags } from '../../cli/commands/test/iac/local-execution/types';
|
||||
import { ScanResult } from '../ecosystems/types';
|
||||
import { Policy } from 'snyk-policy';
|
||||
import { IacOutputMeta } from '../types';
|
||||
export declare function convertIacResultToScanResult(iacResult: IacShareResultsFormat, policy: Policy | undefined, meta: IacOutputMeta, options: IaCTestFlags): ScanResult;
|
||||
7
safekiso-server/node_modules/snyk/dist/lib/iac/file-utils.d.ts
generated
vendored
Normal file
7
safekiso-server/node_modules/snyk/dist/lib/iac/file-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
export declare function isExe(path: string): Promise<boolean>;
|
||||
export declare function isExists(path: string): Promise<boolean>;
|
||||
export declare function createDirIfNotExists(path: string): Promise<void>;
|
||||
export declare function isFile(path: string): Promise<boolean>;
|
||||
export declare function isArchive(path: string): Promise<boolean>;
|
||||
export declare function saveFile(dataBuffer: Buffer, savePath: string): Promise<void>;
|
||||
3
safekiso-server/node_modules/snyk/dist/lib/iac/git.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/lib/iac/git.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare function getRepositoryRootForPath(p: string): string;
|
||||
export declare function getRepositoryRoot(cwd?: string): string;
|
||||
export declare function getWorkingDirectoryForPath(p: string): string;
|
||||
9
safekiso-server/node_modules/snyk/dist/lib/iac/service-mappings.d.ts
generated
vendored
Normal file
9
safekiso-server/node_modules/snyk/dist/lib/iac/service-mappings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { CustomError } from '../errors';
|
||||
export declare const services2resources: Map<string, string[]>;
|
||||
export declare function verifyServiceMappingExists(services: string[]): void;
|
||||
export declare function findServiceMappingForType(type: string): string;
|
||||
export declare function createIgnorePattern(services: string[]): string;
|
||||
export declare function createIgnorePatternWithMap(services: string[], serviceMap: Map<string, Array<string>>): string;
|
||||
export declare class InvalidServiceError extends CustomError {
|
||||
constructor(msg: string);
|
||||
}
|
||||
7
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/iac-cloud-context.d.ts
generated
vendored
Normal file
7
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/iac-cloud-context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { TestOutput } from '../scan/results';
|
||||
import { IacAnalytics } from './index';
|
||||
type IacCloudContext = Pick<IacAnalytics, 'iacCloudContext' | 'iacCloudContextCloudProvider' | 'iacCloudContextSuppressedIssuesCount'>;
|
||||
export declare function getIacCloudContext(testConfig: {
|
||||
snykCloudEnvironment?: string;
|
||||
}, testOutput: TestOutput): IacCloudContext;
|
||||
export {};
|
||||
24
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/iac-type.d.ts
generated
vendored
Normal file
24
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/iac-type.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { SEVERITY } from '../../../../snyk-test/legacy';
|
||||
import { ResourceKind, TestOutput } from '../scan/results';
|
||||
export declare function getIacType(testOutput: TestOutput): IacType;
|
||||
export type PackageManager = ResourceKind;
|
||||
export type IacType = {
|
||||
[packageManager in PackageManager]?: {
|
||||
count: number;
|
||||
'resource-count': number;
|
||||
} & {
|
||||
[severity in SEVERITY]?: number;
|
||||
};
|
||||
};
|
||||
export type ResourcesCountByPackageManager = {
|
||||
[packageManager in PackageManager]?: number;
|
||||
};
|
||||
export type FilesCountByPackageManager = {
|
||||
[packageManager in PackageManager]?: number;
|
||||
};
|
||||
export type VulnerabilityAnalyticsByPackageManager = {
|
||||
[packageManager in PackageManager]?: VulnerabilityAnalitycs;
|
||||
};
|
||||
export type VulnerabilityAnalitycs = {
|
||||
[severity in SEVERITY]?: number;
|
||||
};
|
||||
18
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/index.d.ts
generated
vendored
Normal file
18
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/analytics/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ResourceKind, TestOutput } from '../scan/results';
|
||||
import { IacType } from './iac-type';
|
||||
export interface IacAnalytics {
|
||||
iacType: IacType;
|
||||
packageManager: ResourceKind[];
|
||||
iacIssuesCount: number;
|
||||
iacIgnoredIssuesCount: number;
|
||||
iacFilesCount: number;
|
||||
iacResourcesCount: number;
|
||||
iacErrorCodes: number[];
|
||||
iacTestBinaryVersion: string;
|
||||
iacCloudContext?: string;
|
||||
iacCloudContextCloudProvider?: string;
|
||||
iacCloudContextSuppressedIssuesCount: number;
|
||||
}
|
||||
export declare function addIacAnalytics(testConfig: {
|
||||
snykCloudEnvironment?: string;
|
||||
}, testOutput: TestOutput): void;
|
||||
12
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/errors.d.ts
generated
vendored
Normal file
12
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/errors.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CustomError } from '../../../errors';
|
||||
import { ScanError } from './scan/results';
|
||||
export declare function getErrorUserMessage(code: number, error: string): string;
|
||||
export declare class SnykIacTestError extends CustomError {
|
||||
fields: {
|
||||
path: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
constructor(scanError: ScanError);
|
||||
get path(): string;
|
||||
set path(path1: string);
|
||||
}
|
||||
4
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/index.d.ts
generated
vendored
Normal file
4
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { TestConfig } from './types';
|
||||
import { TestOutput } from './scan/results';
|
||||
export { TestConfig } from './types';
|
||||
export declare function test(testConfig: TestConfig): Promise<TestOutput>;
|
||||
90
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/json.d.ts
generated
vendored
Normal file
90
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/json.d.ts
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
import { TestOutput } from './scan/results';
|
||||
import { IacProjectType } from '../../constants';
|
||||
import { State } from './scan/policy-engine';
|
||||
import { IacTestError } from '../../../snyk-test/iac-test-result';
|
||||
export interface Result {
|
||||
meta: Meta;
|
||||
filesystemPolicy: false;
|
||||
vulnerabilities: [];
|
||||
dependencyCount: 0;
|
||||
licensesPolicy: null;
|
||||
ignoreSettings: IgnoreSettings;
|
||||
targetFile: string;
|
||||
projectName: string;
|
||||
org: string;
|
||||
policy: string;
|
||||
isPrivate: boolean;
|
||||
targetFilePath: string;
|
||||
packageManager: IacProjectType | State.InputTypeEnum;
|
||||
path: string;
|
||||
projectType: IacProjectType | State.InputTypeEnum;
|
||||
ok: boolean;
|
||||
infrastructureAsCodeIssues: IacIssue[];
|
||||
infrastructureAsCodeSuccesses?: IacSuccess[];
|
||||
error?: string;
|
||||
}
|
||||
export interface IgnoreSettings {
|
||||
adminOnly: boolean;
|
||||
reasonRequired: boolean;
|
||||
disregardFilesystemIgnores: boolean;
|
||||
}
|
||||
export interface Meta {
|
||||
isPrivate: boolean;
|
||||
isLicensesEnabled: boolean;
|
||||
ignoreSettings: IgnoreSettings;
|
||||
org: string;
|
||||
policy: string;
|
||||
}
|
||||
export interface IgnoreSettings {
|
||||
adminOnly: boolean;
|
||||
reasonRequired: boolean;
|
||||
disregardFilesystemIgnores: boolean;
|
||||
}
|
||||
export interface IacIssue {
|
||||
severity: string;
|
||||
resolve: string;
|
||||
impact: string;
|
||||
msg: string;
|
||||
remediation?: Remediation;
|
||||
subType: string;
|
||||
issue: string;
|
||||
publicId: string;
|
||||
title: string;
|
||||
references: string[];
|
||||
id: string;
|
||||
isIgnored: boolean;
|
||||
iacDescription: IacDescription;
|
||||
lineNumber: number;
|
||||
documentation?: string;
|
||||
isGeneratedByCustomRule: boolean;
|
||||
path: string[];
|
||||
policyEngineType?: string;
|
||||
type?: IacProjectType | State.InputTypeEnum;
|
||||
compliance?: string[][];
|
||||
description: string;
|
||||
}
|
||||
export interface IacSuccess {
|
||||
id: string;
|
||||
severity: string;
|
||||
type: IacProjectType | State.InputTypeEnum;
|
||||
subType: string;
|
||||
path: string[];
|
||||
msg: string;
|
||||
isIgnored: boolean;
|
||||
evidence?: string;
|
||||
}
|
||||
export interface Remediation {
|
||||
cloudformation?: string;
|
||||
terraform?: string;
|
||||
arm?: string;
|
||||
kubernetes?: string;
|
||||
}
|
||||
export interface IacDescription {
|
||||
issue: string;
|
||||
impact: string;
|
||||
resolve: string;
|
||||
}
|
||||
export declare function convertEngineToJsonResults({ results, projectName, }: {
|
||||
results: TestOutput;
|
||||
projectName: string;
|
||||
}): Array<Result | IacTestError>;
|
||||
8
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/index.d.ts
generated
vendored
Normal file
8
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { TestConfig } from '../types';
|
||||
interface LocalCache {
|
||||
policyEnginePath: string;
|
||||
rulesBundlePath: string;
|
||||
rulesClientURL: string;
|
||||
}
|
||||
export declare function initLocalCache(testConfig: TestConfig): Promise<LocalCache>;
|
||||
export {};
|
||||
9
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/constants/index.d.ts
generated
vendored
Normal file
9
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/constants/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* The Policy Engine release version associated with this Snyk CLI version.
|
||||
*/
|
||||
export declare const policyEngineReleaseVersion: string;
|
||||
/**
|
||||
* The Policy Engine executable's file name.
|
||||
*/
|
||||
export declare const policyEngineFileName: string;
|
||||
export declare const policyEngineChecksum: string;
|
||||
3
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/constants/utils.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/constants/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const policyEngineVersion: string;
|
||||
export declare function formatPolicyEngineFileName(releaseVersion: string): string;
|
||||
export declare function getChecksum(policyEngineFileName: string): string;
|
||||
10
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/download.d.ts
generated
vendored
Normal file
10
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/download.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CustomError } from '../../../../../errors';
|
||||
import { TestConfig } from '../../types';
|
||||
export declare function downloadPolicyEngine(testConfig: TestConfig): Promise<string>;
|
||||
export declare const policyEngineUrl: string;
|
||||
export declare class FailedToDownloadPolicyEngineError extends CustomError {
|
||||
constructor();
|
||||
}
|
||||
export declare class FailedToCachePolicyEngineError extends CustomError {
|
||||
constructor(savePath: string);
|
||||
}
|
||||
2
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/index.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { TestConfig } from '../../types';
|
||||
export declare function initPolicyEngine(testConfig: TestConfig): Promise<string>;
|
||||
6
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/lookup-local.d.ts
generated
vendored
Normal file
6
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/policy-engine/lookup-local.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { CustomError } from '../../../../../errors';
|
||||
import { TestConfig } from '../../types';
|
||||
export declare class InvalidUserPolicyEnginePathError extends CustomError {
|
||||
constructor(path: string, message?: string, userMessage?: string);
|
||||
}
|
||||
export declare function lookupLocalPolicyEngine(testConfig: TestConfig): Promise<string | undefined>;
|
||||
1
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/rules-bundle/constants.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/rules-bundle/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const rulesBundleName = "bundle-experimental.tar.gz";
|
||||
4
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/rules-bundle/index.d.ts
generated
vendored
Normal file
4
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/rules-bundle/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export declare function overrideDevelopmentPaths(): {
|
||||
rulesBundlePath: string;
|
||||
rulesClientURL: string;
|
||||
};
|
||||
7
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/utils.d.ts
generated
vendored
Normal file
7
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/local-cache/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
import { CustomError } from '../../../../errors';
|
||||
export declare function lookupLocal(iacCachePath: string, resourceName: string, userResourcePath: string | undefined, validResourceCondition: (path: string) => Promise<boolean>): Promise<string | undefined>;
|
||||
export declare class InvalidUserPathError extends CustomError {
|
||||
constructor(message: string);
|
||||
}
|
||||
export declare function fetchCacheResource(url: string): Promise<Buffer>;
|
||||
42
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/output.d.ts
generated
vendored
Normal file
42
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/output.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Ora } from 'ora';
|
||||
import { TestOutput } from './scan/results';
|
||||
import { TestCommandResult } from '../../../../cli/commands/types';
|
||||
import { CustomError, FormattedCustomError } from '../../../errors';
|
||||
import { SnykIacTestError } from './errors';
|
||||
export declare function buildOutput({ scanResult, testSpinner, options, iacNewEngine, }: {
|
||||
scanResult: TestOutput;
|
||||
testSpinner?: Ora;
|
||||
options: any;
|
||||
iacNewEngine?: boolean;
|
||||
}): TestCommandResult;
|
||||
interface ResponseData {
|
||||
response: string;
|
||||
json: string;
|
||||
sarif: string;
|
||||
}
|
||||
export declare class NoSuccessfulScansError extends FormattedCustomError {
|
||||
json: string | undefined;
|
||||
jsonStringifiedResults: string | undefined;
|
||||
sarifStringifiedResults: string | undefined;
|
||||
fields: {
|
||||
path: string;
|
||||
} & Record<string, string>;
|
||||
constructor(responseData: Omit<ResponseData, 'response'>, errors: SnykIacTestError[], options: {
|
||||
json?: boolean;
|
||||
sarif?: boolean;
|
||||
});
|
||||
get path(): string;
|
||||
set path(path1: string);
|
||||
}
|
||||
export declare class NoLoadableInputError extends NoSuccessfulScansError {
|
||||
constructor(responseData: Omit<ResponseData, 'response'>, errors: SnykIacTestError[], options: {
|
||||
json?: boolean;
|
||||
sarif?: boolean;
|
||||
});
|
||||
}
|
||||
export declare class FoundIssuesError extends CustomError {
|
||||
jsonStringifiedResults: string;
|
||||
sarifStringifiedResults: string;
|
||||
constructor(responseData: ResponseData);
|
||||
}
|
||||
export {};
|
||||
3
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/sarif.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/sarif.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as sarif from 'sarif';
|
||||
import { TestOutput } from './scan/results';
|
||||
export declare function convertEngineToSarifResults(scanResult: TestOutput): sarif.Log;
|
||||
5
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/index.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TestConfig } from '../types';
|
||||
import { TestOutput } from './results';
|
||||
export declare const systemCachePath: string;
|
||||
export declare function scan(options: TestConfig, policyEnginePath: string, rulesBundlePath: string, rulesClientURL: string): Promise<TestOutput>;
|
||||
export declare function getResultFromOutputFile(outputFilePath: string): Promise<TestOutput>;
|
||||
465
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/policy-engine.d.ts
generated
vendored
Normal file
465
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/policy-engine.d.ts
generated
vendored
Normal file
@@ -0,0 +1,465 @@
|
||||
/**
|
||||
* This is the top-level output from the Unified Policy Engine.
|
||||
* @export
|
||||
* @interface Results
|
||||
*/
|
||||
export interface Results {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Results
|
||||
*/
|
||||
format: Results.FormatEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Results
|
||||
*/
|
||||
formatVersion: Results.FormatVersionEnum;
|
||||
/**
|
||||
*
|
||||
* @type {Array<Result>}
|
||||
* @memberof Results
|
||||
*/
|
||||
results: Array<Result>;
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @namespace Results
|
||||
*/
|
||||
declare namespace Results {
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum FormatEnum {
|
||||
Results
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum FormatVersionEnum {
|
||||
_100
|
||||
}
|
||||
}
|
||||
/**
|
||||
* An object that relates an input with its rule results
|
||||
* @export
|
||||
* @interface Result
|
||||
*/
|
||||
interface Result {
|
||||
/**
|
||||
*
|
||||
* @type {State}
|
||||
* @memberof Result
|
||||
*/
|
||||
input: State;
|
||||
/**
|
||||
* An array of rule results objects
|
||||
* @type {Array<RuleResults>}
|
||||
* @memberof Result
|
||||
*/
|
||||
rule_results: Array<RuleResults>;
|
||||
}
|
||||
/**
|
||||
* The state format contains the state of all resources from some input. This format is intended to be used as both an input and output for the unified policy engine. It is also intended to support the visualizer and other downstream artifacts.
|
||||
* @export
|
||||
* @interface State
|
||||
*/
|
||||
interface State {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof State
|
||||
*/
|
||||
format: State.FormatEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof State
|
||||
*/
|
||||
formatVersion: State.FormatVersionEnum;
|
||||
/**
|
||||
* The type of input that this state was generated from. This value factors into which rules are run for this input.
|
||||
* @type {string}
|
||||
* @memberof State
|
||||
*/
|
||||
input_type: State.InputTypeEnum;
|
||||
/**
|
||||
* The type of environment that this state was generated from. This value factors into which rules are run for this input.
|
||||
* @type {string}
|
||||
* @memberof State
|
||||
*/
|
||||
environmentProvider: State.EnvironmentProviderEnum;
|
||||
/**
|
||||
* This object is intended to hold any input type-specific or environment-specific fields, e.g. account_id or filepath.
|
||||
* @type {{ [key: string]: ModelObject; }}
|
||||
* @memberof State
|
||||
*/
|
||||
meta?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Resources is a map of resource type to a map of a unique resource key to a resource object.
|
||||
* @type {{ [key: string]: { [key: string]: ResourceState; }; }}
|
||||
* @memberof State
|
||||
*/
|
||||
resources: {
|
||||
[key: string]: {
|
||||
[key: string]: ResourceState;
|
||||
};
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @namespace State
|
||||
*/
|
||||
export declare namespace State {
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum FormatEnum {
|
||||
State
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum FormatVersionEnum {
|
||||
_100
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum InputTypeEnum {
|
||||
TfHcl,
|
||||
TfPlan,
|
||||
CloudScan,
|
||||
Cfn,
|
||||
K8s,
|
||||
Arm
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum EnvironmentProviderEnum {
|
||||
Aws,
|
||||
Azure,
|
||||
Google,
|
||||
Iac
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The state of a single resource
|
||||
* @export
|
||||
* @interface ResourceState
|
||||
*/
|
||||
interface ResourceState {
|
||||
/**
|
||||
* The identifier of the object. This can be a natural ID. It is assumed that this ID is unique within the namespace.
|
||||
* @type {string}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The type of the resource.
|
||||
* @type {string}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
resourceType: string;
|
||||
/**
|
||||
* This field is a component of uniquely identifying a resource. It will resolve to different values depending on the input type and environment provider. For example, in a runtime AWS environment, this will be the region. For an IaC Terraform resource, this will be the module path. Customers of the API can set this to something that makes sense for them and parse it back.
|
||||
* @type {string}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
namespace: string;
|
||||
/**
|
||||
* Tags applied to the resource. Our goal is to extract tags into a uniform key->value format.
|
||||
* @type {{ [key: string]: string; }}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
tags?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* This object is intended to hold any input type-specific or environment-specific fields, e.g. provider, region, or source location.
|
||||
* @type {{ [key: string]: ModelObject; }}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
meta?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* A map of resource attributes.
|
||||
* @type {{ [key: string]: ModelObject; }}
|
||||
* @memberof ResourceState
|
||||
*/
|
||||
attributes: {
|
||||
[key: string]: RuleResultResourceAttribute;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Container for all results associated with a single rule
|
||||
* @export
|
||||
* @interface RuleResults
|
||||
*/
|
||||
export interface RuleResults {
|
||||
/**
|
||||
* The Rule ID, e.g. SNYK_00503 or 608f97c3-a11a-4154-a88e-a2fcd18c75b0
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The rule title
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* The platform describes the CSPs or other technology platform (e.g. Docker) that the rule checks for
|
||||
* @type {Array<string>}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
platform?: Array<string>;
|
||||
/**
|
||||
* The rule description
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* A markdown formatted string containing useful links
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
references?: string;
|
||||
/**
|
||||
* The category of the policy
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
category?: string;
|
||||
/**
|
||||
* An array of labels (value-less tags) associated with this policy
|
||||
* @type {Array<string>}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
labels?: Array<string>;
|
||||
/**
|
||||
* The service group of the primary resource associated with this policy (e.g. \"EBS\", \"EC2\")
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
serviceGroup?: string;
|
||||
/**
|
||||
* A map of rule set ID to a map of versions to a list of control IDs
|
||||
* @type {{ [key: string]: { [key: string]: Array<string>; }; }}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
controls?: {
|
||||
[key: string]: {
|
||||
[key: string]: Array<string>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* A list of resource types that the rule uses.
|
||||
* @type {Array<string>}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
resourceTypes?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<RuleResult>}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
results: Array<RuleResult>;
|
||||
/**
|
||||
* Any errors that occurred while evaluating this rule.
|
||||
* @type {Array<string>}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
errors?: Array<string>;
|
||||
/**
|
||||
* The Rego package name that defines the rule, useful for debugging
|
||||
* @type {string}
|
||||
* @memberof RuleResults
|
||||
*/
|
||||
_package?: string;
|
||||
}
|
||||
/**
|
||||
* A single rule result
|
||||
* @export
|
||||
* @interface RuleResult
|
||||
*/
|
||||
export interface RuleResult {
|
||||
/**
|
||||
* Whether or not this is a passing or failing result
|
||||
* @type {boolean}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
passed: boolean;
|
||||
/**
|
||||
* Whether or not this result is ignored
|
||||
* @type {boolean}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
ignored: boolean;
|
||||
/**
|
||||
* An optional message that can be returned by a rule
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
message?: string;
|
||||
/**
|
||||
* The ID of the primary resource (if any) associated with this result
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
resourceId?: string;
|
||||
/**
|
||||
* The namespace of the primary resource (if any) associated with this result
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
resourceNamespace?: string;
|
||||
/**
|
||||
* The type of resource (if any) associated with this result. This will typically be used with \"missing resource\" rules.
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
resourceType?: string;
|
||||
/**
|
||||
* A Markdown-formatted set of remediation steps to resolve the issue identified by the rule
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
remediation?: string;
|
||||
/**
|
||||
* The severity of this rule result
|
||||
* @type {string}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
severity?: RuleResult.SeverityEnum;
|
||||
/**
|
||||
* An arbitrary key-value map that a rule can return in its result.
|
||||
* @type {{ [key: string]: ModelObject; }}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
context?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* A resource objects associated with this result.
|
||||
* @type {Array<RuleResultResource>}
|
||||
* @memberof RuleResult
|
||||
*/
|
||||
resources?: Array<RuleResultResource>;
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @namespace RuleResult
|
||||
*/
|
||||
declare namespace RuleResult {
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
enum SeverityEnum {
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
Critical
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Identifying information for a resource and attributes associated with a rule result
|
||||
* @export
|
||||
* @interface RuleResultResource
|
||||
*/
|
||||
interface RuleResultResource {
|
||||
/**
|
||||
* The ID of this resource
|
||||
* @type {string}
|
||||
* @memberof RuleResultResource
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The type of this resource
|
||||
* @type {string}
|
||||
* @memberof RuleResultResource
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* The namespace of this resource
|
||||
* @type {string}
|
||||
* @memberof RuleResultResource
|
||||
*/
|
||||
namespace?: string;
|
||||
/**
|
||||
*
|
||||
* @type {SourceLocationStack}
|
||||
* @memberof RuleResultResource
|
||||
*/
|
||||
location?: SourceLocationStack;
|
||||
/**
|
||||
* Attributes of the resource that were associated with a rule result.
|
||||
* @type {Array<RuleResultResourceAttribute>}
|
||||
* @memberof RuleResultResource
|
||||
*/
|
||||
attributes?: Array<RuleResultResourceAttribute>;
|
||||
}
|
||||
/**
|
||||
* Points to a row and column within a source file
|
||||
* @export
|
||||
* @interface SourceLocation
|
||||
*/
|
||||
interface SourceLocation {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SourceLocation
|
||||
*/
|
||||
filepath?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SourceLocation
|
||||
*/
|
||||
line?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SourceLocation
|
||||
*/
|
||||
column?: number;
|
||||
}
|
||||
/**
|
||||
* A stack of source locations. It's useful to represent locations this way for IaC types that allow users to import modules or other groups of resources, because we can point to where a resource definition is as well as how it was imported into the top-level module.
|
||||
* @export
|
||||
*/
|
||||
type SourceLocationStack = Array<SourceLocation>;
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RuleResultResourceAttribute
|
||||
*/
|
||||
interface RuleResultResourceAttribute {
|
||||
/**
|
||||
* The path to an attribute associated with this resource and rule result
|
||||
* @type {Array<string | number>}
|
||||
* @memberof RuleResultResourceAttribute
|
||||
*/
|
||||
path?: Array<string | number>;
|
||||
/**
|
||||
*
|
||||
* @type {SourceLocation}
|
||||
* @memberof RuleResultResourceAttribute
|
||||
*/
|
||||
location?: SourceLocation;
|
||||
}
|
||||
export {};
|
||||
80
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/results.d.ts
generated
vendored
Normal file
80
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/scan/results.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { SEVERITY } from '../../../../snyk-test/common';
|
||||
import { IacProjectType } from '../../../constants';
|
||||
import { SnykIacTestError } from '../errors';
|
||||
import * as PolicyEngineTypes from './policy-engine';
|
||||
export declare function mapSnykIacTestOutputToTestOutput(snykIacOutput: SnykIacTestOutput): TestOutput;
|
||||
export interface TestOutput {
|
||||
results?: Results;
|
||||
errors?: SnykIacTestError[];
|
||||
warnings?: SnykIacTestError[];
|
||||
settings: Settings;
|
||||
}
|
||||
export interface SnykIacTestOutput {
|
||||
results?: Results;
|
||||
rawResults?: PolicyEngineTypes.Results;
|
||||
errors?: ScanError[];
|
||||
warnings?: ScanError[];
|
||||
settings: Settings;
|
||||
}
|
||||
export interface Results {
|
||||
resources?: Resource[];
|
||||
vulnerabilities?: Vulnerability[];
|
||||
passedVulnerabilities?: Vulnerability[];
|
||||
metadata: Metadata;
|
||||
scanAnalytics: ScanAnalytics;
|
||||
}
|
||||
export interface Metadata {
|
||||
projectName: string;
|
||||
projectPublicId: string;
|
||||
ignoredCount: number;
|
||||
}
|
||||
export interface Settings {
|
||||
org: string;
|
||||
ignoreSettings: IgnoreSettings;
|
||||
}
|
||||
export interface IgnoreSettings {
|
||||
adminOnly: boolean;
|
||||
disregardFilesystemIgnores: boolean;
|
||||
reasonRequired: boolean;
|
||||
}
|
||||
export interface ScanAnalytics {
|
||||
suppressedResults?: Record<string, string[]>;
|
||||
ignoredCount: number;
|
||||
}
|
||||
export interface Vulnerability {
|
||||
rule: Rule;
|
||||
message: string;
|
||||
remediation: string;
|
||||
severity: SEVERITY;
|
||||
ignored: boolean;
|
||||
resource: Resource;
|
||||
context?: {
|
||||
evidence?: string;
|
||||
};
|
||||
}
|
||||
export interface Rule {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
references?: string;
|
||||
labels?: string[];
|
||||
category?: string;
|
||||
documentation?: string;
|
||||
isGeneratedByCustomRule?: boolean;
|
||||
}
|
||||
export interface Resource {
|
||||
id: string;
|
||||
type: string;
|
||||
kind: ResourceKind;
|
||||
formattedPath: string;
|
||||
path?: any[];
|
||||
file?: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
}
|
||||
export type ResourceKind = IacProjectType | PolicyEngineTypes.State.InputTypeEnum;
|
||||
export interface ScanError {
|
||||
message: string;
|
||||
code: number;
|
||||
fields?: Record<string, string>;
|
||||
}
|
||||
24
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/types.d.ts
generated
vendored
Normal file
24
safekiso-server/node_modules/snyk/dist/lib/iac/test/v2/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { SEVERITY } from '../../../snyk-test/legacy';
|
||||
export interface TestConfig {
|
||||
paths: string[];
|
||||
iacCachePath: string;
|
||||
userRulesBundlePath?: string;
|
||||
userPolicyEnginePath?: string;
|
||||
userRulesClientURL?: string;
|
||||
report: boolean;
|
||||
severityThreshold?: SEVERITY;
|
||||
targetReference?: string;
|
||||
targetName?: string;
|
||||
remoteRepoUrl?: string;
|
||||
policy?: string;
|
||||
scan: string;
|
||||
varFile?: string;
|
||||
depthDetection?: number;
|
||||
snykCloudEnvironment?: string;
|
||||
insecure?: boolean;
|
||||
org?: string;
|
||||
customRules?: boolean;
|
||||
experimental?: boolean;
|
||||
iacNewEngine?: boolean;
|
||||
iacTestOutputFile?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user