Search by

grommasdietz / kirby-sudo

grommasdietz

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

Documentation

Type:kirby-plugin

pkg:composer/grommasdietz/kirby-sudo

Statistics

Installs: 7

Dependents: 0

Suggesters: 1

Stars: 4

Open Issues: 0

1.1.0 2026-12-01 12:37 UTC

This package is auto-updated.

Last update: 2026-12-04 08:53:36 UTC


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.

Cover image showing an example of the plugin in use

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

  1. 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.menu option can protect an area in its menu entry instead:

    'panel' => [
        'menu' => [
            'site' => ['label' => 'Overview', 'sudo' => true],
            'users',
        ],
    ],
  2. Protect a page, the site, a user or a file with sudo: true in 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
  3. 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