Aller au contenu principal
Jahia Store
FR

OSGi Configurations Manager

community
Télécharger 1.2.1

Informations

Identifiant du module
osgi-configurations-manager
Identifiant de groupe
org.jahia.community
Statut
community
Catégorie
Admin Features
Auteur
dgigon@jahia.com
Site web du développeur
http://www.jahia.com
Nécessite Jahia
8.2.3.0
Publié le
2026-09-29
Source
scm:git:git@github.com:Jahia/osgi-configurations-manager.git
Étiquettes
  • osgi
  • configuration

OSGi Configurations Manager Overview

The OSGi Configurations Manager is a Jahia module that lets administrators manage the OSGi configuration files of karaf/etc (.cfg, .yml) from the Jahia Administration.

Key Features

  • File management: list, create (by hand, from a Metatype PID, or as a factory instance), delete, enable and disable (.disabled) configurations, and mark a file as the module default.
  • Search: filter by name, or search the content of the files.
  • Visual editor for .cfg files: Metatype-aware property picker, drag-and-drop or keyboard reordering, filter by property name or value.
  • Raw editor: Monaco editor with syntax highlighting, validation and Metatype completion for .cfg and .yml files.
  • Review before save: every save shows the diff of what will be written and asks for confirmation.

Security & Traceability

  • Encrypted values: a property can be stored as ENC(...). Each value is bound to the configuration it was encrypted for, and decrypts in that configuration only.
  • Transparent decryption for consumers: an OSGi ConfigurationPlugin hands a component its ENC(...) values decrypted, so a consumer module needs no crypto code. Declare its secrets with AttributeType.PASSWORD and read them in @Activate.
  • Masked secrets: the value of a secret (a Password attribute, or a property named like password, token, secret, credential or apikey) is masked in the visual editor, the raw editor and the diff, even when it is stored in clear text, with a button to show it.
  • Access control: the canManageOsgiConfigurations permission, a GraphQL API under a single namespace, and a root-only configuration for the manager itself (org.jahia.modules.osgiconfigmanager).
  • File filtering: hide files with filteredFiles, or expose only allowedFiles; wildcards are supported.
  • Audit logging: every sensitive action is logged with the acting username.

Developer Guide: consuming encrypted values

Do not decrypt ENC(...) values yourself: CryptoEngine.decryptString no longer reads the values written since 1.2.0. Let the manager's ConfigurationPlugin deliver them decrypted:

@Component(configurationPid = "org.example.myservice")
@Designate(ocd = MyService.Config.class)
public class MyService {

   @ObjectClassDefinition(name = "My service")
   public @interface Config {
       @AttributeDefinition(name = "API secret", type = AttributeType.PASSWORD)
       String apiSecret() default "";
   }

   @Activate
   @Modified
   void activate(Config config) {
       String secret = config.apiSecret(); // plaintext, whatever is stored as ENC(...)
   }
}

Declare Jahia-Depends: osgi-configurations-manager, so Jahia installs and refreshes the consumer with the manager, and receive the configuration through Declarative Services (or a ManagedService): a direct ConfigurationAdmin.getConfiguration(pid).getProperties() returns the stored values and bypasses the plugin. The README on GitHub covers the details: what happens at startup, undecryptable values, and portability between instances.

Captures d'écran

Dépendances

Modules dépendants

Aucun module n'en dépend.

Versions

Highlights

Secrets stored in clear text are masked in every view

The Felix web console hides a property declared as Password in its Metatype. The manager showed it unless it was encrypted, and the raw editor and the review-before-save diff showed every value. Most modules cannot read ENC(...) values, so their secrets stay in clear text: they are now kept off the screen.

A property is a secret when its Metatype attribute is Password or, for a text attribute or a property without Metatype, when its name contains password, passwd, passphrase, secret, token, credential, apikey or privatekey. A Boolean or a number is never masked, whatever its name.

  • Visual editor: the value is a password field, with the eye to show it. The filter no longer searches the value of a secret.
  • Raw editor: the value is drawn as dots, in .cfg and .yml files, while the text stays as it is for the cursor, a copy and the save. Show secrets (n) in the toolbar shows them until another file is opened.
  • Review before save: both sides of the diff are masked, so a changed secret shows as changed without being displayed. Show secrets shows them.

