From 1fcc148381a9c7838618ef28207788bf364c88ea Mon Sep 17 00:00:00 2001 From: maksadbek Date: Tue, 3 Dec 2024 15:43:10 +0100 Subject: [PATCH 1/8] fix(github-actions): remove redundant config-manager and clean-all (#626) `dnf clean all` command is causing the following error: ``` Updating Subscription Management repositories. Unable to read consumer identity This system is not registered with an entitlement server. You can use subscription-manager to register. 0 files removed ``` let's remove this command for time being and unblock the pipeline --- .github/workflows/deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9be7ca95..9c6a63b2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -98,10 +98,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu') run: | dnf install -y dnf-utils \ - && dnf config-manager --enable ubi-8-appstream \ - && dnf config-manager --enable ubi-8-baseos \ && dnf install -y python3 gcc gcc-c++ make \ - && dnf clean all \ && rm -rf /var/cache/dnf - name: Install deps From a4a690ddd63d3a2d8d628eecb2b7b2b0f82717e6 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 3 Dec 2024 14:43:38 +0000 Subject: [PATCH 2/8] chore(release): cut the 13.0.0-next.9 release [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f49c917..f0a30b23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.8", + "version": "13.0.0-next.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@brightsec/cli", - "version": "13.0.0-next.8", + "version": "13.0.0-next.9", "license": "MIT", "dependencies": { "@neuralegion/os-service": "^1.2.6", diff --git a/package.json b/package.json index 0e5c843d..f34e7258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.8", + "version": "13.0.0-next.9", "private": false, "repository": { "type": "git", From 8010670b969826daf2246b18192535e9d2da8626 Mon Sep 17 00:00:00 2001 From: Ruslan Panamarenka Date: Tue, 3 Dec 2024 17:06:44 +0100 Subject: [PATCH 3/8] feat: add commands to control discoveries (#621) Add commands to control discoveries: - `discovery:run [options]` to start a new discovery for the received configuration. - `discovery:stop [options] ` to stop a discovery by id. - `discovery:rerun [options] ` to request to start a new discovery using the same configuration as an existing discovery, by discovery ID. --------- Co-authored-by: Or Rubin --- src/Commands/RerunDiscovery.ts | 69 ++++++++++++ src/Commands/RunDiscovery.ts | 156 +++++++++++++++++++++++++++ src/Commands/StopDiscovery.ts | 64 +++++++++++ src/Discovery/Discoveries.ts | 77 ++++++++++++++ src/Discovery/RestDiscoveries.ts | 176 +++++++++++++++++++++++++++++++ src/Discovery/index.ts | 2 + src/container.ts | 6 ++ src/index.ts | 6 ++ 8 files changed, 556 insertions(+) create mode 100644 src/Commands/RerunDiscovery.ts create mode 100644 src/Commands/RunDiscovery.ts create mode 100644 src/Commands/StopDiscovery.ts create mode 100644 src/Discovery/Discoveries.ts create mode 100644 src/Discovery/RestDiscoveries.ts create mode 100644 src/Discovery/index.ts diff --git a/src/Commands/RerunDiscovery.ts b/src/Commands/RerunDiscovery.ts new file mode 100644 index 00000000..43d394a8 --- /dev/null +++ b/src/Commands/RerunDiscovery.ts @@ -0,0 +1,69 @@ +import { Discoveries, RestDiscoveryOptions } from 'src/Discovery'; +import { ErrorMessageFactory, logger } from 'src/Utils'; +import { container } from 'tsyringe'; +import { Arguments, Argv, CommandModule } from 'yargs'; + +export class RerunDiscovery implements CommandModule { + public readonly command = 'discovery:rerun [options] '; + public readonly describe = + 'Request to start a new discovery using the same configuration as an existing discovery, by discovery ID.'; + + public builder(argv: Argv): Argv { + return argv + .option('token', { + alias: 't', + describe: 'Bright API-key', + string: true, + requiresArg: true, + demandOption: true + }) + .positional('discoveryId', { + describe: 'ID of an existing discovery which you want to re-run.', + requiresArg: true, + demandOption: true, + type: 'string' + }) + .option('project', { + alias: 'p', + describe: 'ID of the project', + string: true, + requiresArg: true, + demandOption: true + }) + .middleware((args: Arguments) => + container.register(RestDiscoveryOptions, { + useValue: { + insecure: args.insecure as boolean, + baseURL: args.api as string, + apiKey: args.token as string, + proxyURL: (args.proxyBright ?? args.proxy) as string, + timeout: args.timeout as number + } + }) + ); + } + + public async handler(args: any): Promise { + try { + const discoveryManager: Discoveries = container.resolve(Discoveries); + const projectId = args.project as string; + const discoveryId = args.discoveryId as string; + const newDiscoveryId = await discoveryManager.rerun( + projectId, + discoveryId + ); + + // eslint-disable-next-line no-console + console.log(newDiscoveryId); + process.exit(0); + } catch (error) { + logger.error( + ErrorMessageFactory.genericCommandError({ + error, + command: 'discovery:rerun' + }) + ); + process.exit(1); + } + } +} diff --git a/src/Commands/RunDiscovery.ts b/src/Commands/RunDiscovery.ts new file mode 100644 index 00000000..b0536db4 --- /dev/null +++ b/src/Commands/RunDiscovery.ts @@ -0,0 +1,156 @@ +import { Discoveries, DiscoveryConfig } from '../Discovery'; +import { ErrorMessageFactory, logger } from '../Utils'; +import { RestDiscoveryOptions } from 'src/Discovery/RestDiscoveries'; +import { container } from 'tsyringe'; +import { Arguments, Argv, CommandModule } from 'yargs'; + +export class RunDiscovery implements CommandModule { + public readonly command = 'discovery:run [options]'; + public readonly describe = + 'Start a new discovery for the received configuration.'; + + public builder(argv: Argv): Argv { + return argv + .option('token', { + alias: 't', + describe: 'Bright API-key', + string: true, + requiresArg: true, + demandOption: true + }) + .option('project', { + alias: 'p', + describe: 'ID of the project', + string: true, + requiresArg: true, + demandOption: true + }) + .option('name', { + alias: 'n', + describe: 'Name of the discovery.', + string: true, + requiresArg: true, + demandOption: true + }) + .option('auth', { + alias: 'o', + describe: 'Auth object ID.', + string: true, + requiresArg: true + }) + .option('repeater', { + alias: 'agent', + requiresArg: true, + array: true, + describe: 'ID of any repeaters connected with the discovery.' + }) + .option('archive', { + alias: 'a', + normalize: true, + requiresArg: true, + describe: + "A collection of your app's http/websockets logs into HAR file. " + + 'Usually you can use browser dev tools or our browser web extension' + }) + .option('crawler', { + alias: 'c', + requiresArg: true, + array: true, + describe: + 'A list of specific urls that should be included into crawler.', + demandOption: true + }) + .option('host-filter', { + alias: 'F', + requiresArg: true, + array: true, + describe: 'A list of specific hosts that should be included into scan.' + }) + .option('header', { + alias: 'H', + requiresArg: true, + array: true, + describe: + 'A list of specific headers that should be included into request.' + }) + .option('smart', { + boolean: true, + describe: + 'Use automatic smart decisions such as: parameter skipping, detection phases, etc. to minimize scan time.' + }) + .option('crawl-parent-subdomains', { + boolean: true, + describe: 'Crawl parent path folders and subdomains', + default: false + }) + .option('concurrency', { + number: true, + default: 10, + describe: + 'Number of maximum concurrent requests allowed to be sent to the target, can range between 1 to 50 (default: 10).', + requiresArg: true + }) + .option('interactions-depth', { + number: true, + default: 3, + describe: + 'Number of maximum interactions with nested objects, can range between 1 to 5 (default: 3).', + requiresArg: true + }) + .middleware((args: Arguments) => + container.register(RestDiscoveryOptions, { + useValue: { + insecure: args.insecure as boolean, + baseURL: args.api as string, + apiKey: args.token as string, + proxyURL: (args.proxyBright ?? args.proxy) as string, + timeout: args.timeout as number + } + }) + ); + } + + public async handler(args: Arguments): Promise { + try { + const discoveryManager: Discoveries = container.resolve(Discoveries); + + const projectId = args.project as string; + + const { id: discoveryId, warnings } = await discoveryManager.create( + projectId, + { + name: args.name, + authObjectId: args.auth, + hostsFilter: args.hostFilter, + crawlerUrls: args.crawler, + fileId: args.archive, + repeaters: args.repeater, + optimizedCrawler: args.smart, + poolSize: args.concurrency, + maxInteractionsChainLength: args.interactionsDepth, + subdomainsCrawl: args.crawlParentSubdomains, + headers: args.header + } as DiscoveryConfig + ); + + // eslint-disable-next-line no-console + console.log(discoveryId); + + if (warnings?.length) { + logger.warn( + `${warnings.map((warning) => warning.message).join('\n')}\n` + ); + } + + process.exit(0); + } catch (error) { + logger.error( + ErrorMessageFactory.genericCommandError({ + error, + command: 'discovery:run' + }) + ); + process.exit(1); + } + } +} diff --git a/src/Commands/StopDiscovery.ts b/src/Commands/StopDiscovery.ts new file mode 100644 index 00000000..95d7a604 --- /dev/null +++ b/src/Commands/StopDiscovery.ts @@ -0,0 +1,64 @@ +import { Discoveries, RestDiscoveryOptions } from '../Discovery'; +import { ErrorMessageFactory, logger } from '../Utils'; +import { container } from 'tsyringe'; +import { Arguments, Argv, CommandModule } from 'yargs'; + +export class StopDiscovery implements CommandModule { + public readonly command = 'discovery:stop [options] '; + public readonly describe = 'Stop discovery by id.'; + + public builder(argv: Argv): Argv { + return argv + .option('token', { + alias: 't', + describe: 'Bright API-key', + string: true, + requiresArg: true, + demandOption: true + }) + .option('project', { + alias: 'p', + requiresArg: true, + string: true, + describe: 'ID of the project', + demandOption: true + }) + .positional('discoveryId', { + describe: 'ID of an existing discovery which you want to stop.', + requiresArg: true, + demandOption: true, + type: 'string' + }) + .middleware((args: Arguments) => + container.register(RestDiscoveryOptions, { + useValue: { + insecure: args.insecure as boolean, + baseURL: args.api as string, + apiKey: args.token as string, + proxyURL: (args.proxyBright ?? args.proxy) as string, + timeout: args.timeout as number + } + }) + ); + } + + public async handler(args: Arguments): Promise { + try { + const discoveryManager: Discoveries = container.resolve(Discoveries); + + await discoveryManager.stop( + args.project as string, + args.discoveryId as string + ); + process.exit(0); + } catch (error) { + logger.error( + ErrorMessageFactory.genericCommandError({ + error, + command: 'discovery:stop' + }) + ); + process.exit(1); + } + } +} diff --git a/src/Discovery/Discoveries.ts b/src/Discovery/Discoveries.ts new file mode 100644 index 00000000..b491570b --- /dev/null +++ b/src/Discovery/Discoveries.ts @@ -0,0 +1,77 @@ +export interface DiscoveryConfig { + name: string; + authObjectId?: string; + poolSize?: number; + crawlerUrls?: string[]; + extraHosts?: Record; + headers?: Record | Header[]; + fileId?: string; + targetId?: string; + hostsFilter?: string[]; + optimizedCrawler?: boolean; + maxInteractionsChainLength: number; + subdomainsCrawl: boolean; + exclusions?: Exclusions; + repeaters?: string[]; + discoveryTypes?: DiscoveryType[]; + targetTimeout: number; +} + +export interface Header { + name: string; + value: string; + mergeStrategy: 'replace'; +} + +export interface Discoveries { + create( + projectId: string, + config: DiscoveryConfig + ): Promise; + + rerun(projectId: string, discoveryId: string): Promise; + + stop(projectId: string, discoveryId: string): Promise; + + delete(projectId: string, discoveryId: string): Promise; +} + +export const Discoveries: unique symbol = Symbol('Discoveries'); + +export interface DiscoveryWarning { + code: string; + message: string; +} + +export interface DiscoveryCreateResponse { + id: string; + warnings?: DiscoveryWarning[]; +} + +export enum DiscoveryType { + CRAWLER = 'crawler', + ARCHIVE = 'archive', + OAS = 'oas' +} + +export interface RequestExclusion { + patterns: string[]; + methods: string[]; +} + +export interface Exclusions { + params: string[]; + requests: RequestExclusion[]; +} + +export interface StorageFile { + id: string; + type: SourceType; +} + +export enum SourceType { + OPEN_API = 'openapi', + RAML = 'raml', + POSTMAN = 'postman', + HAR = 'har' +} diff --git a/src/Discovery/RestDiscoveries.ts b/src/Discovery/RestDiscoveries.ts new file mode 100644 index 00000000..5ee1efb0 --- /dev/null +++ b/src/Discovery/RestDiscoveries.ts @@ -0,0 +1,176 @@ +import { + Discoveries, + DiscoveryConfig, + DiscoveryCreateResponse, + DiscoveryType, + Header, + SourceType, + StorageFile +} from './Discoveries'; +import { ProxyFactory } from '../Utils'; +import { CliInfo } from '../Config'; +import { delay, inject, injectable } from 'tsyringe'; +import axios, { Axios } from 'axios'; +import http from 'node:http'; +import https from 'node:https'; + +export interface RestDiscoveryOptions { + baseURL: string; + apiKey: string; + timeout?: number; + insecure?: boolean; + proxyURL?: string; + proxyDomains?: string[]; +} + +export const RestDiscoveryOptions: unique symbol = Symbol( + 'RestDiscoveryOptions' +); + +@injectable() +export class RestDiscoveries implements Discoveries { + private readonly client: Axios; + + constructor( + @inject(delay(() => CliInfo)) private readonly info: CliInfo, + @inject(ProxyFactory) private readonly proxyFactory: ProxyFactory, + @inject(RestDiscoveryOptions) + { baseURL, apiKey, timeout, insecure, proxyURL }: RestDiscoveryOptions + ) { + const { + httpAgent = new http.Agent(), + httpsAgent = new https.Agent({ rejectUnauthorized: !insecure }) + } = proxyURL + ? this.proxyFactory.createProxy({ + proxyUrl: proxyURL, + rejectUnauthorized: !insecure + }) + : {}; + + this.client = axios.create({ + baseURL, + timeout, + httpAgent, + httpsAgent, + responseType: 'json', + headers: { authorization: `Api-Key ${apiKey}` } + }); + } + + public async create( + projectId: string, + config: DiscoveryConfig + ): Promise { + const preparedConfig = await this.prepareConfig({ ...config }); + const res = await this.client.post( + `/api/v2/projects/${projectId}/discoveries`, + preparedConfig + ); + + return res.data; + } + + public async rerun(projectId: string, discoveryId: string): Promise { + const res = await this.client.post<{ id: string }>( + `/api/v2/projects/${projectId}/discoveries/${discoveryId}/rerun` + ); + + return res.data.id; + } + + public async stop(projectId: string, discoveryId: string): Promise { + await this.client.put( + `/api/v2/projects/${projectId}/discoveries/${discoveryId}/lifecycle`, + { + action: 'stop' + } + ); + } + + public async delete(projectId: string, discoveryId: string): Promise { + await this.client.delete( + `/api/v2/projects/${projectId}/discoveries/${discoveryId}` + ); + } + + private async prepareConfig({ headers, ...rest }: DiscoveryConfig): Promise< + Omit & { + headers: Header[]; + info: { + source: string; + client?: { name: string; version: string }; + }; + } + > { + const config = await this.applyDefaultSettings(rest); + + return { + ...config, + info: { + source: 'cli', + client: { + name: 'bright-cli', + version: this.info.version + } + }, + headers: headers + ? Object.entries(headers).map(([name, value]: [string, string]) => ({ + name, + value, + mergeStrategy: 'replace' + })) + : undefined + }; + } + + private async applyDefaultSettings( + discoveryConfig: Omit + ): Promise> { + const exclusions = + discoveryConfig.exclusions?.params || discoveryConfig.exclusions?.requests + ? discoveryConfig.exclusions + : undefined; + + let discoveryTypes: DiscoveryType[] = await this.exploreDiscovery( + discoveryConfig + ); + discoveryTypes = discoveryTypes?.length ? discoveryTypes : undefined; + + return { + ...discoveryConfig, + discoveryTypes, + exclusions + }; + } + + private async exploreDiscovery( + body: DiscoveryConfig + ): Promise { + const discoveryTypes: DiscoveryType[] = []; + const { fileId, crawlerUrls } = body; + + if (Array.isArray(crawlerUrls)) { + discoveryTypes.push(DiscoveryType.CRAWLER); + } + + if (fileId) { + try { + const { data } = await this.client.get( + `/api/v2/files/${fileId}` + ); + + discoveryTypes.push( + data.type === SourceType.HAR + ? DiscoveryType.ARCHIVE + : DiscoveryType.OAS + ); + } catch (error) { + throw new Error( + `Error loading file with id "${fileId}": No such file or you do not have permissions.` + ); + } + } + + return discoveryTypes; + } +} diff --git a/src/Discovery/index.ts b/src/Discovery/index.ts new file mode 100644 index 00000000..35cbb1f5 --- /dev/null +++ b/src/Discovery/index.ts @@ -0,0 +1,2 @@ +export * from './Discoveries'; +export * from './RestDiscoveries'; diff --git a/src/container.ts b/src/container.ts index 95e06186..b75a761a 100644 --- a/src/container.ts +++ b/src/container.ts @@ -56,6 +56,7 @@ import { ServerRepeaterLauncher } from './Repeater'; import { ProxyFactory, DefaultProxyFactory } from './Utils'; +import { Discoveries, RestDiscoveries } from './Discovery'; import { container, Lifecycle } from 'tsyringe'; container @@ -167,6 +168,11 @@ container { lifecycle: Lifecycle.Singleton } ) .register(Scans, { useClass: RestScans }, { lifecycle: Lifecycle.Singleton }) + .register( + Discoveries, + { useClass: RestDiscoveries }, + { lifecycle: Lifecycle.Singleton } + ) .register( EntryPoints, { useClass: RestEntryPoints }, diff --git a/src/index.ts b/src/index.ts index fb214979..63b2da73 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,9 @@ import { } from './Commands'; import { CliBuilder } from './Config'; import container from './container'; +import { RunDiscovery } from './Commands/RunDiscovery'; +import { StopDiscovery } from './Commands/StopDiscovery'; +import { RerunDiscovery } from './Commands/RerunDiscovery'; container.resolve(CliBuilder).build({ commands: [ @@ -25,6 +28,9 @@ container.resolve(CliBuilder).build({ new RunScan(), new RetestScan(), new StopScan(), + new RunDiscovery(), + new StopDiscovery(), + new RerunDiscovery(), new UploadArchive(), new Configure(), new GetEntryPoints() From bea99f50edeb43df29d30ce4f6043ad5311e1e86 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 3 Dec 2024 16:07:18 +0000 Subject: [PATCH 4/8] chore(release): cut the 13.0.0-next.10 release [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0a30b23..0bd5c9b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.9", + "version": "13.0.0-next.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@brightsec/cli", - "version": "13.0.0-next.9", + "version": "13.0.0-next.10", "license": "MIT", "dependencies": { "@neuralegion/os-service": "^1.2.6", diff --git a/package.json b/package.json index f34e7258..786b2a6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.9", + "version": "13.0.0-next.10", "private": false, "repository": { "type": "git", From e30ed72c800f486c6b0f8b392184b038314b9e71 Mon Sep 17 00:00:00 2001 From: Ruslan Panamarenka Date: Wed, 4 Dec 2024 10:06:56 +0100 Subject: [PATCH 5/8] feat: rename scan parameter to scanId (#627) --- src/Commands/PollingScanStatus.ts | 6 +++--- src/Commands/RetestScan.ts | 6 +++--- src/Commands/StopScan.ts | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Commands/PollingScanStatus.ts b/src/Commands/PollingScanStatus.ts index d8ddd72d..486c5b8a 100644 --- a/src/Commands/PollingScanStatus.ts +++ b/src/Commands/PollingScanStatus.ts @@ -9,7 +9,7 @@ import { Arguments, Argv, CommandModule } from 'yargs'; import { container } from 'tsyringe'; export class PollingScanStatus implements CommandModule { - public readonly command = 'scan:polling [options] '; + public readonly command = 'scan:polling [options] '; public readonly describe = 'Allows to configure a polling of scan status.'; public builder(argv: Argv): Argv { @@ -42,7 +42,7 @@ export class PollingScanStatus implements CommandModule { requiresArg: true, default: BreakpointType.ANY }) - .positional('scan', { + .positional('scanId', { describe: 'ID of an existing scan which you want to check.', type: 'string', demandOption: true @@ -64,7 +64,7 @@ export class PollingScanStatus implements CommandModule { try { const pollingFactory = container.resolve(PollingFactory); const polling = pollingFactory.create({ - scanId: args.scan as string, + scanId: args.scanId as string, timeout: args.timeout as number, interval: args.interval as number, breakpoint: args.breakpoint as BreakpointType diff --git a/src/Commands/RetestScan.ts b/src/Commands/RetestScan.ts index c759a7e4..fc88492f 100644 --- a/src/Commands/RetestScan.ts +++ b/src/Commands/RetestScan.ts @@ -4,7 +4,7 @@ import { Arguments, Argv, CommandModule } from 'yargs'; import { container } from 'tsyringe'; export class RetestScan implements CommandModule { - public readonly command = 'scan:retest [options] '; + public readonly command = 'scan:retest [options] '; public readonly describe = 'Request to start a new scan using the same configuration as an existing scan, by scan ID.'; @@ -16,7 +16,7 @@ export class RetestScan implements CommandModule { requiresArg: true, demandOption: true }) - .positional('scan', { + .positional('scanId', { describe: 'ID of an existing scan which you want to re-run.', type: 'string', demandOption: true @@ -37,7 +37,7 @@ export class RetestScan implements CommandModule { public async handler(args: Arguments): Promise { try { const scanManager: Scans = container.resolve(Scans); - const scanId: string = await scanManager.retest(args.scan as string); + const scanId: string = await scanManager.retest(args.scanId as string); // eslint-disable-next-line no-console console.log(scanId); diff --git a/src/Commands/StopScan.ts b/src/Commands/StopScan.ts index 16cee97b..63d4da4b 100644 --- a/src/Commands/StopScan.ts +++ b/src/Commands/StopScan.ts @@ -4,7 +4,7 @@ import { Arguments, Argv, CommandModule } from 'yargs'; import { container } from 'tsyringe'; export class StopScan implements CommandModule { - public readonly command = 'scan:stop [options] '; + public readonly command = 'scan:stop [options] '; public readonly describe = 'Stop scan by id.'; public builder(argv: Argv): Argv { @@ -15,7 +15,7 @@ export class StopScan implements CommandModule { requiresArg: true, demandOption: true }) - .positional('scan', { + .positional('scanId', { describe: 'ID of an existing scan which you want to stop.', requiresArg: true, demandOption: true, @@ -38,7 +38,7 @@ export class StopScan implements CommandModule { try { const scanManager: Scans = container.resolve(Scans); - await scanManager.stop(args.scan as string); + await scanManager.stop(args.scanId as string); process.exit(0); } catch (error) { From 174fe33d3551be16f38e33b46c2d8cf6a579ba8c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 4 Dec 2024 09:07:33 +0000 Subject: [PATCH 6/8] chore(release): cut the 13.0.0-next.11 release [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0bd5c9b7..a9b464a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.10", + "version": "13.0.0-next.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@brightsec/cli", - "version": "13.0.0-next.10", + "version": "13.0.0-next.11", "license": "MIT", "dependencies": { "@neuralegion/os-service": "^1.2.6", diff --git a/package.json b/package.json index 786b2a6d..05b250ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.10", + "version": "13.0.0-next.11", "private": false, "repository": { "type": "git", From 166bce6117382e60c94dcbd6b36007fac10d75a4 Mon Sep 17 00:00:00 2001 From: maksadbek Date: Mon, 9 Dec 2024 12:32:26 +0100 Subject: [PATCH 7/8] chore: upgrade minimum node version to 20 (#628) also update the E2E test workflows --------- Co-authored-by: Artem Derevnjuk --- .github/workflows/e2e.yml | 24 ++++++++++++------------ package.json | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5a6c0d74..8eabbc00 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -49,17 +49,17 @@ jobs: matrix: include: - os: ubuntu-latest - container: ubuntu:18.04 + container: ubuntu:20.04 executable: bright-cli-linux-x64 - node: 16 + node: 20 - os: ubuntu-latest - container: ubuntu:16.04 + container: ubuntu:22.04 executable: bright-cli-linux-x64 - node: 16 + node: 20 - os: ubuntu-latest - container: fedora:24 + container: fedora:29 executable: bright-cli-linux-x64 - node: 16 + node: 20 - os: ubuntu-latest container: fedora:latest executable: bright-cli-linux-x64 @@ -234,17 +234,17 @@ jobs: fail-fast: false matrix: os: [macos-latest, windows-latest, ubuntu-latest] - node: [16, 18, 20] + node: [20, 22] include: - os: ubuntu-latest - container: ubuntu:16.04 - node: 16 + container: ubuntu:20.04 + node: 20 - os: ubuntu-latest - container: fedora:24 - node: 16 + container: fedora:29 + node: 20 - os: ubuntu-latest container: fedora:latest - node: 18 + node: 22 - os: ubuntu-latest container: fedora:latest node: 20 diff --git a/package.json b/package.json index 05b250ff..db8edc5b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ ] }, "engines": { - "node": ">=16 <=20" + "node": ">=20 <=22" }, "dependencies": { "@neuralegion/os-service": "^1.2.6", @@ -132,11 +132,11 @@ "./node_modules/win-ca/lib/crypt32-*.node", "./node_modules/@neuralegion/os-service/prebuilds/win32-*/node.abi115.node", "./node_modules/@neuralegion/raw-socket/prebuilds/win32-*/node.abi115.node", - "./node_modules/@neuralegion/raw-socket/prebuilds/linux-x64/node.abi93.glibc.node", + "./node_modules/@neuralegion/raw-socket/prebuilds/linux-x64/node.abi115.glibc.node", "./node_modules/@neuralegion/raw-socket/prebuilds/darwin-x64+arm64/node.abi115.node" ], "targets": [ - "node16-linux-x64", + "node20-linux-x64", "node20-macos-x64", "node20-windows-x64" ], From eb096b8a4946c711b51871d4661e02632e6425e0 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 10 Dec 2024 12:35:42 +0000 Subject: [PATCH 8/8] chore(release): cut the 13.0.0 release [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9b464a5..0eb1b778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.11", + "version": "13.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@brightsec/cli", - "version": "13.0.0-next.11", + "version": "13.0.0", "license": "MIT", "dependencies": { "@neuralegion/os-service": "^1.2.6", diff --git a/package.json b/package.json index db8edc5b..9391fd2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brightsec/cli", - "version": "13.0.0-next.11", + "version": "13.0.0", "private": false, "repository": { "type": "git",