Giter VIP home page Giter VIP logo

betterkit's Introduction

Alternative to polkit based on DBus and systemd-run

Design

  • Define a set of actions (commands) that will be executed via systemd-run.
  • Define a set of rules that grant access to those actions to users based on various conditions (logged-in locally, system administrator, etc.).
  • Run as a privileged system daemon that will execture the action for users if they match the rules.

Security

  • Limited parsing of untrusted data
  • Declarative and easy to understand configuration syntax for actions and rules
  • Actions are run fully un-privileged and confined by default: privileged access is opt-in
  • No SUID binary
  • Clear logging of which user requested which action and which rules enabled it
  • Written in pure safe Rust

Example

$ cat /usr/lib/betterkit/actions/rpm-ostree.conf
[Action]
Id=org.coreos.rpm-ostree.rollback
Description=Roolback to previous deployment with rpm-ostree
Command=rpm-ostree rollback
User=root
Access=dbus-system

$ cat /usr/lib/betterkit/rules/rpm-ostree.conf
[Rule]
Action=org.coreos.rpm-ostree.rollback
Group=wheel
Result=Accept

[Rule]
Action=org.coreos.rpm-ostree.rollback
Active=true
Result=Ask

Current status

Currently only working with the session bus:

$ cargo run -- -v --user
[INFO  deadend] Received: Signal NameAcquired from org.freedesktop.DBus
[INFO  deadend] Received: Signal NameAcquired from org.freedesktop.DBus
[INFO  deadend] Writing MOTD with reason: Test
[INFO  deadend] Successfully wrote MOTD
$ busctl --user call --json=pretty -- org.betterkit /org/betterkit/betterkit1 org.betterkit.betterkit1 Run as 2 "ls" "-alh" | jq -r ".data[0]"
$ busctl --user call --json=pretty -- org.betterkit /org/betterkit/betterkit1 org.betterkit.betterkit1 Get t 6 | jq -r ".data[0]"

betterkit's People

Contributors

travier avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.