The manager's own cryptoSecret is masked too, and still stored in clear text. Masking keeps a secret off the screen, a screen share and a screenshot; the file and Download keep the value as stored.

⚠️ Am I impacted?

  • Coming from 1.1.0, the previous version on the Store: yes. 1.2.0 was not published there, and its upgrade notes apply (see Coming from 1.1.0 below): back up karaf/etc before upgrading, and move the modules that call CryptoEngine.decryptString themselves to the ConfigurationPlugin first.
  • Coming from 1.2.0: no. Nothing to migrate, no API change.
  • In both cases, hard-reload the admin page after the upgrade (Cmd + Shift + R), so the browser loads the new interface.

Coming from 1.1.0: what 1.2.0 brought

1.2.0 was not published on the Store. Everything below comes with 1.2.1, and its upgrade notes apply when you upgrade from 1.1.0.

Encrypted values are bound to their configuration

A value encrypted in 1.2.0 is an ENC(v3:...) envelope tied to the configuration it belongs to. It decrypts in that configuration only, in the manager as well as in the copy delivered to a component. Before, a user allowed to edit one configuration could paste into it a value copied from a file hidden from them, and get it decrypted (SEC-603).

At its first start, 1.2.0 encrypts again, for their own configuration, the existing values of every file in karaf/etc. Only the ENC(...) values change: comments and layout are kept. It then writes the marker karaf/etc/.osgi-config-manager.envelopes and refuses unbound values from then on.

Consumers receive their secrets after every restart and redeploy

Components that started before the manager (the usual order after a redeploy of the manager and at every server restart) used to receive their ENC(...) values as stored. Their connections then failed with no decryption error in the log. The manager now applies cryptoSecret before decrypting anything, and delivers those configurations again once its plugin is in place. A configuration updated in the meantime is left alone.

The manager's configuration is protected in every spelling

org.jahia.modules.osgiconfigmanager is reserved for root whatever its extension (.cfg, .yml, .disabled), its case, or a factory form such as -other or ~other (SEC-525). A blacklist entry now hides the configuration, not one spelling of its file.

Editor

  • In the visual editor, a row is dragged from its handle only, so selecting text no longer starts a reorder.
  • A filter keeps only the properties whose name or value matches. Encrypted values are not searched.
  • Switching to raw mode while a file was still loading showed an empty editor, and saving it then wiped the file. The mode selector is now disabled during the load.

⚠️ Am I impacted by 1.2.0?

  • Back up karaf/etc before upgrading. The one-time migration rewrites the files that hold encrypted values.
  • Modules that call CryptoEngine.decryptString themselves (written before 1.1.0) stop decrypting once the migration has run. Move them to the ConfigurationPlugin first: their @Activate then receives the values decrypted. The README shows what such a consumer looks like.
  • Scripts calling the GraphQL encrypt mutation must now pass the configuration file the value is for: encrypt(value, name).
  • An encrypted value cannot be copied from one file to another any more. Enter it again in the target file.

See CHANGELOG.md for the full list, and the 1.2.0 release for its pull requests.

What's Changed

  • Mask secrets stored in clear text in every view by @dgigon in #155

Full Changelog: 1_1_0...1_2_1

Nécessite Jahia 8.2.3.0Publié le 2026-09-29

Highlights

The API moved to GraphQL

The admin app now calls /modules/graphql under a single namespace, Query.osgiConfigManager / Mutation.osgiConfigManager. The osgiConfigManager.do Action is removed. That removes the request path SEC-138 went through, where a form-token promoted the Action to a system session.

  • Access is decided once, on the caller's own session. Guest users and system sessions are refused. Every call needs canManageOsgiConfigurations on / and admin on /sites/systemsite.
  • Mutations keep their CSRF defences: X-Requested-With plus an application/json body, compared on the parsed media type.
  • Errors come back with a machine-readable extensions.code, and messages never contain server paths.
  • A security-filter scope ships with the module (org.jahia.bundles.api.authorization-osgi-configurations-manager.yml). It grants only this module's GraphQL namespace, to privileged users, on same-origin calls.

