Giter Club home page Giter Club logo

Comments (2)

limulus avatar limulus commented on June 20, 2024 3

If this is true, how do I properly secure user credentials so only my app can access them?

Unfortunately I am not sure there is a particularly satisfactory answer to this question. But from what I can figure you need to:

  1. Distribute your app with its own node binary.
  2. Lock that node binary down so it only executes your app’s scripts.
  3. Ensure the trusted application in the ACL for the Keychain items encompasses your node binary and your app‘s scripts and deps.

My understanding is that keytar was mainly developed for Electron applications, so when used in an Electron context it is getting all three of those by default (though I wonder about 2).

Unfortunately, I suspect CLI apps on macOS cannot be application bundles, so 3 is only possible with keytar if you somehow include all your application and scripts inside the executable binary itself. If you forego keytar, and instead call Keychain Services directly, it might be possible to specify a path for the trusted application that minimally encompasses your node binary an application scripts.

Anyway, as you’ve found keytar is definitely not ideal for CLI apps, especially those distributed via npm. But I’m not sure if there is a better alternative, either. In any case, I agree that it would be a good idea to ensure this trade-off for CLI apps is documented.

from node-keytar.

pg07codes avatar pg07codes commented on June 20, 2024

@glebec i have a similar requirement as yours and i have been searching for ways to store users credentials in keychain. Now, that you have pointed out such a major flaw, i am not sure i should use keytar at all. It would be really helpful if anyone could explain how it can possibly be done using hasing, salting or anything else like that.

from node-keytar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.