4.1.8. Administration#

4.1.8.1. What is where#

Program

State

Back up?

kych

database kych (clients; sessions, codes and tokens, which expire within the hour); /etc/kych/ (configuration, client secrets, registration certificates)

/etc/kych/; the database only for clients created with kych-client-management create (configured clients come back with sync)

kych-trust

database kych-trust (every accepted list, verbatim); /etc/kych-trust/ (lists named, signer certificates)

/etc/kych-trust/; the database for audit (below)

kych-oid4vp

database kych-oid4vp (sessions, claims for 10 minutes); /etc/kych-oid4vp/ (access-certificate key, API secret)

/etc/kych-oid4vp/; not the database

kych-eid

database kych-eid (sessions); /var/lib/kych-eid/ (terminal key, authorisation certificates, lists); /etc/kych-eid/ (BerCA client key, trust anchors, result signing key, API secret)

/var/lib/kych-eid/ and /etc/kych-eid/; not the database

eudi-verifier, waltid-verifier

nothing persistent; /etc/eudi-verifier/, /etc/waltid-verifier/ (access certificate, configuration)

the configuration directories

governikus-eumw

/var/lib/governikus-eumw/ (its HSQLDB with the whole configuration, block-list data, keys); /etc/governikus-eumw/

both, plus the admin interface’s XML export

kych-eumw-bridge

nothing persistent; /etc/kych-eumw-bridge/ (SAML keys, API secret, middleware certificate, eIDAS settings)

the configuration directory

eidas-node-connector

/etc/eidas-node-connector/ (keys, trust stores, setup-state.json with the light-token secrets); /var/lib/eidas-node-connector/logs/ (personal data)

the configuration directory; the logs per the retention policy

swiyu-verifier

database swiyu_verifier (verifications, 15 minutes); /etc/swiyu-verifier/

the configuration directory

The lasting records of an identification are not KyCH’s: they are the exchange’s KYC attributes (IDENTIFICATION_EVIDENCE among them) and Beekeeper’s cases, kept under AML law for years, and backed up as those programs’ manuals say.

4.1.8.2. Backup and restore#

4.1.8.2.1. Keys and secrets#

Losing one of these means a new certificate or a reconfiguration, so they belong in an encrypted, access-controlled backup:

  • the access certificate’s private key (kych-oid4vp, eudi-verifier, waltid-verifier) – otherwise a new one from the registrar;

  • the terminal key of kych-eid (/var/lib/kych-eid) or the middleware’s keys – otherwise a new initial request at the BerCA;

  • the BerCA TLS client key and, with the middleware, its SAML keys;

  • the Connector’s signing and decryption keys and the Metadata-Signer key. Where a member state does not sign its assertions, the evidence can be shown later only by decrypting the assertion with the Connector’s decryption key: keep that key (or a successor able to read old evidence) as long as the evidence is kept;

  • the result signing key of kych-eid, whose certificate verifies its signed results;

  • the API secrets between KyCH and its own helpers (regenerable: a new secret in both files and a restart of both);

  • the client secrets in /etc/kych/secrets/.

4.1.8.2.2. What must not be restored stale#

Personal data. KyCH’s, kych-oid4vp’s and kych-eid’s databases hold claims and evidence for minutes. A backup taken while they did resurrects them when restored. Run the sweeper before the services take requests again; it deletes everything past its time in one statement:

[root@server]# kych-client-management -c /etc/kych/kych.conf purge

kych-oid4vp and kych-eid run their own sweepers (SWEEP_INTERVAL). Since nothing in these databases needs to live longer than a day, the simplest restore is a new, empty database (-dbconfig) and, for KyCH, kych-client-management sync.

kych-trust’s snapshots. kych-trust accepts only a list newer than the one in use; that is its protection against an attacker who serves a superseded but validly signed list. A database restored to an older state lowers that bar until the current list is fetched again. After a restore, check with GET /status that the sequence number in use is the publisher’s current one. Keep old backups of this database for audit – the evidence names the snapshot each decision was taken on, and GET /snapshots/SERIAL shows it – but restore them into a separate database, not the live one.

The block list. kych-eid refuses new sessions while its block list is older than MAX_BLOCK_LIST_AGE (48 hours), so a restored, stale list stops identifications rather than accepting revoked cards; run kych-eid-berca (or wait for its timer) after a restore. The middleware fetches its lists itself.

4.1.8.2.3. Purge semantics#

