Skip to content

feat(jans-fido2): expose effective attestation-mode status endpoint - #14643

Draft
imran-ishaq wants to merge 3 commits into
mainfrom
jans-fido2-attestation-status
Draft

feat(jans-fido2): expose effective attestation-mode status endpoint#14643
imran-ishaq wants to merge 3 commits into
mainfrom
jans-fido2-attestation-status

Conversation

@imran-ishaq

@imran-ishaq imran-ishaq commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Prepare


Description

Target issue

MDS health is invisible. TocService.refreshTOCEntries() downloads and refreshes metadata unless disableMetadataService is set, but there is no surfaced last-refresh time, blob validity, loaded entry count, or load error. Failures are caught and written to the log, then discarded — nothing retains them. A stale or failed MDS load is a common cause of "a previously valid authenticator is suddenly rejected", and today the only way to diagnose it is to grep server logs.

closes #14638

Part of #14602, deliverable (a). MDS health (#) and rejection
diagnostics (#) follow in separate PRs.

Implementation Details

GET /jans-fido2/restv1/trust/attestation/config, mirrored in the Config API
fido2 plugin. Read-only — it surfaces configuration the server already holds and changes no attestation behaviour.

Two decisions worth review attention:

unattestedAuthenticatorsAllowed is mode != enforced, not mode == disabled. AttestationCertificateService.isAttestationEnforced() applies the stricter MDS trust rules only for enforced; disabled and
monitor are both lenient. Since monitor is the default, an authenticator that fails attestation validation is still registered — surfacing that is the point of the endpoint. There is a test pinning it.

The mode is reported verbatim with an attestationModeRecognized flag. Fido2Configuration.attestationMode is a raw String; a typo such as Enforce silently leaves the server lenient, so the response reveals it rather than normalising it away.

AttestationCertificateService gains an isAppleRootCaPresent() accessor — the field is already populated at startup, and a missing Apple root CA is currently only a log warning. Note that #14602 groups this signal under MDS health; it is exposed here instead, since it is a property of the attestation trust anchors rather than of the metadata blob.

Date fields are pre-formatted strings: the FIDO2 DataMapperService uses a plain ObjectMapper with no JSR-310 module registered.

Two changes that are not part of the feature:

  1. jansFido2Swagger.yaml had trailing tab characters on two pre-existing lines that made the spec fail to parse in any strict
    YAML loader. Fixedhere because it is the same file as the feature additions; whitespace only.
  2. plugins/fido2-plugin/pom.xml declares jans-config-api-common explicitly (separate commit) — the plugin imports
    ApiAccessConstants and ApiConstants directly.

Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Add GET /jans-fido2/restv1/trust/attestation/config, a read-only view of
the attestation policy the server is applying: effective mode, whether
unattested authenticators are still accepted, enterprise attestation,
whether the metadata service is disabled, and whether the Apple WebAuthn
root CA was loaded.

unattestedAuthenticatorsAllowed is derived as mode != enforced, not
mode == disabled: AttestationCertificateService.isAttestationEnforced()
applies the stricter MDS trust rules only for enforced, so the default
monitor mode still accepts an authenticator that fails attestation.

The configured mode is reported verbatim alongside a flag for whether it
is recognised, since an unrecognised value silently leaves the server
lenient.

Mirrored through the Config API fido2 plugin for the Admin UI.

Also strips trailing tab characters on two pre-existing lines of
jansFido2Swagger.yaml that made the spec unparseable by strict YAML
loaders.

Signed-off-by: imran <imranishaq7071@gmail.com>
…do2-plugin

The plugin imports io.jans.configapi.util.ApiAccessConstants and
ApiConstants directly but relied on them arriving transitively through
jans-config-api-server. Declare the dependency it actually uses.

Signed-off-by: imran <imranishaq7071@gmail.com>
Adds a Trust Diagnostics page covering the attestation-mode endpoint, the
three attestation modes, and the fact that only "enforced" rejects a
failing attestation - the default "monitor" mode does not.

Signed-off-by: imran <imranishaq7071@gmail.com>
@imran-ishaq imran-ishaq added this to the 2.4.0 milestone Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5f22394-06d4-44b0-a0ee-1f2ef5539c30

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jans-fido2-attestation-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@imran-ishaq
imran-ishaq temporarily deployed to integration-tests July 28, 2026 08:02 — with GitHub Actions Inactive
@imran-ishaq
imran-ishaq temporarily deployed to integration-tests July 28, 2026 08:02 — with GitHub Actions Inactive
@mo-auto

mo-auto commented Jul 28, 2026

Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mo-auto mo-auto added area-documentation Documentation needs to change as part of issue or PR comp-docs Touching folder /docs comp-jans-config-api Component affected by issue or PR comp-jans-fido2 Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Jul 28, 2026
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-documentation Documentation needs to change as part of issue or PR comp-docs Touching folder /docs comp-jans-config-api Component affected by issue or PR comp-jans-fido2 Component affected by issue or PR kind-feature Issue or PR is a new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(jans-fido2): expose effective attestation-mode status endpoint

3 participants