Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 55 additions & 55 deletions src/commands/analytics/output-analytics.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,76 +22,76 @@ describe('output-analytics', () => {
"unmaintained": 133,
},
"total_critical_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_critical_alerts": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_critical_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_high_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_high_alerts": {
"Apr 18": 13,
"Apr 19": 13,
"Apr 20": 13,
"Apr 21": 10,
"Apr 21": 13,
"Apr 22": 10,
},
"total_high_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_low_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_low_alerts": {
"Apr 18": 1054,
"Apr 19": 1060,
"Apr 20": 1066,
"Apr 21": 1059,
"Apr 19": 1054,
"Apr 20": 1060,
"Apr 21": 1066,
"Apr 22": 1059,
},
"total_low_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_medium_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_medium_alerts": {
"Apr 18": 206,
"Apr 19": 207,
"Apr 20": 209,
"Apr 21": 206,
"Apr 19": 206,
"Apr 20": 207,
"Apr 21": 209,
"Apr 22": 206,
},
"total_medium_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
}
`)
Expand All @@ -110,76 +110,76 @@ describe('output-analytics', () => {
"unmaintained": 532,
},
"total_critical_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_critical_alerts": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_critical_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_high_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_high_alerts": {
"Apr 18": 13,
"Apr 19": 13,
"Apr 20": 13,
"Apr 21": 10,
"Apr 21": 13,
"Apr 22": 10,
},
"total_high_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_low_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_low_alerts": {
"Apr 18": 1054,
"Apr 19": 1060,
"Apr 20": 1066,
"Apr 21": 1059,
"Apr 19": 1054,
"Apr 20": 1060,
"Apr 21": 1066,
"Apr 22": 1059,
},
"total_low_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_medium_added": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
"total_medium_alerts": {
"Apr 18": 206,
"Apr 19": 207,
"Apr 20": 209,
"Apr 21": 206,
"Apr 19": 206,
"Apr 20": 207,
"Apr 21": 209,
"Apr 22": 206,
},
"total_medium_prevented": {
"Apr 18": 0,
"Apr 19": 0,
"Apr 20": 0,
"Apr 21": 0,
"Apr 22": 0,
},
}
`)
Expand All @@ -200,80 +200,80 @@ describe('output-analytics', () => {

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total high alerts

| Date | Counts |
| ------ | ------ |
| Apr 18 | 13 |
| Apr 20 | 13 |
| Apr 19 | 13 |
| Apr 21 | 10 |
| Apr 21 | 13 |
| Apr 20 | 13 |
| Apr 22 | 10 |
| ------ | ------ |

## Total critical alerts added to the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total high alerts added to the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total critical alerts prevented from the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total high alerts prevented from the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total medium alerts prevented from the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Total low alerts prevented from the main branch

| Date | Counts |
| ------ | ------ |
| Apr 18 | 0 |
| Apr 20 | 0 |
| Apr 19 | 0 |
| Apr 21 | 0 |
| Apr 20 | 0 |
| Apr 22 | 0 |
| ------ | ------ |

## Top 5 alert types
Expand Down
1 change: 1 addition & 0 deletions src/commands/ci/handle-ci.mts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export async function handleCi(autoManifest: boolean): Promise<void> {
reachAnalysisTimeout: 0,
reachAnalysisMemoryLimit: 0,
reachConcurrency: 1,
reachDebug: false,
reachDisableAnalytics: false,
reachDisableAnalysisSplitting: false,
reachEcosystems: [],
Expand Down
3 changes: 3 additions & 0 deletions src/commands/scan/cmd-scan-create.mts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ async function run(
reachAnalysisMemoryLimit,
reachAnalysisTimeout,
reachConcurrency,
reachDebug,
reachDisableAnalysisSplitting,
reachDisableAnalytics,
reachSkipCache,
Expand Down Expand Up @@ -266,6 +267,7 @@ async function run(
reachAnalysisTimeout: number
reachAnalysisMemoryLimit: number
reachConcurrency: number
reachDebug: boolean
reachDisableAnalytics: boolean
reachDisableAnalysisSplitting: boolean
reachSkipCache: boolean
Expand Down Expand Up @@ -523,6 +525,7 @@ async function run(
reachAnalysisTimeout: Number(reachAnalysisTimeout),
reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
reachConcurrency: Number(reachConcurrency),
reachDebug: Boolean(reachDebug),
reachDisableAnalysisSplitting: Boolean(reachDisableAnalysisSplitting),
reachEcosystems,
reachExcludePaths,
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/cmd-scan-create.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe('socket scan create', async () => {
--reach-analysis-memory-limit The maximum memory in MB to use for the reachability analysis. The default is 8192MB.
--reach-analysis-timeout Set timeout for the reachability analysis. Split analysis runs may cause the total scan time to exceed this timeout significantly.
--reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available. NPM reachability analysis does not support concurrent execution, so the concurrency level is ignored for NPM.
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
--reach-disable-analysis-splitting Limits Coana to at most 1 reachability analysis run per workspace.
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.
Expand Down
3 changes: 3 additions & 0 deletions src/commands/scan/cmd-scan-reach.mts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async function run(
reachAnalysisMemoryLimit,
reachAnalysisTimeout,
reachConcurrency,
reachDebug,
reachDisableAnalysisSplitting,
reachDisableAnalytics,
reachSkipCache,
Expand All @@ -124,6 +125,7 @@ async function run(
reachAnalysisTimeout: number
reachAnalysisMemoryLimit: number
reachConcurrency: number
reachDebug: boolean
reachDisableAnalytics: boolean
reachDisableAnalysisSplitting: boolean
reachSkipCache: boolean
Expand Down Expand Up @@ -207,6 +209,7 @@ async function run(
reachAnalysisTimeout: Number(reachAnalysisTimeout),
reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
reachConcurrency: Number(reachConcurrency),
reachDebug: Boolean(reachDebug),
reachDisableAnalytics: Boolean(reachDisableAnalytics),
reachDisableAnalysisSplitting: Boolean(reachDisableAnalysisSplitting),
reachEcosystems,
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/cmd-scan-reach.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('socket scan reach', async () => {
--reach-analysis-memory-limit The maximum memory in MB to use for the reachability analysis. The default is 8192MB.
--reach-analysis-timeout Set timeout for the reachability analysis. Split analysis runs may cause the total scan time to exceed this timeout significantly.
--reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available. NPM reachability analysis does not support concurrent execution, so the concurrency level is ignored for NPM.
--reach-debug Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.
--reach-disable-analysis-splitting Limits Coana to at most 1 reachability analysis run per workspace.
--reach-disable-analytics Disable reachability analytics sharing with Socket. Also disables caching-based optimizations.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Defaults to all ecosystems.
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/create-scan-from-github.mts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ async function scanOneRepo(
reachAnalysisTimeout: 0,
reachAnalysisMemoryLimit: 0,
reachConcurrency: 1,
reachDebug: false,
reachDisableAnalysisSplitting: false,
reachEcosystems: [],
reachExcludePaths: [],
Expand Down
2 changes: 2 additions & 0 deletions src/commands/scan/perform-reachability-analysis.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type ReachabilityOptions = {
reachAnalysisTimeout: number
reachAnalysisMemoryLimit: number
reachConcurrency: number
reachDebug: boolean
reachDisableAnalytics: boolean
reachDisableAnalysisSplitting: boolean
reachEcosystems: PURL_Type[]
Expand Down Expand Up @@ -151,6 +152,7 @@ export async function performReachabilityAnalysis(
...(reachabilityOptions.reachConcurrency
? ['--concurrency', `${reachabilityOptions.reachConcurrency}`]
: []),
...(reachabilityOptions.reachDebug ? ['--debug'] : []),
...(reachabilityOptions.reachDisableAnalytics
? ['--disable-analytics-sharing']
: []),
Expand Down
6 changes: 6 additions & 0 deletions src/commands/scan/reachability-flags.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export const reachabilityFlags: MeowFlags = {
description:
'Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available. NPM reachability analysis does not support concurrent execution, so the concurrency level is ignored for NPM.',
},
reachDebug: {
type: 'boolean',
default: false,
description:
'Enable debug mode for reachability analysis. Provides verbose logging from the reachability CLI.',
},
reachDisableAnalytics: {
type: 'boolean',
default: false,
Expand Down