Giter VIP home page Giter VIP logo

Comments (4)

woodruffw avatar woodruffw commented on June 3, 2024

Alternative idea: use an agent-style architecture:

  • kbs2 --agent asks for the master password and runs in the background with the unwrapped key in memory
  • Subsequent kbs2 invocations check for a Unix domain socket based in part on the keyfile name, and use that to temporarily grab the unwrapped key

Pros:

  • Lots of decent reference material (ssh-agent)
  • Same threat model as the current approach (an attacker with the same or greater permissions as the current user can steal the wrapped key, but an offline attacker can't)
  • Probably simpler than the current SHM mess
  • Actually ends the "session" on user logout, which is more intuitive than the current behavior

Cons:

  • Requires a background process
  • Requires messing with Unix domain sockets in Rust

from kbs2.

woodruffw avatar woodruffw commented on June 3, 2024

Ratcheting down the security of an agent-style approach: kbs2 --agent would be run from the same underlying executable as any subsequent kbs2 calls, so the executable path could be a some authenticity check for the client. That doesn't stop someone from replacing the kbs2 executable with something malicious, though.

Braindump:

  • Linux supports SO_PEERCRED for getting the PID of a Unix socket client
  • macOS appears to support getpeereid(3) and LOCAL_PEERCRED for the same purpose
    • Edit: getpeerid/LOCAL_PEERCRED only does uid and gid for some reason. Annoying. Apparently LOCAL_PEERPID works, but is undocumented.

Then, from the client PID:

from kbs2.

woodruffw avatar woodruffw commented on June 3, 2024

More braindump:

  • kbs2 --agent does a checksum of its own executable on startup
  • After resolving the executable path of the client requesting the unwrapped key, do a checksum of that path's contents
  • If the checksums match, allow the connection

Downside:

  • Different versions of kbs2 running on the same host won't be able to talk to the same agent.

from kbs2.

woodruffw avatar woodruffw commented on June 3, 2024

#103.

from kbs2.

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.