Replies: 19 comments 34 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Copying some feedback here from our Slack discussion:
Additionally, see #174508 for some impact from the expiry and automation token removal. |
Beta Was this translation helpful? Give feedback.
-
There’s also some still valid and unaddressed feedback in the discussion around the OIDC / Trusted Publishing launch, such as eg my comment there: https://github.com/orgs/community/discussions/161015#discussioncomment-14419367 |
Beta Was this translation helpful? Give feedback.
-
From https://docs.npmjs.com/trusted-publishers
Is this support planned to be released before deprecating legacy classic tokens? We use GHES with self-hosted runners in our publishing workflow, and would like to switch OIDC / Trusted Publishing. It would be a breaking change for us to no longer be able to use legacy classic tokens with no ability to use OIDC instead. |
Beta Was this translation helpful? Give feedback.
-
There's a lot of good feedback elsewhere in these discussions but I want to make my take public outside of the slack as well. I'm going to go through the bullet points in the github blog post and then provide my own additional requests at the bottom. Current Planned GitHub / NPM Action Items
✅ This is good, get rid of them. Scoped and granular tokens are intrinsically more secure and the developer pain of "ah darn I gotta run
✅ Again, this is great. I had this as an item in an unpublished blog post that NPM should do. It effectively moves NPM from "2fa" to "phishing resistant" 2fa, which if in place 2 months ago would have prevented several of the initial compromises we saw hit the npm registry due to phishing attacks against maintainers (some of whom had 2FA and got their TOTP mitm'ed). To be clear, this is going to be quite annoying for so many people. Not in the least me, Electron publishes ~50+ packages all using TOTP codes (securely sent via http://github.com/continuousauth to github actions) that all need to be migrated to trusted publishing. But this is work we were going to do anyway because we'd already made our own conclusions about trusted publishing being the more secure future.
❓ This one is rough, there is currently an unsolved "Enterprise" usecase here that I will outline in "Missing Pieces" below.
✅ Finally, yes, thank you. Guiding developers towards the more secure option by default is a quick and easy win here that doesn't impact any existing package.
✅ Yessss. Thank you. Forcing 2FA for everyone is the single biggest win out of all of these, if you run Make everyone have secure phishing resistant 2FA, and then force everyone to use it 💯
❓ This one is also rough, but not because I'm against the idea, I'm wary of the implementation. See the "other OIDC providers" bit in "Missing Pieces" below Missing PiecesLet's pretend that everything in the above list shipped, what are we still missing to have a secure and simple package publishing strategy that works for everyone who currently uses npm Trusted Publishing should be One WayOnce you opt in to Trusted Publishing and publish your first release with it, that should be a one way choice only changeable in extreme cases with intervention from npm support. Currently just having access to a maintainers npm account effectively let's you perform a "downgrade" attack on them by removing trusted publishing and/or changing publishing settings. Once a package is published the Super Safe way, it should only ever be publishable that way. Trusted Publishing should use repository ID not nameThis is a common issue I see with github apps and other github integrations, I'm disappointed to see it from npm. By validating the owner name and repository name you are intrinsically creating the following issues:
The current UI in npmjs.org needs to be an actual dropdown of repositories using github oauth to provide a list and then internally it should validate the Trusted Publishing should set up and enforce github environment usageCurrent GitHub environment usage for trusted publishing is a manual and optional step, in addition to the above once you have an oauth token for the users github account, set up the environment for them. Enforce the environment can only be used on the This should be a series of clicks in the UI, not a custom yaml file, a hand crafted environment and manually typing in repo org and name. Trusted Publishing should disable all other legacy forms of publishing when activeCurrently even with trusted publishing enabled, a compromised maintainer account with a TOTP mitm can still publish these packages. Having Trusted Publishing active should just make all other forms of publishing disabled, regardless of how much auth you provide. See The Enterprise Usecase and Other OIDC ProvidersThese two I don't have an answer for, but calling them out anyway. Enterprises use self hosted runners, even to publish open source packages, they also use CI systems that aren't github actions or gitlab. What's the story going to be for them, enterprises with self hosted CI (Jenkins, BuildKite, CircleCI, etc.) should still be capable of publishing packages safely without having to manually update a token every 7 days 🤔 I would like to see a plan for that. |
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
Here is a new post with changes we are applying first as part of this program. Please take a look and thanks for the continued feedback, as it is helping us doing some fine adjustments to the new measures we are implementing. |
Beta Was this translation helpful? Give feedback.
-
I think npm accounts should be as important as... I don't know, Apple developer accounts. Great to see that security updates are being made! |
Beta Was this translation helpful? Give feedback.
-
If you're going to force people to generate new tokens by forcing (short) expiry windows, at least make it easy for them to regenerate tokens using the previous configuration. As someone who has been using short-ish expiry windows already, this has been by far my biggest frustration with it - this feature has been long overdue... If a token of mine expires, I probably need one with the same granularity to replace it, so give me that option. If not, I think many developers will just generate overly permissive tokens because it's easier than specifying one package per token (again, I have considered this but luckily I don't publish that often). I believe this would contribute significantly to preventing attacks as a leaked token for one project wouldn't allow publishing all the package maintainer's other tokens. See also my earlier piece of feedback: npm/feedback#1088 |
Beta Was this translation helpful? Give feedback.
-
Please clarify the scope for this. It's linked from the main GitHub page; is it only for NPM or is it for everyone? I believe there are some things that you can do with classic access tokens that you cannot do with fine-grained tokens |
Beta Was this translation helpful? Give feedback.
-
One thing we seem to be skipping over: GitHub environments should have an option to require 2fa All of these npm changes are fine if there's 2FA in the trusted workflow. Currently, you can already bind a trusted workflow to an environment in that it must be run through that to be considered trusted. In reality the only reason anyone is complaining about the changes so far is because such a flow doesn't exist. The flow should basically go like this:
Admittedly this isn't an npm change but given how we're all being pushed to use GitHub for publishing, it's a very important feature to make the whole picture work. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for this post. Some questions about To be able to run Right now, the
How will this be impacted by these changes? The github blog post does not address this issue. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the post. Related specifically to the Shai Hulud attacks I saw mentioned in the article that there are controls in place to prevent packages with Shai Hulud IoC's from being published. Can you detail that for me? We are trying to assess if NPM/Github has this under control or if we need to build out additional checks for Shai Hulud effected packages (Search for IoC's ourselves). |
Beta Was this translation helpful? Give feedback.
-
Our company has its own CI system and we do some npm package publishing using long-live tokens. We would like to migrate to Trusted Publishing, yet documentation says that it does not have wide support, nor is there any clear directions on how to implement Trusted Publishing for custom CI systems. With long-live tokens going to be revoked in mid-November, does that mean our only option is to |
Beta Was this translation helpful? Give feedback.
-
Will long-lived classic tokens with read-only scope (not able to use for publishing) will also be revoked? They're useful for granting read-only access to packages in a private scope and don't pose security risk like publish tokens. |
Beta Was this translation helpful? Give feedback.
-
I am lucky that (currently) all of my automated publishing happens through GitHub actions, so this doesn't affect me that much today as mostly switching to trusted publishing only took half a day or so (though a forced breaking change like this with such a short timeline before npm will break all of my automation is not appreciated!) I have two main issues with this today:
My recommendation for this would be:
|
Beta Was this translation helpful? Give feedback.
-
Our company currently uses Hosted GitHub Runners and GoCD. I appreciate npm’s determination to address supply-chain attacks, but I feel the measures miss the core issue. For small-scale development, hobbies, or testing, requiring 2FA to publish or forcing token renewal every time seems excessive. And OIDC feels like it merely shifts token management to another platform. There are many disruptive changes that risk breaking a lot. How about splitting publishing into "secure" and "unsecure" modes? In the unsecure mode, you could delay promotion to the latest tag and add a few constraints (e.g., disallow script execution). I believe that for most use cases, even a less secure publish would be acceptable without major problems. |
Beta Was this translation helpful? Give feedback.
-
I maintain over 45 packages spread over 12 organisations, none of which are using GitHub.com or GitLab.com, and none of which who have ever been even near a supply-chain attack. The current tokens have a lifetime of 01-01-2100, but restricted to a single scope (or package). Forcing token renewal like this basically forces me to start publishing every package manually. I have no issue with the forced 2fa for local publishing (in fact, I've had it on for years), but the cost to me and my company "waiting" for trusted publishing to come to self-hosted runners and then having to upgrade the CI again isn't just excessive, it will likely cause us to either lose the clients or lose money. If this trusted publishing system was available today, I would be sad because of the forced work both as a business owner and open source maintainer, but I can live with that. Right now there is no path forward other than NPM hopefully supporting it Soon™. Our workaround it to drop NPM completely, which we can, but surely that's not the intention? |
Beta Was this translation helpful? Give feedback.
-
I replaced my OTP authenticator with a passkey but the CLI is still asking me for a OTP when I publish with "Require two-factor authentication for write actions" turned on. What OTP is the CLI expecting? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We recently published a post about our plan to improve security on npm as a supply chain supplier and I'd love to gather everyone's feedback.
Please use this thread for general feedback. Other threads might be pinned as well as they get popularity as I want to keep free formatting for all.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions