Everything the scheduler of the target does with a backup – checking, restoring, mounting, scanning for viruses, counting, mirroring, exporting, cleaning up, forwarding, reporting – is done by modules. A module is a package with a program and a description (manifest), signed by AegisGrid or by a partner. The module ID is also the job type: command=aegisgrid.pruef-mount starts the module aegisgrid.pruef-mount. Receiving backups and the store are not part of it; a module can neither hold up a backup nor delete a run it is reading. docs/module-api.txt describes the complete interface.
Note: Since version 2.0 the modules of AegisGrid are called aegisgrid.<name> (before, <name> alone, such as pruef-mount). At its first start after the update the job planner rewrites the jobs in bkp_target_sched.cfg once to the new IDs; the file as it was stays beside it as bkp_target_sched.cfg.bak-<date> (message AG-34899, entry module-ids in the audit log). Afterwards only the new IDs count: a job written by hand with the old name is refused, with the new ID as the next step.
14.1 Built-in and installed modules#
The modules of AegisGrid come with the target (“built-in”, kept under /usr/lib/aegisgrid/modules). They are updated with the target and can be unloaded but not deleted:
| Module | Task |
|---|---|
aegisgrid.pruef-restore, aegisgrid.pruef-fsck, aegisgrid.pruef-mount, aegisgrid.pruef-virus, aegisgrid.pruef-count, aegisgrid.pruef-vm-start, aegisgrid.pruef-vm-stop, aegisgrid.pruef-unmount, aegisgrid.pruef-delete | the steps of the check restore (Chapter 12): restore, check file systems, mount, scan for viruses, count files, start and stop VMs, clean up |
aegisgrid.pruef-report | sums up all checks of a chain run in one report (report.json, report.html, evidence) |
aegisgrid.maint-scrub, aegisgrid.maint-prune, aegisgrid.maint-mirror, aegisgrid.maint-export | maintenance of the stores (Chapter 11) |
aegisgrid.otf-forward-target, aegisgrid.otf-forward-s3 | forward every backup to another target or to S3 storage as soon as it is complete |
aegisgrid.otf-encrypt, aegisgrid.otf-restore | encrypt or restore while a backup comes in (saved, not in effect yet in this version) |
aegisgrid.exec | a program of your own (param.program=, arguments in param.arguments=) |
Installed modules are put on the server by the operator: modules of partners, modules of their own or single newer versions. They are kept under /var/lib/bkp_target/modules/<id>/<version>/. Their ID always has the form <vendor>.<name>, for example acme.hashlist; IDs of the form aegisgrid.<name> belong to AegisGrid.
Every version has a state:
| State | Meaning |
|---|---|
| loaded | jobs with the module run; the console offers the job type |
| installed / unloaded | is on the server, jobs with it do not start; running runs still end |
| quarantine | unloaded by the target itself because the module crashed several times in a row; stays so until it is loaded again by hand |
| waits for consent | came with the update and may do more than the loaded version (for example network); until it is loaded with consent the jobs use the loaded one |
| invalid | is never loaded: package or signature damaged, key not trusted, right missing in the license, server without a sandbox; the reason is in the column “Note” or in --module-info |
Jobs of an unloaded module stay in the configuration and appear like switched-off jobs with the reason “module not loaded”; once it is loaded again they run without any change.
14.2 Managing modules#
Loading, unloading and the trust list are administrative actions: on the command line only as root, in the target console only with an admin token. Every change is written to the audit log (kind module-change); the scheduler takes it within a few seconds.
bkp_target --module-list # every module and version
bkp_target --module-info acme.hashlist # one version in detail, with rollout
bkp_target --module-trust-add acme.pub --name acme # trust the key of a partner
bkp_target --module-load acme.hashlist-1.0.0.agm # check a package; a partner module first lists its permissions
bkp_target --module-load acme.hashlist-1.0.0.agm --accept-permissions # confirm them, install, load
bkp_target --module-unload acme.hashlist # unload (its jobs stand still)
bkp_target --module-delete acme.hashlist@1.0.0 # delete an unloaded version
bkp_target --module-trust-remove 2fb9c0c6e0efaa17 # no longer trust the key
Installing and looking at a partner's module
# bkp_target --module-trust-add acme.pub --name acme
Partner key 2fb9c0c6e0efaa17 added to the trust list.
# bkp_target --module-load example.hello-1.0.0.agm
example.hello 1.0.0 may do this on this server:
- It cannot use the network.
- It runs under the service account in a sandbox: it sees only its own folder, its work folder and what it is handed.
- It needs the right module.example.hello in the license of this target.
…
Check these permissions and load it with --accept-permissions.
# bkp_target --module-load example.hello-1.0.0.agm --accept-permissions
example.hello 1.0.0 installed.
example.hello 1.0.0 loaded; the scheduler takes it within a few seconds.
# bkp_target --module-info example.hello
example.hello 1.0.0
Hello report
Writes a short greeting into its work folder and reports it as evidence.
state: loaded
since: 2026-11-14T12:42:41+01:00
origin: installed
signature: partner acme
vendor: Example
runs as: the service account
folder: /var/lib/bkp_target/modules/example.hello/1.0.0
When loading, the target checks the package completely: every file against its checksum, the signature against the trust list, the manifest strictly (unknown entries are an error), for partner modules the green report of the conformance test for exactly these files and the right module.<id> in the license of the target. Without the right the module stays “invalid” until it is ordered at AegisGrid or the partner and the license is renewed (bkp_license renew). The texts of a partner's module are English in this version.
14.2.1 Trust and signature#
Modules of AegisGrid are signed with the built-in key (“signed by AegisGrid”). The key of a partner (Ed25519, one line of Base64, file <name>.pub) is added to the trust list explicitly by the operator; after that the target loads the modules signed with this key. If the key is removed, the target no longer loads these modules. Unsigned modules are loaded only with allow-unsigned-modules=yes in the section [modules] of bkp_target.cfg – meant for developing a module of your own; console and web interface then show this as a lasting warning.
14.2.2 Sandbox#
Every module without the signature of AegisGrid runs in a sandbox: under the service account instead of root, with namespaces of its own, Landlock, seccomp and without privileges. It sees only the system libraries, its module folder, its work folder and the data the job hands to it – never /etc/bkp, the storage or the work folders of other modules, and without network unless it needs it explicitly. This needs Linux 5.13 or newer on the server; an older kernel does not load such modules and says so.
If a module wants to read or write further paths of the server (sandbox.extra_read/extra_write in the manifest), the target names them when loading and the operator confirms them (--confirm-paths or the question of the console); without confirmation it does not load (AG-34704). A partner's module runs as root only if the operator allows it with module-allow-root=<id> in [modules].
Some modules run under the service account but let a job start them as root at the job's request (run-as=root in the job, for example with aegisgrid.exec or the maintenance jobs). The overview of the rights lists this as a right of its own: “A job may ask to run it with full administrator rights (root, run-as=root).” For a partner's module this, too, needs module-allow-root=<id>; without it such a job does not start, and the overview says so. A module without this right refuses run-as=root when the job is saved.
14.2.3 New versions and rollout#
Several versions of a module may be loaded at the same time. A job takes the newest one, unless it names module-version=1.2.0 (exactly this one) or module-version=1.x (the newest with major version 1). To try a new version on some jobs first, load it with --rollout <job>,<job>: only these jobs take it. If it fails there, after at least 5 runs, more than 20 percentage points more often than the old one (rollout-min-runs=, rollout-max-worse=), the target switches the jobs back by itself and reports this in the server state. Otherwise it stays so until the operator finishes the rollout (every job takes the new version, --module-rollout-finish) or aborts it (--module-rollout-abort).
Every module of AegisGrid has a version of its own (column “Version”; “What’s new…” shows the changes). The target package brings them signed; at its start the job scheduler takes new versions over into /usr/lib/aegisgrid/modules, checks signature and checksums and loads them. If a new version may do more than the loaded one, the target does not load it by itself: it is listed with the state “Waits for consent”, the server state shows a note, and the jobs keep using the loaded version until the operator checks the rights and loads it (--module-load <id>@<version> --accept-permissions). If the operator unloaded a module, the new version stays unloaded too. Older versions that no longer come with the target are removed – unless a job names them with module-version=. What was taken over is in the job scheduler log and in the audit log (“module-shipped”).
14.2.4 Quarantine#
If a module crashes quarantine-after= runs in a row (default 3), the target unloads this version and puts it into quarantine (AG-34020). A finding the module reports – say a virus found or an error in a file system – is a result, by contrast, not a fault of the module, and so are a timeout and a stopped run. The quarantine appears in the server state (mail to the operator, never to customers) and ends only when someone loads the module again – after an update or once the cause is fixed.
Key in [modules] (bkp_target.cfg) | Default | Meaning |
|---|---|---|
modules= | yes | module host on; with no the job types run as built in, installed modules do not |
allow-unsigned-modules= | no | load unsigned modules (development) |
module-allow-root= | – | partner modules that may run as root (IDs, separated by commas) |
quarantine-after= | 3 | crashes in a row until the quarantine (1–100) |
rollout-min-runs=, rollout-max-worse= | 5, 20 | limits for switching a rollout back |
stream-ring-mib= | 64 | buffer for modules that see a backup while it comes in (8–1024 MiB) |
auto-update= | yes | new module versions from the module channel: yes takes them over, notify only offers them, no does not fetch them |
Changes take effect after POST /service/reload or a restart of the service.
14.3 New module versions without an update (module channel)#
New versions of modules do not only come with an update of the target: AegisGrid also publishes released modules in a separate, signed module catalog per channel (alpha, stable). bkp_updater reads it at every run on machines with the component “Target”, fetches the newest suitable version of each module and puts it into the incoming folder /var/lib/bkp_target/modules/incoming/; the job planner takes it over like a module that came with the target. Modules from AegisGrid always come, modules from partners only when the license of the target contains them or a version of them is on the target already. If a new version may do more than the loaded one, it waits for your consent as after an update; a module that was unloaded stays unloaded.
bkp_updater --modules # read the module catalog now and fetch new versions
bkp_updater --status # names the sequence of the module catalog read last
With auto-update=notify in [modules] the updater fetches new versions as well, but the target only offers them: the page “Modules” shows a row “Available” with the size, the server state the note “newer module version is ready to load”, and “Load...” (or bkp_target --module-load <module>@<version>) installs it. With auto-update=no the updater does not read the module catalog.
If AegisGrid withdraws a version, the target unloads it at the next run of the updater; the jobs take the version before it, and the server state warns that AegisGrid withdrew the version. If there is no version before it, the jobs of this module stand still until a corrected version comes. Without a network everything stays as before: modules come with the target package or through “Upload...”.
14.4 Modules in jobs#
A job uses a module with command=<module-id> in bkp_target_sched.cfg. Added to this are the parameters of the module as param.<name>= – the scheduler checks them against the manifest (type, range, required; unknown names are an error) – and, as for every job, trigger, limits and mail. Modules that go on working with the results of another job dock at its ports: aegisgrid.pruef-fsck at the restored disk of aegisgrid.pruef-restore, aegisgrid.pruef-mount at its partitions and so on. What is docked starts by itself once the job before has provided it; mounts, images and work folders are released by the target when no job needs them any more.
Check chain as modules: restore, check, mount, viruses, report
[pr-restore]
command=aegisgrid.pruef-restore
on=backup-success
match-name=srv01
dock=backup:run
param.work-dir=/srv/pruefrestore
[pr-fsck]
command=aegisgrid.pruef-fsck
dock=pr-restore:scsi1 # the disk scsi1
[pr-mount]
command=aegisgrid.pruef-mount
dock=pr-fsck:scsi1/* # every checkable partition, one run per partition
[pr-virus]
command=aegisgrid.pruef-virus
dock=pr-mount:scsi1/*
[pr-report]
command=aegisgrid.pruef-report
dock=pr-virus:** # collects every result
after-mode=finished # also when a check failed
| Key | Meaning |
|---|---|
command=<module-id> | the module; any loaded module ID |
param.<name>= | a parameter of the module; empty or missing parameters take the module's default |
dock=[<input>=]<job>:<pattern> | binds an input to ports of a job before or to backup (the backup itself, backup:run); * stands for one piece of the path, ** for any number, several patterns separated by commas |
after-mode= | with dock=: finished starts the job also when a port failed (reports), failed only then |
when=<expression> | condition on the ports, for example src.data.fs != "swap"; otherwise the run ends “skipped” |
keep=yes|no | keep provisions (mounts, images) or release them right after the last user; without it as the module says |
module-version= | a fixed version or <major>.x |
on=<module-id>:<event> | starts the job when a module reports this event (only modules that declare events) |
For module jobs dock= replaces after=; both together are an error. Check jobs in the earlier form (param.path=, run-as=root, after= between the steps, up to 2.0.0-alpha.084) are rewritten into chain form once by bkp_target at the first start after the update; the old file stays beside it as bkp_target_sched.cfg.bak-<date>. What cannot be rewritten unambiguously is commented out in the file with the reason and needs to be set up again as a chain in the console. bkp_target --sched-validate shows beforehand what it becomes. What a job has provided and still holds is shown by GET /sched/ports or in the console under “Provisions...”; it can also be released there by hand, for example a mount kept with keep=yes.
14.4.1 Chains: error branch, branches, confirmation, deadline#
Every run of a chain step learns what the steps before it delivered: their ports, their result (verdict, summary, figures, findings) and the chain notes a step leaves for later ones. This lets a chain branch without any module having to know about the others:
| What | How |
|---|---|
| Error branch | dock=<job>:failed – the job runs only if <job> fails or is stopped, for example a cleanup or reporting step. The graph draws the line in red (“if it fails”). |
| Branches | A module with branches chooses an output during its run (e.g. aegisgrid.pruef-virus “clean” or “infected”); dock=<job>:<branch> runs only on that path, the steps at the other one are skipped. |
| Condition | when= also checks results and notes of earlier steps: when=results.check-count.verdict == "ok" or when=notes.ticket != null; otherwise the run ends “skipped”. |
| Confirmation | aegisgrid.confirm holds the chain until a person confirms or declines in the console or the web interface (the mail with the question links there) (param.question=, param.wait= up to 6 days, param.on-timeout=stop|confirm|decline). It continues at “confirmed” or “declined”. A waiting step takes no place of parallel-jobs=; the waiting time goes on across a restart of the target. |
| Deadline | chain-deadline=4h (or a time such as 07:00) at the first job of the chain: if the chain run is not done by then, the remaining steps are stopped or left out; cleanup steps still run for chain-deadline-cleanup= (default 30 minutes) so that nothing stays mounted or switched on. |
| Restart from here | If a step failed, “Restart from here” runs it again with the same data, and the steps after it as well; a long restore before it does not run again. This works for rerun-hold= (section [sched], default 24 hours); for that long the target holds back what the step was given. |
In the target console, “Chain runs...” in the menu of a job shows the chain runs of the last 40 days with every step, its result, its notes and the files it handed over (“Save...”); “Restart from here”, “Confirm”, “Decline” and the log are there as well. “Deadline for the chain run...” sets chain-deadline=. The web interface has the page “Chain runs” for this; the overview and the job list show where a decision is waiting. When saving, the target points out if a mount, an image or a VM would remain after the chain because no step ends it, and the console adds the matching cleanup step with one click.
14.4.2 Modules per customer#
Only the modules a customer's data allow may work on that customer's backups: modules= in the section [kunde:<id>] of target-customers.cfg, for grants to other accounts in [konto:<A-…>]. The default is builtin (every module of AegisGrid); the operator enables partner modules for each customer explicitly, * allows every loaded one. The customer dialog of the console leaves the line as it is.
Enabling a partner's module for a customer
[kunde:mueller]
name = Müller GmbH
dirs = mueller/***
modules = builtin, acme.hashlist
A run on a backup of a customer without this permission does not start; it ends “skipped” with “The module … is not enabled for …” (AG-34070) and the next step. Every run of a module is reported with its usage (duration, CPU, memory, data read, space held, customer) to the license server at the next bkp_license renew; points and prices are calculated by the license server alone.
14.5 Modules with points#
Most modules cost nothing. For single modules or for packages of several modules, AegisGrid can set points in the license server: in general, for the customers of a partner or for a single account. The price is kept in the license server, not in the module; changing it needs neither an update nor a new module. As delivered, no price is entered: every module is included, nothing needs booking, and everything runs as before.
| Price | What counts |
|---|---|
| per backup | every backup (one computer or VM in the store) a run of the module worked on in the last 7 days, once, however often. Runs ending OK, warning or failed count (a failed check is a result, too); skipped runs and runs stopped before reading do not. |
| per target | the target once, if the module had at least one run on it in the last 7 days |
- Packages: A signed module can belong to a package (
license.packin the manifest); the package then has the price. A backup several modules of one package work on counts once for the package. The built-in modulesaegisgrid.pruef-vm-startandaegisgrid.pruef-virusmake up the package “Check Plus” (pack.aegisgrid.pruef-plus); the other checks, maintenance and forwarding belong to no package. - One pot per account: The points of all modules and packages of an account are added up exactly and rounded up to whole points once: two modules at 0.5 points each cost 1 point together, three cost 2 points. The pot is not combined with workstations, M365 or network shares.
- Booking: A module or package that costs the account more than 0 points runs only when it is booked, so no costs arise that nobody ordered. It is booked and cancelled in the portal (portal.aegisgrid.de) under “Licenses” › “Packages”, by the account itself, its partner or AegisGrid. A cancellation takes effect at the end of the month; until then it stays booked. In the demo everything counts as booked and is included in the points of the trial.
- Not booked: A job with such a module can be created and saved; its runs, however, end “skipped” with a note naming the package the module belongs to and where to book it. This is not an error. If the job ran before, the target reports the change once by mail to the admins.
- Price changes: A new price applies from the first day of the next month; the accounts affected get a mail with the new price beforehand. A booking stays valid. What cost nothing so far and will cost something counts as not booked from that day until the account books it (booking is possible before).
- Who pays: On an own target the account of the target pays, so a reseller also pays for the backups of its customers; the consumption report lists the module points per customer so that it can charge them on. On a public target run by AegisGrid the account the backup belongs to pays.
- Limit: If a module run of a trial would bring new units beyond the points, it does not start (skipped, with the points). A purchased license only gets a note.
- A module that belongs to a package needs a target from version 2.0.0-alpha.076; older targets refuse its manifest.
14.6 The page “Modules” of the target console#
“View” › “Modules” shows every version of every module in one line: module, version, title, kind, origin (built-in, with an update, from the module channel or uploaded), signature, state, since when and a note – for example the reason for “invalid” or the quarantine. Above it the page says whether modules are switched off on the target or unsigned ones are allowed. A double click or “Details...” shows everything from --module-info: vendor, right in the license, sandbox and further paths, runs as, crashes in a row and the jobs in a rollout.
If the module channel offers a newer version (auto-update=notify), it appears with the state Available above the versions of the module; “Load...” asks and installs it. A version withdrawn by AegisGrid has the state Withdrawn and cannot be loaded.
The column License says what the module costs this account (section “Modules with points”): “Included”, a price such as “0.25 points per backup” or “Not booked”. The details add the right with its package, since when it is booked, until when after a cancellation and a price that applies from the first day of the next month. When a job with a module that is not booked is saved in the job dialog, the console first says that its runs are left out until it is booked and where to book it.

With an admin token:
- “Upload...” chooses a package (
*.agm), transfers it in pieces and installs it; afterwards the console asks whether to load it right away. - “Load...” loads the selected version (also after a quarantine). If the module wants to see further paths, the question names each of them; it is loaded only after the confirmation.
- “Unload...” unloads the version; its jobs stand still, running ones still end. The console shows such jobs like switched-off ones with the state “Module not loaded” (or “Module in quarantine”, “Module not usable”), without a next start and without “Start now”; their settings are kept, and once the module is loaded again they run on schedule. In the context menu: “Delete...” for an unloaded installed version, “Finish rollout...” and “Abort rollout...”.
- “Provisions...” shows what module jobs provide right now (mounts, folders, images) and releases the selected one.
- “Trust list...” shows the keys whose modules the target loads and adds partner keys (name and public key) or removes them; the key of AegisGrid is always valid.
Only the command line and the target API start a rollout. F1 on the page opens this section.
14.6.1 Creating jobs with modules#
In the job dialog (“New...” in the area “Scheduler/On the fly”) the list of templates offers the templates of all loaded modules, ordered by category – those AegisGrid ships as well as those of partners (manifest key ui.templates). A template fills in all lines: command=, when the job runs (schedule=, on= or after=) and the parameters param.<name>=. A module without templates appears as “Module: <title>”; this template sets command= and – if the module expects a backup as input – dock=backup:run, otherwise on=backup-success.
The template “Check the blocks every week” (check-weekly) checks only what was added since the last check (param.only-new=yes, everything on its first run) – unlike the default job of the same name from bkp_setup, which reads every object each Sunday. For the full check clear “Only what is new” on the module's page. Templates that work with the result of another job (dock= or after-mode=, such as the steps of the check chain) belong behind that job: the dialog says so when one is chosen; the easiest way is to drag the building block onto the box of the job before it in the graphic.
The dialog has three kinds of tabs: “General” names the kind of job, the schedule in words with the next starts and what the server lacks for the module; then follow the pages of the module (those of its job dialog and those of the dialogs of its menu items, for example “Options...”): per parameter an edit field, a choice or a check box with label and help from the module, the default as a grey placeholder, rarely used parameters under “Advanced”; what does not apply right now is greyed out. “Text” shows all lines as they are in the configuration. Both views stay in step: what you set on a page is in the lines when you switch, and changed lines fill the pages anew. The pages check required fields, number ranges and absolute paths; empty fields are left out. When saving, the server checks once more against the manifest.

The web interface of the backup server offers the same: “New job” on the page “Scheduler” leads through module, template, the pages of the module and when the job runs; “Change...” on a job opens the pages of the module. “New job as text...” and “Change as text...” show the lines themselves.
Moving from args=. Up to version 2.0 the settings of the shipped jobs were a command line in args= (for aegisgrid.exec in program=, for the forwardings in dest=). bkp_target rewrites such a configuration once into param.* at its first start, keeps the old file as <file>.bak-<date> beside it and records the change in the audit log; args=--store {store} --only-new, for example, becomes param.store={store} and param.only-new=yes. Switches without a parameter of their own go into param.options, nothing is lost. After that args=, program= and dest= are an error that names the matching parameter; the target API answers them with 400. Which parameters a module has is shown by bkp_target --module-info <id>. The scheduler on the clients (bkp_sched) keeps args=.
Note: Parameters a module marks as secret are only hidden by the edit field; in the job configuration they are plain text like every line. Keys and passwords therefore belong in key= or a parameter of the type key as file: or kms: – the target reads them itself and hands them to the module only through its key service, never into logs or answers of the API.
14.6.2 Modules as building blocks#
The list “Building blocks” of the graphical view of the target console (Chapter 17) shows every module whose manifest describes a building block – your own and partner modules too. Group and order come from the target: ui.category (check, maintenance, copy, reports, other) and ui.order from the manifest, the symbol from ui.icon. A building block whose module cannot run right now stays grey in the list; the tooltip names the reason and the next step (for example “Module not loaded – load it in the “Modules” tab.”), and dragging it or pressing Enter explains the same instead of creating a job. When a check chain is inserted, steps of unusable modules are left out.
Dragging a partner building block onto a backup or a job (or selecting the box and pressing Enter on the building block) makes the console ask the target at which points the module can dock (POST /sched/dock-check); with several it offers the choice, then it opens the wizard of the module or its pages. Only “Apply...” writes the new job.
The target does not create a new job with a module that is not loaded or not usable: the console reports “A module that is needed cannot run on this server right now, so nothing was created.” with the reason under “Details”. Existing jobs can still be changed, switched off and on, and deleted. The web interface shows the same state in the job list and blocks “Start” there.
14.6.3 What a module brings to the console and the web interface#
A module describes its own operation; the target console and the web interface show it the same way for modules from AegisGrid and from partners. Which parts a module uses is up to its maker:
| Place | What the operator sees |
|---|---|
| Box in the graphic | title, one line with the main settings and, after the run, a summary (“3 lines written”); the colour shows the result (green passed, amber warning, red finding) |
| Context menu of the box | after “Last runs” the items of the module – actions, dialogs (with “…”) and confirmations –, then “Metrics…”, “Results…” and “Help for the module”; items that need a stopped job are grey otherwise |
| Dialogs | dialogs of its own with pages, sections, buttons and choice lists the module fills itself; checked on saving like the job dialog |
| Templates | ready-made jobs in the list of templates of the job dialog and in the wizard of the web interface, for example “Copy every backup to another target” |
| Assistant | “Job › New…” or “New job” in the browser leads page by page through the settings of modules that have an assistant |
| Settings | values for all jobs of a module, on the “Modules” tab under “Settings…”; the target stores secret values encrypted and shows them as “***” |
| Results | a table per run with filter and details, and metrics over the last runs with warning thresholds |
| Help | F1 in the module’s dialog and “Help for the module” open the maker’s help; “What’s new…” on the “Modules” tab shows the changes of each version |
| Mails | events of a module with a mail of their own; switched on and off per event on the “Modules” tab under “Event mails…”, to customers only about their own backups |
A module’s self-test runs when it loads and on request with “Check now” on the “Modules” tab; a failure appears there as a note with the next step. Before a partner module loads for the first time, a person confirms its permissions (network, paths, root); the audit log records the confirmation.
14.7 Messages and mails#
- History and job log name every run with module, version, result and the texts of the module; evidence of a module goes into the audit log and the evidence reports (Chapter 13).
- Module events (
betreiber-modulereignis, to the operator only): once per run when a module reported warnings or errors, with every point it reported.operator.modulereignis=noin[mail]switches the mail off. - Server state (to the operator only): quarantine of a module, the automatic switching back of a rollout and a provision that could not be released even after the last attempt (AG-34611).
- Customers learn about their backups through the known mails (error, check restore report, virus found) and through notices to their client (at most 5 per run); they never get module events or the server state.
14.8 Developing modules of your own (SDK)#
Partners and customers write modules of their own with the module SDK (update component module-sdk, Linux only). A module is a program in any language that the module host of the target starts for every operation and talks to through the protocol BKPM: JSON messages over a socket. The SDK contains:
| Folder | Content |
|---|---|
docs/ | the module API (module-api.txt), the module surface (module-ui.txt) and the schemas of every interface |
python/bkpm.py | BKPM for modules in Python (standard library only) |
c/ | libbkpm for modules in C (BKPM, strict JSON) with a Makefile |
examples/python-hello/ | the example module example.hello in Python (guide README.md, module folder module/) |
examples/c-run-report/ | the reference module example.run-report in C (guide README.md, sources src/, module folder module/) |
bin/ | bkp_modtest (conformance test) and bkp_modsign (key, signature, package) |
14.8.1 Manifest and program#
Every module describes itself in module.json: ID (<vendor>.<name>), version, title and description, program and interpreter, operations, inputs (consumes), ports it provides (provides), parameters with type, default, limits and help, need of space and memory, evidence, the right in the license and time limits. Every text a person reads is a text object with an ID and the English text and is listed in lang/en.po.
module.json of the example module
{
"format": 1,
"api": 1,
"id": "example.hello",
"version": "1.0.0",
"vendor": { "name": "Example", "url": "https://example.com" },
"title": { "id": "example.hello:1", "en": "Hello report" },
"description": { "id": "example.hello:2", "en": "Writes a short greeting into its work folder and reports it as evidence." },
"kind": "process",
"program": "bin/hello.py",
"interpreter": "python3",
"protocol": "bkpm",
"operations": ["run"],
"params": {
"greeting": { "type": "string", "default": "Hello",
"label": { "id": "example.hello:3", "en": "Greeting" },
"help": { "id": "example.hello:4", "en": "The word the report starts with." } }
},
"capacity": { "space": "none", "memory_mib": 64 },
"evidence": { "kinds": ["example:hello"] },
"license": { "right": "module.example.hello" },
"timeouts": { "run_s": 60 },
"ui": { "category": "report", "icon": "job" }
}
The program opens the connection to the host, reads job, parameters and inputs, reports progress, log lines, evidence and the ports it provides, and ends with exactly one result. In Python:
Core of examples/python-hello/module/bin/hello.py (shortened)
import os
import bkpm
def run():
m = bkpm.open("example.hello", "1.0.0")
greeting = m.params.get("greeting", "Hello")
m.progress(0, 2, bkpm.text("example.hello:8", "Writing the greeting"))
if m.stopping():
m.result("stopped", "stopped", bkpm.text("example.hello:9", "Stopped before the greeting was written"))
return
with open(os.path.join(m.work, "hello.txt"), "w") as f:
f.write(greeting + "\n")
m.evidence("example:hello", "ok", bkpm.text("example.hello:13", "The greeting of the job {job}", job=m.job["name"]),
proof=[{"type": "report", "file": "hello.txt"}])
m.result("ok", "done", bkpm.text("example.hello:15", "The greeting for {job} is ready", job=m.job["name"]))
m.close()
bkpm.main(run)
Rules that bkp_modtest checks:
- write nothing to standard output – everything goes through BKPM;
- write only into the module's own work folder (
m.work); - a
failedalways with an understandable text and the next step; - end with
stoppedwithin 30 seconds when the host asks to stop; - get keys only through the key service of the host (
m.secret()) and never print them; - at most 5 notices to the client per run.
In the example bkpm.py lies beside the program (bin/), because a module in the sandbox sees only its own folder. A module in C uses libbkpm (cd c && make builds the library and the reference module).
14.8.2 Testing, signing, packing#
bkp_modtest starts the module like the target does, but without a target: package layout, manifest, texts, program, greeting, every operation, stop, broken inputs, refused services, mounts left behind and – as root on a server with Landlock – the same run in the sandbox of the target. Without root the sandbox check is listed as “skipped” in the report.
Conformance test of the example module
$ bkp_modtest --report conformance.json examples/python-hello/module
layout ok 5 files
manifest ok example.hello 1.0.0
texts ok 4 texts
program ok bin/hello.py
hello ok result "ok"
operations skipped the module has no operations besides run
stop ok ended in time with status "stopped"
inputs ok no crash, no protocol fault
host ok every service answered "denied" without a crash
release ok no mounts left behind
sandbox ok result "ok"
Report written: conformance.json
The module passed the conformance test.
Only a green report can be signed. The partner makes the signing key once; <name>.key is private and belongs offline, never in a repository or a module folder. <name>.pub goes to the operators of the targets for their trust list.
Making a key, signing and packing
$ bkp_modsign --keygen acme
New signing key 2fb9c0c6e0efaa17: acme.key (private, keep it offline), acme.pub (for the trust list of the targets).
$ bkp_modsign --key acme.key --report conformance.json --pack example.hello-1.0.0.agm examples/python-hello/module
Signed example.hello 1.0.0 with the key 2fb9c0c6e0efaa17.
Package written: example.hello-1.0.0.agm
bkp_modsign signs only if the report covers exactly the files of the folder; whoever changes a file afterwards tests again. The operator loads the package <id>-<version>.agm as described above. For it to load on licensed targets, their license needs the right module.<id> – AegisGrid adds the module to the license server for this. For development, a test target of your own with allow-unsigned-modules=yes also loads the unsigned folder.
Tip: Every detail – interfaces and ports, host services (store.expose, secret.get, notice.client …), stream modules in C, events, error codes and an example of a partner's module – is in docs/module-api.txt in the SDK.