A secure and minimal PolicyKit authentication agent designed for lightweight and embedded Linux environments. It provides a secure, modular and customizable way to interact with PolicyKit authorization requests via external prompt tools.
Benchmark | |
---|---|
Language | C |
Lines of Code | 307 |
Memory Usage (RSS) | ≤5.6 MB |
Startup Time | ≤15 ms |
Authentication Latency | ≤40 ms |
Process Count | 1 |
D-Bus Roundtrips | 1 |
When PolKit requests authentication, mini-polkit runs your command, reads the stdout as the password, then securely passes it to PolKit via D-Bus — thats it :3
To show the PolKit message inside your prompt, use {{MESSAGE}}:
mini-polkit "zenity --password --title='{{MESSAGE}}'"
As long as your tool writes the password to stdout, you're good.
Run mini-polkit in the background (e.g. using &), to make it act as a full-time agent
mini-polkit "zenity --password" &
You can autostart it via .xinitrc, .bash_profile, systemd or whatever you like.
git clone https://github.com/cyber-amr/mini-polkit.git cd mini-polkit doas make install