A purge is final: /info answers 410 Gone (claims_purged) for a session whose claims were deleted, and nothing in KyCH can produce them again. A client that needs the data keeps it from the first answer.

4.1.8.3. Updates and upgrades#

4.1.8.3.1. Debian packages#

Installing a new version of a package applies its schema patches (-dbinit from the postinst) and restarts the service if it was running – including one started without being enabled. A service that was not running stays stopped. kych.NEWS (shown by apt-listchanges) announces what needs the administrator: so far, the move from per-client verifiers to system-wide [helper-*] and [trust-*] sections (the gateway refuses an old configuration until it is rewritten and sync has run), and KyCH’s socket group kych-api. Read it before upgrading across versions.

Schema patches are numbered (oauth2gw-0001.sql and following for KyCH, likewise for kych-trust, kych-oid4vp and kych-eid), applied in order, never edited once released, and recorded in the database’s _v schema; -dbinit --dry-run shows what an upgrade would apply.

4.1.8.3.2. Upgrading a helper’s upstream#

The upstream helpers are git submodules pinned to release tags (swiyu-verifier 5.0.1, eudi-srv-verifier-endpoint 0.12.0, waltid-identity 1.3.0, Governikus eIDAS Middleware 4.1.0, eIDAS-Node 3.1.0), with KyCH’s patches in PACKAGE/patches/, applied to a copy at build time. Moving to a new tag is a change to the KyCH source, made and tested like any other:

  1. move the submodule to the new tag and run scripts/patched-source.sh (or make distcheck) to see whether every patch still applies;

  2. drop the patches upstream has merged, rebase the rest;

  3. read upstream’s release notes for breaking changes – they happen: swiyu-verifier 3.0 took only DCQL, 4.0 renamed client_id_scheme to client_id_prefix, 5.0 moved to Java 25; eIDAS-Node 3.x needed Java 17 and Jakarta EE 10, and eidas-node-connector-setup follows the release’s configuration template;

  4. run the suites that cover the helper: the differential suite (testing/e2e/run-differential.sh) for an EU PID helper, the OIDF plans (testing/conformance/), testing/npa/ for an eID server, testing/eidas/ for the Connector; any new difference must be fixed or listed as a known limitation.

./configure --disable-NAME builds without a helper whose new release is not ready yet.

4.1.8.4. Monitoring#

4.1.8.4.1. Health#

Program

Check

Alarm when

kych

GET /config through the proxy; the journal

not 200; ERROR lines

kych-trust

GET /status

a list not usable, a last refresh failed, a snapshot near its NextUpdate

kych-oid4vp, kych-eid, bridge

GET /config on the management socket (with the API secret)

not 200; kych-eid unavailable (terminal certificate out of date, block list stale)

kych-eid-berca

kych-eid-berca status; systemctl status kych-eid-berca.timer

a failed run; a certificate near expiry; lists older than a day

eudi-verifier

/actuator/health on its socket

not UP

waltid-verifier

/livez on its socket

not 200

governikus-eumw

the admin interface’s eID service provider page (certificate, lists)

a red mark

eidas-node-connector

the journal and its logs

errors such as 003009 (metadata not trusted)

Logs. Every program logs to the journal (journalctl -u kych). Every log line KyCH writes inside a request carries a random request id: grep by it when one identification misbehaves. KyCH logs no personal data at the default level; at -L DEBUG the log contains secrets and request bodies, so use it only briefly and purge the journal afterwards. The webhook /notification always answers 200 and only logs its failures, so a stuck identification shows in the log, not to the caller.

Start limits. Every unit restarts on failure, at most five times in five minutes for the JVM helpers (StartLimitBurst=5, StartLimitInterval=300s) and in five seconds for the Rust programs. A helper with a broken configuration therefore stops trying and stays failed, which is right in production; after fixing it, or after deliberate restarts in tests, systemctl reset-failed UNIT.

4.1.8.4.2. Certificates and lists that expire#

What

Watch

TLS certificates of the public names

the usual renewal; on the eID server’s name, coordinate every new certificate with a new authorisation certificate (its hash is in the certificate description)

authorisation (terminal) certificate

short-lived (the ID card portal: issued for 48 hours, fetched every 24); kych-eid-berca.timer renews it and fetches the lists every two hours, the middleware does so itself. kych-eid-berca renews a certificate that expires within RENEW_BEFORE (48 hours by default): with certificates valid for 48 hours, set it lower (say 24 h), or every run of the timer requests a new one

block, master and defect lists

fetched by the same; kych-eid refuses sessions on a stale block list