Consumers receive decrypted values

An OSGi ConfigurationPlugin replaces ENC(...) values with their plaintext in the copy delivered to a component. The file on disk stays encrypted. A decryption probe (the pluginProbe query) lets you check this on an instance. Metatype Password attributes are treated as secrets, and the manager's own cryptoSecret can no longer be encrypted by mistake.

⚠️ Am I impacted?

Only if you call …/systemsite.osgiConfigManager.do yourself, from a script, a CI job or another module. That URL no longer exists. The admin UI needs nothing.

  • Move each call to the matching GraphQL field. The CHANGELOG has an old-request → GraphQL mapping table.
  • Check errors[0].extensions.code instead of the HTTP status.
  • Scripts calling from outside the admin UI must use a personal API token carrying the osgi-configurations-manager scope.

A leftover karaf/etc/org.jahia.modules.jahiacsrfguard-osgi-configurations-manager.cfg from 1.0.x is harmless and can be deleted.

See CHANGELOG.md for the full list.

What's Changed

  • ci: give the e2e Jahia log step the compose variables it needs by @fbourasse in #136
  • fix(deps): bump js-yaml to 3.15.2 / 4.3.2 (GHSA-2883-xcg3-v3hh) by @fbourasse in #137
  • feat: decrypt ENC(...) values for consumers through an OSGi ConfigurationPlugin by @dgigon in #133
  • fix: keep a secret readable across the raw/visual round trip by @dgigon in #134
  • chore: fix jest --coverage, untrack coverage/, clear tests/ lint errors by @fbourasse in #139
  • feat!: move the API from the osgiConfigManager.do Action to GraphQL (1.1.0) by @fbourasse in #140

Full Changelog: 1_0_6...1_1_0

Nécessite Jahia 8.2.3.2Publié le 2026-09-23

Security

The osgiConfigManager action now refuses to run on a system session or for the guest user (SEC-138).
A request carrying a valid Jahia form-token is promoted to a system action. That skips the action's declared requirements and passes it a system JCR session, on which the canManageOsgiConfigurations check always succeeds. The result was that an anonymous caller could get past every authorization gate. 1.0.5's Content-Type and X-Requested-With checks did not help, because the attacker sets those headers itself.

1.0.6 answers 403, with an [AUDIT] Rejected osgiConfigManager … log line, before any read or write, for GET and POST alike.

Upgrade recommended for every 1.0.x installation. There is no breaking change and no migration step: the admin UI never sends a form-token.

See CHANGELOG.md for details.

What's Changed

  • chore(deps-dev): bump the tests-npm-minor-patch group in /tests with 4 updates by @dependabot[bot] in #121
  • chore(deps): bump the npm-minor-patch group with 5 updates by @dependabot[bot] in #120
  • docs: document the .cfg multiline rules by @dgigon in #124
  • chore(deps): bump the npm-major group across 1 directory with 4 updates by @dependabot[bot] in #122
  • chore(deps-dev): bump the tests-npm-major group across 1 directory with 19 updates by @dependabot[bot] in #123
  • chore(deps-dev): bump cypress from 15.20.1 to 15.21.1 in /tests in the tests-npm-minor-patch group by @dependabot[bot] in #127
  • chore: drop react-apollo and react-test-renderer, which nothing uses by @dgigon in #128
  • build: move to Babel 8, pinning the classic JSX runtime by @dgigon in #129
  • build: make babel.config.js the single Babel config, and guard it by @dgigon in #130
  • fix: refuse osgiConfigManager on a system session or for guest (SEC-138) by @fbourasse in #135

Full Changelog: 1_0_5...1_0_6

