Skip to content

Commit

Permalink
Merge pull request #6 from NeuraLegion/PAP-1262-support-non-legacy-scans
Browse files Browse the repository at this point in the history
feat(run-scan): add entrypoints parameter
  • Loading branch information
orubin authored Jan 7, 2025
2 parents 0aaf24c + 5827faa commit 9a2e1e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions run-scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ inputs:
tests:
description: 'A list of tests which you want to run during a scan.'
required: false
entrypoints:
description: 'A list of entrypoints which you want to scan.'
required: false

outputs:
url:
Expand Down
1 change: 1 addition & 0 deletions run-scan/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Config {
projectId?: string;
hostsFilter?: string[];
tests?: TestType[];
entryPointIds?: string[];
}

const invalidUrlProtocols: ReadonlySet<string> = new Set<string>([
Expand Down
3 changes: 3 additions & 0 deletions run-scan/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const module_in = core.getInput('module');
const hostsFilter = getArray('hosts_filter');
const type = core.getInput('type');
const hostname = core.getInput('hostname');
const entrypoints = getArray('entrypoints');

const baseUrl = hostname ? `https://${hostname}` : 'https://app.brightsec.com';

Expand Down Expand Up @@ -111,10 +112,12 @@ if (restartScanID) {
? [Discovery.ARCHIVE]
: discoveryTypesIn;
const uniqueTests = tests ? [...new Set(tests)] : undefined;

const config: Config = {
name,
discoveryTypes,
module,
entryPointIds: entrypoints,
...(crawlerUrls ? { crawlerUrls } : {}),
...(fileId ? { fileId } : {}),
...(projectId ? { projectId } : {}),
Expand Down

0 comments on commit 9a2e1e4

Please sign in to comment.