the lists of trusted entities

kych-trust’s /status; once NextUpdate passes without a newer list, nothing is trusted by it

access and registration certificates

their notAfter; renewal at the registrar

Metadata-Signer certificate

at most three years, never beyond the Berechtigung

the Berechtigung

at most three years (§ 21 (3) PAuswG); renew in time at the VfB

foreign nodes’ metadata

the Connector discards expired metadata; refresh the trust stores and restart it after a change

4.1.8.5. Data retention and purge#

KyCH passes personal data through; it does not keep it. This section says what it stores, for how long and when it is deleted, as a data protection impact assessment needs.

4.1.8.5.1. What KyCH stores#

In its database (schema oauth2gw):

  • Client registrations (clients): identifier, bcrypt hash of the secret, allowed redirect URIs, vocabularies and profiles. No data about persons.

  • Verification sessions (verification_sessions), one per /setup: the nonce, the OAuth 2.0 state, scope and redirect URI, the vocabulary, profile and helper used, the helper’s session id, the URL shown to the person, and timestamps. No data about the person until the verification succeeds. Then, in the same row:

    • the claims the person disclosed (verifiable_credential) – exactly those the profile or scope asked for, cut down to the requested paths even when the wallet or the issuer revealed more;

    • the evidence (evidence): which helper checked what, against which trust anchors, the request sent, and, where the helper hands it out, the raw presentation;

    • the optional claims the credential lacked (missing).

    For a failed verification, KyCH’s reason and the helper’s error are stored in place of the claims.

  • Authorization codes and access tokens, linked to their session.

The raw presentation can hold more than was asked. For an SD-JWT VC it is the issuer-signed credential with the disclosed claims, the issuer’s always-visible claims (issuer, type, holder key, status reference) and digests of the undisclosed ones, plus the wallet’s key-binding JWT. It is kept as signed, because a trimmed presentation could no longer be verified. A conforming EU PID makes every attribute selectively disclosable, so its presentation holds only what was requested; an issuer that makes claims always disclosed (one test issuer did: portrait, phone number, personal number) puts them into the evidence – and through IDENTIFICATION_EVIDENCE into the exchange’s records – although /info’s claims leave them out. In production only issuers on the EU’s list of PID providers are trusted, so this needs a non-conforming listed issuer. This was accepted provisionally; the final word is the data protection officer’s and the AML officer’s, and a switch that refuses such presentations is possible.

4.1.8.5.2. For how long#

Data

Deleted

Claims, evidence, missing

PURGE_GRACE (default 1 h) after the client’s first successful /info; at the latest when the access token expires, 1 h after /token

Session never verified (abandoned,

when it expires, 15 minutes after /setup

expired, or helper unreachable)

Failed session, with KyCH’s reason and

when it has expired and its authorization code too

the helper’s error

(10 minutes after the failure)

Verified session whose code was never

when the code expires, AUTH_CODE_TTL_MINUTES

exchanged

(default 10) after the verification

Completed session (the row, after its

when the access token expires

claims were purged)

Authorization code

when it expires

Access token

when it expires (1 h)

Client registration

when the operator deletes it

Each deletion happens at the first sweep after it is due, plus a safety margin of one minute for whole sessions. With the default PURGE_INTERVAL of five minutes, a person’s claims and evidence are held for at most about 1 h 6 min after the client obtained its access token, and typically for PURGE_GRACE after the client fetched them.

4.1.8.5.3. How it is deleted#

The gateway sweeps when it starts and every PURGE_INTERVAL: one database statement that empties the claims, the evidence and the missing list of every session past its grace, and deletes every expired session with its codes and tokens. kych-client-management purge runs the same sweep once, from cron or by hand; set PURGE_INTERVAL = 0 s to rely on cron alone. Have the cron job anyway if the limits above are promised: a sweep cannot run while the gateway is down. Deleted rows remain in PostgreSQL’s files until vacuum reuses the space, and in any backup taken before.

4.1.8.5.4. The helpers#

