72 points · by varunsharma07 · 3y ago · 26 comments
I discussed with an open-source maintainer why they publish npm packages from their local machine and do not use CI/CD pipelines.
They said publishing should require human intervention and want to continue using multi-factor authentication to publish to the npm registry.
This led to building the wait-for-secrets GitHub Action. It prints a URL in the build log and waits for secrets to be entered using a browser. Once entered, the workflow continues, and secrets can be used in future steps.
The latest release of "eslint-plugin-react" to the npm registry used a one-time password (OTP) from a GitHub Actions workflow! https://github.com/jsx-eslint/eslint-plugin-react/actions/ru...
I've been noticing a lot of marketing materials describe themselves as "zero-knowledge" when it's just E2EE.
I definitely agree it would be nice to have.
The backend API is open-source, and the secrets are cleared immediately after use from the data store, but I agree this is a good idea.
Fun fact- Varun is a super smart engineer, he even won a car in a competition:
https://www.oneindia.com/2006/06/29/microsoft-security-shoot...
I would highly encourage HNers to try out his github action.
Thank you for not wrapping this up in docker image. Unless there’s a specific purpose for it, those kind of actions are annoying to use.
EDIT also, kudos to putting a version on it. An action dealing with authentication and telling you to use it with “@master” is suspect, IMO.
The downside to that approach is that it requires the consuming side (NPM in this case) to understand and verify OIDC tokens (which are really just JWTs). But we're currently working on exactly that on PyPI, and hopefully other package ecosystems will follow our progress there.
Advice to use external GitHub actions, especially security actions, should pin to a sha instead.
(Manual intervention seems like a very reasonable thing to want! But perhaps it makes sense to leave the package index's secrets out of the round-trip, and limit the secret to something known by only the publisher and the "gatekeeping" service.)
(I'm still not 100% clear on the security advantages of requiring MFA for API tokens that are limited in scope -- assuming that NPM's tokens don't serve as full user credentials, I don't think they should enforce MFA on them.)
It's covers the "self-hosted & open source" but it's not specifically an authentication thingy, so you would have to generate the auth factor to push and the service that verifies it, like a web hook.
I seem to recall someone using ephemeral Tailscale nodes in CI to respond to a hardware token challenge locally but I can't find where that was.
I have added an issue to track your idea: https://github.com/step-security/wait-for-secrets/issues/57. It would be interesting to run as the current user using OAuth, but it will need more thinking.