grommasdietz / kirby-sudo
Sudo mode for Kirby CMS: confirm it is you with a passkey, authenticator code or password before sensitive Panel content opens
Package info
github.com/grommasdietz/kirby-sudo
Type:kirby-plugin
pkg:composer/grommasdietz/kirby-sudo
Requires
- php: ^8.3
- getkirby/composer-installer: ^1.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.93
- getkirby/cms: ^6.0
- phpunit/phpunit: ^12.5
- vimeo/psalm: ^7.13.2
Suggests
None
Provides
None
Conflicts
- getkirby/cms: <6.0 || >=7.0
Replaces
None
README
Lock sensitive parts of the Kirby CMS Panel until the signed-in user confirms it is them with a passkey, an authenticator code or their password. Protect pages, fields, Panel areas and API paths to keep sensitive data off an unattended or shared screen.
Every protected view shows Unlock in its header while it is locked. The Panel menu shows whether the session is unlocked, counts down and locks again. After a configurable time without activity, the Panel locks again in every browser tab, and a locked session never receives protected values.
Requirements
- Kirby 6
- PHP 8.3+
Installation
composer require grommasdietz/kirby-sudo
Tip
For a manual install, download the Source code (zip) archive of a GitHub release and copy it to site/plugins/kirby-sudo.
Quickstart
-
Protect Panel areas in
site/config/config.php, for example Kirby's own users and system views:return [ 'grommasdietz.sudo' => [ 'areas' => ['users', 'system'], ], ];
A site with its own
panel.menuoption can protect an area in its menu entry instead:'panel' => [ 'menu' => [ 'site' => ['label' => 'Overview', 'sudo' => true], 'users', ], ],
-
Protect a page, the site, a user or a file with
sudo: truein its blueprint. On a single field, it protects only that field:# site/blueprints/pages/contract.yml title: Contract sudo: true
# site/blueprints/site.yml fields: apiKey: type: text sudo: true
-
Open a protected view in the Panel and choose Unlock in its header. The menu, right above Log out, counts down while unlocked.
Use strict instead of true to ask again on every visit. A strict unlock ends as soon as the user leaves, or with Lock in the view's header.
sudo: strict
Other plugins
Plugins with built-in support protect their own areas as soon as Kirby Sudo is installed. Kirby Blueprint Areas reads sudo in its area blueprints, for a whole area or single fields. Any other Panel area is protected with the areas option or its panel.menu entry. See areas from other plugins.
To add sudo mode to your own plugin, see plugin integration.
Documentation
- Usage: What can be protected, strict unlocks and how unlocking works
- Configuration: Options, blueprints, areas, API paths, the view and menu buttons and hooks
- Plugin integration: Add sudo mode to a plugin's areas, routes and views
- Security model: What sudo mode guarantees and where it stops
All guides, including contributions and maintenance, are listed in the documentation.
Project information
License
MIT © 2026 Grommas Dietz