Each helper has its own store, which KyCH does not reach; they belong in the same assessment:

  • kych-oid4vp and kych-eid: claims and evidence PURGE_GRACE (10 minutes) after KyCH first fetched them, or at the session’s expiry; the rows, without personal data, after RETENTION (24 hours); a sweeper every SWEEP_INTERVAL. kych-eid never stores the PAOS dialogue’s keys.

  • eudi-verifier and waltid-verifier: in memory only, for the transaction’s lifetime (VERIFIER_MAXAGE 15 minutes, with a one-hour cleanup in the EUDI verifier’s package), lost on restart.

  • kych-eumw-bridge: in memory only. The Governikus middleware’s database holds its configuration and lists; what it logs is described in its own manual and belongs in the assessment too.

  • eidas-node-connector: light requests and responses in its Hazelcast caches for minutes; its log files in ``/var/lib/eidas-node-connector/logs`` hold personal data and need a retention rule of their own.

  • swiyu-verifier: each verification, with the presented credential, in its database until it expires (VERIFICATION_TTL_SEC, 15 minutes) and its cleanup next runs (every 7 minutes by default).

  • Logs kept by journald or a log collector, and database backups, under their own retention.

  • The clients’ copies. The exchange and Beekeeper keep what they received under their own rules – for KYC under German AML law five years, for a business relationship from the end of the year in which it ends, and no longer than ten years (§ 8 (4) GwG) – including the evidence.

4.1.8.6. Incident handling#

A helper is compromised. Stop it and switch its vocabulary to another helper for new sessions (Switching helpers); the three EU PID helpers and the two eID servers are interchangeable for this purpose. Then rotate what it held: the API secret (both files), the access certificate (revoke at the registrar, request a new one), the terminal key and authorisation certificate (BerCA), the result signing key, the SAML keys. Identifications it completed meanwhile can be re-checked from their evidence where the vocabulary allows (What the evidence proves); for npa the evidence is the compromised server’s own statement and proves nothing.

KyCH is compromised. An attacker gets at most the claims of the last hour or so, the client secrets’ bcrypt hashes and live tokens. Rotate the client secrets (delete and re-create the clients, change the exchange’s and Beekeeper’s configuration) and the helpers’ API secrets. KyCH holds no signing keys of its own.

A trust list goes bad. A list that fails to verify, has expired, or is older than the one in use is refused, and kych-trust keeps its last good snapshot until that snapshot’s NextUpdate – then nothing is trusted by it and every EU PID fails (fail closed). GET /status names the error. With walt.id in TRUST = self every session fails at once, since it keeps no earlier copy. A scheme operator’s new signing certificate goes into LOTE_SIGNER after checking it out of band.

A provider or a credential is revoked. Delisting a PID provider takes effect with kych-trust’s next snapshot (REFRESH_INTERVAL). A revoked PID fails its status check at the next presentation: status lists are fetched for every presentation, not cached. A revoked identity card is caught by the block list, at most as old as MAX_BLOCK_LIST_AGE. Identifications made before a revocation stay valid records of what was checked at the time; whether to re-identify is the AML officer’s decision.

An identification is disputed. Re-check the evidence offline: the SD-JWT VC’s issuer signature and key-binding JWT, the mdoc’s issuerAuth and deviceSignature over the recorded SessionTranscript, the eIDAS response’s and assertion’s signatures against the recorded proxy-service certificate; the trust decision against the named kych-trust snapshot.

4.1.8.7. Capacity#

KyCH and its Rust helpers are small and fast: kych-eid used 18 MB resident memory and about 0.7 seconds per identification in the tests, against about one second and 2.4 GB for the middleware and the bridge together. The JVM helpers are what needs planning:

Program

Seen in the tests

Setting

governikus-eumw

1.2 GB resident with default heap sizing (upstream recommends 16 GB RAM for production)

GOVERNIKUS_EUMW_JAVA_OPTS, e.g. -Xmx2g, in a drop-in (systemctl edit governikus-eumw)

kych-eumw-bridge

0.6-0.8 GB, shared by npa and eidas

KYCH_EUMW_BRIDGE_JAVA_OPTS in /etc/kych-eumw-bridge/local.env

eidas-node-connector

0.8 GB with -Xmx1g

EIDAS_NODE_CONNECTOR_JAVA_OPTS in /etc/default/eidas-node-connector

eudi-verifier

–

EUDI_VERIFIER_JAVA_OPTS in /etc/eudi-verifier/local.env

waltid-verifier

–

WALTID_VERIFIER_JAVA_OPTS in a drop-in

Without an explicit heap limit a JVM sizes its heap from the host’s memory, so several JVM helpers on one host should each get -Xmx. The eIDAS route took 0.6-1.8 seconds per identification on the local test network, 6 seconds for the first after a restart.

Every EU PID presentation makes the helper fetch the PID’s status list; a deployment with many identifications puts that load on the PID providers, and a provider that is down fails every presentation that names it.