Nécessite Jahia 8.2.3.2Publié le 2026-09-22

Fixed a data-loss defect in the visual .cfg editor: a value spanning several lines was written without the trailing \ the format requires, so its continued lines were read back as comments and silently lost on the next save. Continued lines are now lined up under the start of the value, and a # or ! opening a continued line is escaped — Karaf's properties reader discards such a line otherwise.

Security was hardened: decryption is bound to the file the value comes from, stored preference keys are restricted to an allowlist, state-changing POSTs require an X-Requested-With header, encryption fails closed rather than persisting a value in clear, and filter matching is case-insensitive for exact names and * wildcards alike.

Saving now shows the raw diff for confirmation, property rows can be reordered from the keyboard, and both dialogs are accessible to assistive technology. Not-found, conflict and access-denied conditions return 404, 409 and 403 instead of a generic error. The build moved to JDK 17 and Node 22, the licence is MIT throughout, and the test suite covers 147 Java tests, 120 Jest tests and 43 Cypress end-to-end cases.

Nécessite Jahia 8.2.3.2Publié le 2026-09-07

Added

  • I added wildcard support to filteredFiles and allowedFiles, so entries such as org.apache.* and jmx.* can now match multiple configuration files.
  • I shipped a default module configuration file at src/main/resources/META-INF/configurations/org.jahia.modules.osgiconfigmanager.cfg.
  • I preconfigured the blacklist with: (if you already deployed a previous version, you will have to add these exclusions manually).
    • org.apache.*
    • jmx.*

Changed

  • I updated the documentation to explain where the default configuration file must be placed in a module project.
  • I updated the release process so generated frontend assets are ignored during release checks.

Tests

  • I added Java tests covering exact matches, wildcard matches, whitelist behavior, and factory PID handling.
Nécessite Jahia 8.2.2.0Publié le 2026-06-15

New features
Added a full Jahia/Moonstone UI refresh:

  • redesigned the file list and editor layout to better match Jahia administration patterns
  • moved global actions (New, Import, Refresh) to the top header
  • added a dedicated file action toolbar with Disable/Enable, Mark as default, Download, Delete and Raw Edit / Visual Edit
  • aligned dialogs, toolbars, badges and warnings with Moonstone components and variables

Added a Moonstone-based creation dialog:

  • replaced the custom create dialog with a real Moonstone Modal
  • added Moonstone tabs for:
    • manual file creation
    • creation from a simple PID
    • creation of a factory instance
  • improved footer actions and overall consistency with Jahia UI patterns

Added configurable visual formatting controls for the visual .cfg editor:

  • comments and empty lines are now hidden by default in visual mode
  • added a new OSGi configuration flag visualFormattingControlsEnabled
  • when enabled, the visual editor exposes controls to:
    • add comments
    • add empty lines
    • toggle comment visibility
    • toggle empty-line visibility

Improved configuration state rendering in the UI:

  • replaced custom badges with Moonstone Chip-based badges
  • added icon-based compact badges in the file list
  • improved contextual banners for MODULE and MODULE_DEFAULT
  • replaced the old file-status dot with a Jahia-style vertical status rail in the sidebar

Improved editor interactions and destructive flows:

  • added consistent unsaved-changes protection for:
    • file switching
    • create
    • upload
    • refresh
    • disable
    • mark as default
    • cancel
  • improved delete confirmation wording and destructive button styling
  • removed redundant mode-switch actions from the raw editor once the shared mode selector is available

Improved header and toolbar behavior:

  • Save and Cancel now behave as the main state indicators for pending changes
  • cleaned up unnecessary labels and redundant actions
  • restored tooltips on action buttons and improved long-tooltip rendering for translated labels

Quality
Improved automated test coverage and maintainability:

  • split the previous monolithic Cypress spec into feature-oriented specs
  • added coverage for:
    • app shell
    • config lifecycle
    • creation flows
    • sidebar and header behavior
    • visual editor
    • raw editor
    • unsaved-changes confirmation flows
  • added targeted unit tests for config state badges and visual editor behavior
  • reduced duplication in shared UI actions to improve Sonar compatibility
  • validated the module with:
    • yarn test --runInBand
    • yarn build
    • mvn clean install sonar:sonar

