This project is not covered by Drupal’s security advisory policy.
Signed Config Export lets a trusted remote client download a site's active configuration as a tar.gz archive over HTTPS, without shell or admin access. Each request carries a single-use Ed25519 signature in a request header, bound to the site URL and a timestamp. The site stores public keys only.
Use it to compare production configuration with your code base, to feed configuration to CI or review tools, or to audit environments you cannot log in to. A ready-to-use bash client ships with the module.
Features
- Exports every configuration collection in core's export layout, read straight from the active storage. Export transformations (Config Ignore, Config Split) are not applied.
- Redaction rules replace secrets such as mail or API passwords with
[redacted]. - Keys can be generated by the client (only the public key is registered) or by the site (the private key is downloaded once and never stored).
- Keys are bound to the environment: a key copied with a database dump does not work.
- Replay protection, clock-skew check, flood control, uncacheable responses and a uniform 404 for every rejection.
- Admin UI for keys, audiences and redaction rules, with settings.php overrides.
- Status report rows for anything that would make exports fail.
- Bundled client
scripts/sce-export.sh: needs only bash, curl and OpenSSL 3; runs on Linux, macOS and WSL.
Requirements
- Site: Drupal 10.4, 11 or 12; PHP 8.1+ with the
sodiumandzlibextensions; a non-empty$settings['hash_salt']and configured$settings['trusted_host_patterns']. - Client: bash, curl and OpenSSL 3.0 or later (or any Ed25519 implementation of your own).
Installation
composer require drupal/signed_config_export drush en signed_config_export
Grant the restricted permission Administer signed config export only to trusted administrators: anyone holding it can create a key that downloads the whole configuration.
Setup on the site
Repeat on every environment (production, staging, ...): keys and audiences are not deployed with configuration.
- Go to Configuration → Development → Signed config export → Settings (
/admin/config/development/signed-config-export/settings). - Under Audiences, enter the site URL exactly as the client will call it, e.g.
https://www.example.com(no trailing slash). - Under Redacted values, list the configuration values that hold secrets, e.g.
smtp.settings: [smtp_password]. Click Save configuration. - Check Reports → Status report: rows titled "Signed Config Export" list anything that would still make exports fail.
Setup on the client
The client is the machine that downloads the configuration: a laptop, a CI runner or a server.
-
Check that
openssl versionprints OpenSSL 3 or later. On macOS the systemopensslis LibreSSL, so install OpenSSL with Homebrew and point the script at it:brew install openssl export OPENSSL="$(brew --prefix openssl)/bin/openssl" -
Create a working directory outside any git repository and a key pair in it:
mkdir -p ~/sce/www.example.com && cd ~/sce/www.example.com "${OPENSSL:-openssl}" genpkey -algorithm ed25519 -out private.pem chmod 600 private.pem "${OPENSSL:-openssl}" pkey -in private.pem -pubout -out public.pem -
On the site, Keys tab → Register public key: enter a label, an expiry date and the whole contents of
public.pem, then click Register. -
Copy the client script that ships with the module into the working directory:
MODULE=/path/to/drupal/web/modules/contrib/signed_config_export cp "$MODULE/scripts/sce-export.sh" . && chmod +x sce-export.shWithout access to the code base, save the listing from the Client script section of the README as
sce-export.sh. -
Download the configuration. The script prints
Saved config.tar.gz:./sce-export.sh https://www.example.com private.pem config.tar.gz -
Unpack the archive and compare it with the configuration in your code base:
mkdir -p config && tar -xzf config.tar.gz -C config diff -ru /path/to/project/config/sync config
For cron or CI, store private.pem as a secret file of the job, never in the repository, and run the same script: every run signs a new request. Use a separate key per job so one can be revoked without touching the others.
Security
- The archive holds everything stored in configuration unless you configure redaction. Keep private keys and downloaded archives out of git and treat them as secrets.
- The endpoint answers HTTPS only; every rejection returns the same 404, so the reason is not revealed.
- To rotate a key, register the new one, switch the client over, then delete the old one.
Similar projects
Core's configuration export pages and drush config:export need an administrator login or shell access, and apply export transformations. This module serves the raw active configuration to a machine client that has neither.
Documentation
The README covers every setting, settings.php overrides, the request protocol for writing your own client, response codes and troubleshooting.
Project information
- Project categories: Automation, Developer tools, Import and export
- Created by yakovdevel on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
