socket 0.15.56 → 0.15.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli.js +59 -32
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +3 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/types/commands/scan/handle-reach-scan.d.mts +1 -1
  6. package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -1
  7. package/dist/types/commands/scan/scan-reachability.d.mts +1 -1
  8. package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -1
  9. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
  10. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +4 -1
  11. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
  12. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +4 -1
  13. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
  14. package/dist/vendor.js +21 -21
  15. package/external/@coana-tech/cli/cli.mjs +2 -2
  16. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +9 -4
  17. package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +115 -132
  18. package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +18 -0
  19. package/external/@socketsecurity/registry/external/browserslist.js +662 -658
  20. package/external/@socketsecurity/registry/external/cacache.js +5 -3
  21. package/external/@socketsecurity/registry/external/libnpmpack.js +9 -4
  22. package/external/@socketsecurity/registry/external/make-fetch-happen.js +5 -3
  23. package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -1
  24. package/external/@socketsecurity/registry/external/pacote.js +9 -4
  25. package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -1
  26. package/external/@socketsecurity/registry/manifest.json +4 -4
  27. package/external/blessed-contrib/lib/widget/charts/line.js +5 -5
  28. package/package.json +7 -7
package/dist/cli.js CHANGED
@@ -12852,13 +12852,13 @@ async function outputScanReach(result, cwd, outputKind) {
12852
12852
  const {
12853
12853
  DOT_SOCKET_DOT_FACTS_JSON
12854
12854
  } = constants;
12855
- async function scanReachability(cwd) {
12855
+ async function scanReachability(argv, cwd) {
12856
12856
  try {
12857
12857
  const result = await spawn.spawn(constants.execPath, [
12858
12858
  // Lazily access constants.nodeNoWarningsFlags.
12859
12859
  ...constants.nodeNoWarningsFlags,
12860
12860
  // Lazily access constants.coanaBinPath.
12861
- constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--disable-report-submission', '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON], {
12861
+ constants.coanaBinPath, 'run', cwd, '--output-dir', cwd, '--socket-mode', DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...argv], {
12862
12862
  cwd,
12863
12863
  env: {
12864
12864
  ...process.env,
@@ -12880,8 +12880,8 @@ async function scanReachability(cwd) {
12880
12880
  }
12881
12881
  }
12882
12882
 
12883
- async function handleScanReach(cwd, outputKind) {
12884
- const result = await scanReachability(cwd);
12883
+ async function handleScanReach(argv, cwd, outputKind) {
12884
+ const result = await scanReachability(argv, cwd);
12885
12885
  await outputScanReach(result, cwd, outputKind);
12886
12886
  }
12887
12887
 
@@ -12940,7 +12940,7 @@ async function run$6(argv, importMeta, {
12940
12940
  logger.logger.log(DRY_RUN_BAILING_NOW$6);
12941
12941
  return;
12942
12942
  }
12943
- await handleScanReach(cwd, outputKind);
12943
+ await handleScanReach(argv, cwd, outputKind);
12944
12944
  }
12945
12945
 
12946
12946
  const {
@@ -13725,11 +13725,14 @@ async function fetchThreatFeed({
13725
13725
  direction,
13726
13726
  ecosystem,
13727
13727
  filter,
13728
+ orgSlug,
13728
13729
  page,
13729
- perPage
13730
+ perPage,
13731
+ pkg,
13732
+ version
13730
13733
  }) {
13731
- const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], ['filter', filter], ['page', page], ['per_page', String(perPage)]]);
13732
- return await utils.queryApiSafeJson(`threat-feed?${queryParams}`, 'the Threat Feed data');
13734
+ const queryParams = new URLSearchParams([['direction', direction], ['ecosystem', ecosystem], filter ? ['filter', filter] : ['', ''], ['page_cursor', page], ['per_page', String(perPage)], pkg ? ['name', pkg] : ['', ''], version ? ['version', version] : ['', '']]);
13735
+ return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
13733
13736
  }
13734
13737
 
13735
13738
  const require$1 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
@@ -13868,16 +13871,22 @@ async function handleThreatFeed({
13868
13871
  direction,
13869
13872
  ecosystem,
13870
13873
  filter,
13874
+ orgSlug,
13871
13875
  outputKind,
13872
13876
  page,
13873
- perPage
13877
+ perPage,
13878
+ pkg,
13879
+ version
13874
13880
  }) {
13875
13881
  const data = await fetchThreatFeed({
13876
13882
  direction,
13877
13883
  ecosystem,
13878
13884
  filter,
13885
+ orgSlug,
13879
13886
  page,
13880
- perPage
13887
+ perPage,
13888
+ pkg,
13889
+ version
13881
13890
  });
13882
13891
  await outputThreatFeed(data, outputKind);
13883
13892
  }
@@ -13892,6 +13901,24 @@ const config$2 = {
13892
13901
  flags: {
13893
13902
  ...utils.commonFlags,
13894
13903
  ...utils.outputFlags,
13904
+ direction: {
13905
+ type: 'string',
13906
+ shortFlag: 'd',
13907
+ default: 'desc',
13908
+ description: 'Order asc or desc by the createdAt attribute'
13909
+ },
13910
+ eco: {
13911
+ type: 'string',
13912
+ shortFlag: 'e',
13913
+ default: '',
13914
+ description: 'Only show threats for a particular ecosystem'
13915
+ },
13916
+ filter: {
13917
+ type: 'string',
13918
+ shortFlag: 'f',
13919
+ default: 'mal',
13920
+ description: 'Filter what type of threats to return'
13921
+ },
13895
13922
  interactive: {
13896
13923
  type: 'boolean',
13897
13924
  default: true,
@@ -13901,35 +13928,25 @@ const config$2 = {
13901
13928
  type: 'string',
13902
13929
  description: 'Force override the organization slug, overrides the default org from config'
13903
13930
  },
13904
- perPage: {
13905
- type: 'number',
13906
- shortFlag: 'pp',
13907
- default: 30,
13908
- description: 'Number of items per page'
13909
- },
13910
13931
  page: {
13911
13932
  type: 'string',
13912
13933
  shortFlag: 'p',
13913
13934
  default: '1',
13914
13935
  description: 'Page token'
13915
13936
  },
13916
- direction: {
13917
- type: 'string',
13918
- shortFlag: 'd',
13919
- default: 'desc',
13920
- description: 'Order asc or desc by the createdAt attribute'
13937
+ perPage: {
13938
+ type: 'number',
13939
+ shortFlag: 'pp',
13940
+ default: 30,
13941
+ description: 'Number of items per page'
13921
13942
  },
13922
- eco: {
13943
+ pkg: {
13923
13944
  type: 'string',
13924
- shortFlag: 'e',
13925
- default: '',
13926
- description: 'Only show threats for a particular ecosystem'
13945
+ description: 'Filter by this package name'
13927
13946
  },
13928
- filter: {
13947
+ version: {
13929
13948
  type: 'string',
13930
- shortFlag: 'f',
13931
- default: 'mal',
13932
- description: 'Filter what type of threats to return'
13949
+ description: 'Filter by this package version'
13933
13950
  }
13934
13951
  },
13935
13952
  help: (command, config) => `
@@ -13970,6 +13987,11 @@ const config$2 = {
13970
13987
  - nuget
13971
13988
  - pypi
13972
13989
 
13990
+ Note: if you filter by package name or version, it will do so for anything
13991
+ unless you also filter by that ecosystem and/or package name. When in
13992
+ doubt, look at the threat-feed and see the names in the name/version
13993
+ column. That's what you want to search for.
13994
+
13973
13995
  Examples
13974
13996
  $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'}
13975
13997
  $ ${command}${utils.isTestingV1() ? '' : ' FakeOrg'} --perPage=5 --page=2 --direction=asc --filter=joke
@@ -13994,7 +14016,9 @@ async function run$2(argv, importMeta, {
13994
14016
  interactive,
13995
14017
  json,
13996
14018
  markdown,
13997
- org: orgFlag
14019
+ org: orgFlag,
14020
+ pkg,
14021
+ version
13998
14022
  } = cli.flags;
13999
14023
  const outputKind = utils.getOutputKind(json, markdown);
14000
14024
  const [orgSlug] = await utils.determineOrgSlug(String(orgFlag || ''), cli.input[0] || '', !!interactive, !!dryRun);
@@ -14030,8 +14054,11 @@ async function run$2(argv, importMeta, {
14030
14054
  ecosystem: String(cli.flags['eco'] || ''),
14031
14055
  filter: String(cli.flags['filter'] || 'mal'),
14032
14056
  outputKind,
14057
+ orgSlug,
14033
14058
  page: String(cli.flags['page'] || '1'),
14034
- perPage: Number(cli.flags['perPage']) || 30
14059
+ perPage: Number(cli.flags['perPage']) || 30,
14060
+ pkg: String(pkg || ''),
14061
+ version: String(version || '')
14035
14062
  });
14036
14063
  }
14037
14064
 
@@ -14619,5 +14646,5 @@ void (async () => {
14619
14646
  await utils.captureException(e);
14620
14647
  }
14621
14648
  })();
14622
- //# debugId=f53da652-ed7e-41d2-baff-cba59a65e6b2
14649
+ //# debugId=a6016faa-33fb-4a2d-9347-cd24206bcb99
14623
14650
  //# sourceMappingURL=cli.js.map