Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Emelia 馃懜馃徎
@thisismissem@hachyderm.io  路  activity timestamp 2 weeks ago

Pro-tip for npm: rather than using a classic access token in your ~/.npmrc file, generate a granular access token that only has read permissions.

That way if something does compromise you, they only get access to the read token and cannot publish on your behalf.

#npm #npmattack

  • Copy link
  • Flag this post
  • Block
Gregor
@gregor@toot.cafe replied  路  activity timestamp 2 weeks ago
@thisismissem ohhh smart! Thanks for sharing!
  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp 2 weeks ago

Also, npm now supports trusted publishing: https://docs.npmjs.com/trusted-publishers

This means you don't need a static token in your CI/CD configuration anymore.

#npm #npmattack

  • Copy link
  • Flag this comment
  • Block
Markus Tacker
@coderbyheart@chaos.social replied  路  activity timestamp 2 weeks ago
@thisismissem Yes, don't publish from your local machine.
  • Copy link
  • Flag this comment
  • Block
Jan Lehnardt :couchdb:
@janl@narrativ.es replied  路  activity timestamp last week
@coderbyheart @thisismissem That assumes your dev box is compromised. Where do you store your SSH private keys?
  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp last week
@janl @coderbyheart in my case not on disk.
  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp 2 weeks ago
@coderbyheart yeah, but the default `npm login` token is a write-enabled token, so swapping this out for a read-only token is the safe thing to do.
  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp 2 weeks ago
@coderbyheart see: https://docs.npmjs.com/cli/v11/commands/npm-login
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login