Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [1.1.151](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.151) - 2026-07-30

### Changed
- Updated the Coana CLI to v `15.9.9`.

## [1.1.150](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.150) - 2026-07-29

### Changed
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.150",
"version": "1.1.151",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT",
Expand Down Expand Up @@ -97,7 +97,7 @@
"@babel/preset-typescript": "7.27.1",
"@babel/runtime": "7.28.4",
"@biomejs/biome": "2.2.4",
"@coana-tech/cli": "15.9.7",
"@coana-tech/cli": "15.9.9",
"@cyclonedx/cdxgen": "12.1.2",
"@dotenvx/dotenvx": "1.49.0",
"@eslint/compat": "1.3.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions src/commands/ci/handle-ci.mts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export async function handleCi(autoManifest: boolean): Promise<void> {
pendingHead: true,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '',
reachAnalysisTimeout: '',
Expand Down
4 changes: 2 additions & 2 deletions src/commands/manifest/scripts/assemble.mts
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ function buildArtifactPaths(
}
coords.add(coordKey)
const pi = projectsByGav.get(gav(c.group, c.name, c.version ?? ''))
const sources = (pi?.sources ?? []).filter(fileExists)
const targets = [...new Set([...fn.targets, ...(pi?.targets ?? [])])]
const sources = (pi?.sources ?? []).filter(fileExists).sort()
const targets = [...new Set(pi ? pi.targets : fn.targets)]
.filter(fileExists)
.sort()
if (sources.length) {
Expand Down
9 changes: 9 additions & 0 deletions src/commands/scan/cmd-scan-create.mts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ async function run(
committers,
cwd: cwdOverride,
defaultBranch,
dynamicSbomInference,
interactive = true,
json,
markdown,
Expand Down Expand Up @@ -275,6 +276,7 @@ async function run(
committers: string
cwd: string
defaultBranch: boolean
dynamicSbomInference: boolean
interactive: boolean
json: boolean
markdown: boolean
Expand Down Expand Up @@ -353,6 +355,11 @@ async function run(
autoManifest = false
}
}
// --dynamic-sbom-inference requires auto-manifest to generate the
// per-workspace facts it feeds to Coana.
if (dynamicSbomInference) {
autoManifest = true
}
if (!branchName) {
if (sockJson.defaults?.scan?.create?.branch) {
branchName = sockJson.defaults.scan.create.branch
Expand Down Expand Up @@ -505,6 +512,7 @@ async function run(
reachVersion !== reachabilityFlags['reachVersion']?.default

const isUsingAnyReachabilityFlags =
dynamicSbomInference ||
hasReachEcosystems ||
hasReachExcludePaths ||
isUsingNonDefaultAnalytics ||
Expand Down Expand Up @@ -625,6 +633,7 @@ async function run(
pendingHead: Boolean(pendingHead),
pullRequest: Number(pullRequest),
reach: {
dynamicSbomInference: Boolean(dynamicSbomInference),
excludePaths,
reachAnalysisMemoryLimit,
reachAnalysisTimeout,
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 @@ -116,6 +116,7 @@ async function run(

const {
cwd: cwdOverride,
dynamicSbomInference,
interactive = true,
json,
markdown,
Expand All @@ -141,6 +142,7 @@ async function run(
reachVersion,
} = cli.flags as {
cwd: string
dynamicSbomInference: boolean
interactive: boolean
json: boolean
markdown: boolean
Expand Down Expand Up @@ -267,6 +269,7 @@ async function run(
outputKind,
outputPath: outputPath || '',
reachabilityOptions: {
dynamicSbomInference: Boolean(dynamicSbomInference),
Comment thread
jfblaa marked this conversation as resolved.
Outdated
excludePaths,
reachAnalysisMemoryLimit,
reachAnalysisTimeout,
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 @@ -253,6 +253,7 @@ async function scanOneRepo(
pendingHead: true,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '',
reachAnalysisTimeout: '',
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/exclude-paths.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function makeReachOptions(
overrides: Partial<ReachabilityOptions> = {},
): ReachabilityOptions {
return {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down
6 changes: 6 additions & 0 deletions src/commands/scan/handle-create-new-scan.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function createConfig(
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -198,6 +199,7 @@ describe('handleCreateNewScan excludePaths', () => {
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: ['tests', 'packages/*'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -261,6 +263,7 @@ describe('handleCreateNewScan excludePaths', () => {
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: ['apps/api/tests', '**/dist'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -330,6 +333,7 @@ describe('handleCreateNewScan excludePaths', () => {
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: ['tests'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -389,6 +393,7 @@ describe('handleCreateNewScan excludePaths', () => {
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: ['apps/api'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -448,6 +453,7 @@ describe('handleCreateNewScan excludePaths', () => {
pendingHead: false,
pullRequest: 0,
reach: {
dynamicSbomInference: false,
excludePaths: ['tests'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down
7 changes: 7 additions & 0 deletions src/commands/scan/handle-scan-reach.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('handleScanReach', () => {

it('applies excludePaths to manifest discovery and reachability analysis', async () => {
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: ['tests', 'packages/*'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -156,6 +157,7 @@ describe('handleScanReach', () => {

it('translates excludePaths from the scan root for nested targets', async () => {
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: ['apps/api/tests', '**/dist'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -218,6 +220,7 @@ describe('handleScanReach', () => {
checks.every(check => check.test),
)
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: ['apps/api'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -266,6 +269,7 @@ describe('handleScanReach', () => {
mockFindSocketYmlSync.mockReturnValueOnce({ ok: false })

const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: ['tests'],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -318,6 +322,7 @@ describe('handleScanReach', () => {
},
})
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -355,6 +360,7 @@ describe('handleScanReach', () => {

it('does not call finalize when Coana did not return a full application reachability scan id', async () => {
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down Expand Up @@ -405,6 +411,7 @@ describe('handleScanReach', () => {
cause: 'Socket API server error (503)',
})
const reachabilityOptions = {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '8192',
reachAnalysisTimeout: '',
Expand Down
4 changes: 4 additions & 0 deletions src/commands/scan/perform-reachability-analysis.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type { Spinner } from '@socketsecurity/registry/lib/spinner'
import type { StdioOptions } from 'node:child_process'

export type ReachabilityOptions = {
dynamicSbomInference: boolean
excludePaths: string[]
reachAnalysisMemoryLimit: string
reachAnalysisTimeout: string
Expand Down Expand Up @@ -251,6 +252,9 @@ export async function performReachabilityAnalysis(
...(reachabilityOptions.reachExcludePaths.length
? ['--exclude-dirs', ...reachabilityOptions.reachExcludePaths]
: []),
...(reachabilityOptions.dynamicSbomInference
? ['--maven-use-only-root-socket-facts']
: []),
...(reachabilityOptions.reachLazyMode ? ['--lazy-mode'] : []),
...(reachabilityOptions.reachSkipCache ? ['--skip-cache-usage'] : []),
...(reachabilityOptions.reachUseOnlyPregeneratedSboms
Expand Down
1 change: 1 addition & 0 deletions src/commands/scan/perform-reachability-analysis.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ vi.mock('@socketsecurity/registry/lib/logger', () => ({

function makeReachabilityOptions(): ReachabilityOptions {
return {
dynamicSbomInference: false,
excludePaths: [],
reachAnalysisMemoryLimit: '',
reachAnalysisTimeout: '',
Expand Down
7 changes: 7 additions & 0 deletions src/commands/scan/reachability-flags.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { getReachabilityEcosystemChoices } from '../../utils/ecosystem.mts'
import type { MeowFlags } from '../../flags.mts'

export const reachabilityFlags: MeowFlags = {
dynamicSbomInference: {
type: 'boolean',
default: false,
hidden: true,
description:
'Internal: enables dynamic SBOM inference for full application reachability analysis. Passes --maven-use-only-root-socket-facts to Coana and implies --auto-manifest.',
},
reachVersion: {
type: 'string',
description: `Override the version of @coana-tech/cli used for reachability analysis. Default: ${constants.ENV.INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION}.`,
Expand Down