Documentation
Updated project documentation with:

  • the new Jahia-aligned UI structure
  • header-based global actions
  • the new visualFormattingControlsEnabled configuration flag
  • updated Cypress/testing documentation
  • current build and Sonar validation commands
Nécessite Jahia 8.2.2.0Publié le 2026-04-24

New features

Added support for a white list of configuration files:

  • expose only an explicit subset of .cfg / .yml files in the manager
  • when a white list is defined, it takes precedence over the black list
  • only whitelisted files can be viewed, edited, uploaded, created, deleted or toggled through the tool

Added a root-only manager configuration:

  • the module now exposes its own configuration through OSGi Metatype
  • the manager configuration can be created from Metatype if it does not exist yet
  • only the root user can see, create or edit this configuration

Added Jahia configuration state awareness in the UI:

  • detect and display MODULE, MODULE_DEFAULT, and USER configurations
  • show badges in the file list and editor header
  • show contextual warnings for module-managed files
  • allow marking eligible files as MODULE_DEFAULT directly from the UI

Added Metatype assistance to the visual .cfg editor:

  • Add Property now opens a searchable Metatype-aware dialog when metadata is available
  • the same dialog still allows creating a custom property not declared in Metatype
  • Metatype-backed properties can be inserted with their default value
  • known properties now expose hover documentation in the visual editor

Added empty line visibility toggle in the visual .cfg editor:

  • show or hide empty lines independently from comments
  • preference is persisted like comment visibility
  • adding a new empty line automatically re-enables empty-line display

Updated README documentation with:

  • white list behavior
  • root-only manager configuration
  • visual editor Metatype assistance
  • empty-line toggle behavior

Security

Hardened backend file handling:

  • stricter filename validation
  • normalized path resolution under karaf/etc
  • blocked invalid paths and unauthorized target files more defensively

Improved crypto handling:

  • removed the weaker CBC fallback
  • restricted decryption flow to the stronger AES/GCM path

Updated project dependencies to address GitHub security and Dependabot alerts.

Nécessite Jahia 8.2.2.0Publié le 2026-04-17

New features

  • Added Metatype-aware assistance in the raw .cfg editor:
    • property discovery panel
    • inline completion for keys and values
    • hover documentation
    • default values and allowed values display
    • light warning for properties not declared in the Metatype
  • Added first-level Metatype assistance in the raw .yml editor:
    • property panel
    • hover documentation
    • completion for root-level keys and simple values
    • light warning for unknown root-level keys
  • Added Metatype-driven configuration creation:
    • create a .cfg file from an available OSGi PID that has no file yet
    • generated files are prefilled with commented default values
  • Added factory configuration creation:
    • list factory-capable configurations
    • display existing instances
    • create new instances with an explicit identifier
  • Added a tabbed “Create configuration” dialog for:
    • manual file creation
    • creation from a simple PID
    • creation of a factory instance

Improvements

  • Added a warning confirmation dialog before disabling a configuration file from the toggle action
  • Improved raw editor usability with richer contextual help from OSGi Metatype metadata
  • Improved the property insertion side panel UI for long property names
  • Added double-click insertion support from the available-properties panel
  • Improved Cypress coverage for creation flows, toggle warning behavior, and Metatype-assisted editing
  • Added helper scripts for end-to-end testing:
    • tests/run-e2e-docker.sh
    • tests/run-e2e-local.sh

Build and maintenance

  • Standardized the project on Yarn
  • Updated the Jahia parent to 8.2.2.0
  • Reduced Maven build noise and improved build compatibility
  • Refactored backend code to reduce duplication and satisfy Sonar quality checks
Nécessite Jahia 8.2.2.0Publié le 2026-04-16
Nécessite Jahia 8.2.0.0Publié le 2026-03-17