Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: yarn npm audit --all --recursive ignores certificates settings #6568

Open
1 task
mcandre opened this issue Oct 21, 2024 · 3 comments
Open
1 task
Labels
bug Something isn't working

Comments

@mcandre
Copy link

mcandre commented Oct 21, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

When I try to scan my Yarn projects with yarn npm audit --all --recursive, then it silently ignores certificate settings.

It's not obeying httpsCaFilePath in .yarnrc.yml.

It's not obeying OS certificates.

To reproduce

  1. Configure a firewall policy to block the yarn npm audit --all --recursive domains.
  2. Configure yarn (and corepack!) to use proxies with self signed certificate PEM files.
  3. Run yarn npm audit --all --recursive.

Environment

System:
OS: macOS 15.0
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 20.17.0 - /private/var/folders/xc/s20l07yj76x8m3h20lmy5jlc0000gn/T/xfs-7493f3de/node
Yarn: 4.3.1 - /private/var/folders/xc/s20l07yj76x8m3h20lmy5jlc0000gn/T/xfs-7493f3de/yarn
npm: 10.8.2 - ~/.asdf/plugins/nodejs/shims/npm

Additional context

By the way, yarn's error trace on SSL problems includes a recommendation to run yarn install to provision missing packages... but that's not applicable. The error handling should skip that recommendation for socket level network errors.

@mcandre mcandre added the bug Something isn't working label Oct 21, 2024
@mcandre
Copy link
Author

mcandre commented Oct 22, 2024

yarn SCA appears to also ignore NODE_EXTRA_CA_CERTS, causing security scans to fail when behind a proxy using self-signed certificates.

@aep-sunlife
Copy link

aep-sunlife commented Oct 23, 2024

yarn npm audit... appears to ignore stock NPM registry credentials configuration. May as well rename the subcommand back to yarn audit, instead of implying that yarn SCA actually integrates with the normal npm audit user configuration system, which is confusing.

@aep-sunlife
Copy link

Unsure whether httpsCertFilePath is the right key, but that one appears to be ignored as well when constructing the HTTP client handler to communicate with proxies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants