Bug #24781
closedOpenSCAP technique doesn't show up in GUI after OpenSCAP plugin installation
Description
OpenSCAP technique doesn't show up in GUI after OpenSCAP plugin installation.
Webapp logs :
2024-04-25 06:58:14+0000 INFO bootchecks - Migrate technique.json to technique.yml 2024-04-25 06:58:14+0000 INFO bootchecks.migration.techniques - Checking if some techniques need to be migrated to YAML format 2024-04-25 06:58:14+0000 ERROR com.normation.cfclerk.services.impl.GitTechniqueReader - Can not find the parent (root) category '/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0' for technique 'plugin_openscap_policies/1.0' 2024-04-25 06:58:15+0000 ERROR com.normation.cfclerk.services.impl.GitTechniqueReader - Can not find the parent (root) category '/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0' for technique 'plugin_openscap_policies/1.0' 2024-04-25 06:58:16+0000 INFO techniques.reader - Reloading technique library, no modified techniques found
See workaround: https://issues.rudder.io/issues/24781#note-3
Updated by Félix DALLIDET 7 months ago
It looks like the archive import feature does not support anymore.
If a zip archive contains some techniques categories (defined by a category.xml file), the category file is ignored during the import process.
You can easily reproduce it with the latest Openscap plugin version.
Content of its zip archive:
Archive: ./openscap_technique.zip creating: configuration/techniques/ creating: configuration/techniques/OpenSCAP_Policies_plugin/ inflating: configuration/techniques/OpenSCAP_Policies_plugin/category.xml creating: configuration/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/ creating: configuration/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0/ inflating: configuration/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0/technique.yml
But when imported through the API:
2024-04-25 13:02:19+0000 INFO application.archive - Received a new policy archive 'openscap_technique.zip', processing 2024-04-25 13:02:19+0000 TRACE application.archive - Directory 'configuration/techniques/' in archive 'openscap_technique.zip': looking for entries 2024-04-25 13:02:19+0000 TRACE application.archive - Directory 'configuration/techniques/OpenSCAP_Policies_plugin/' in archive 'openscap_technique.zip': looking for entries 2024-04-25 13:02:19+0000 TRACE application.archive - Archive 'openscap_technique.zip': found technique file OpenSCAP_Policies_plugin/category.xml 2024-04-25 13:02:19+0000 TRACE application.archive - Directory 'configuration/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/' in archive 'openscap_technique.zip': looking for entries 2024-04-25 13:02:19+0000 TRACE application.archive - Directory 'configuration/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0/' in archive 'openscap_technique.zip': looking for entries 2024-04-25 13:02:19+0000 TRACE application.archive - Archive 'openscap_technique.zip': found technique file OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0/technique.yml 2024-04-25 13:02:19+0000 DEBUG application.archive - Processing archive 'openscap_technique.zip': techniques: 'OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0' 2024-04-25 13:02:19+0000 DEBUG application.archive - Processing archive 'openscap_technique.zip': directives: '' 2024-04-25 13:02:19+0000 DEBUG application.archive - Processing archive 'openscap_technique.zip': groups: '' 2024-04-25 13:02:19+0000 DEBUG application.archive - Processing archive 'openscap_technique.zip': rules: '' 2024-04-25 13:02:19+0000 DEBUG application.archive - Processing archive 'openscap_technique.zip': rules: '' 2024-04-25 13:02:19+0000 DEBUG application.archive - Adding technique from archive: 'Plugin Openscap policies' (/var/rudder/configuration-repository/techniques/OpenSCAP_Policies_plugin/plugin_openscap_policies/1.0) 2024-04-25 13:02:19+0000 TRACE application.archive - Deleting technique files for technique 'plugin_openscap_policies/1.0': metadata.xml, technique.cf, technique.ps1 2024-04-25 13:02:19+0000 TRACE application.archive - Writing for commit files for technique 'plugin_openscap_policies/1.0': technique.yml 2024-04-25 13:02:20+0000 INFO policy.generation - Start policy generation, checking updated rules
There is no mention of the category.xml file, and it is not extracted to the configuration-repository folder.
root@server:/var/rudder/packages/rudder-plugin-openscap# tree /var/rudder/configuration-repository/techniques/OpenSCAP_Policies_plugin/ /var/rudder/configuration-repository/techniques/OpenSCAP_Policies_plugin/ └── plugin_openscap_policies └── 1.0 ├── metadata.xml ├── technique.cf ├── technique.ps1 └── technique.yml 3 directories, 4 files
Updated by François ARMAND 7 months ago
- Related to Bug #24789: Archive API for import/export doesn't know about technique added
Updated by Félix DALLIDET 7 months ago
A workaround:
ar x rudder-plugin-openscap-8.1.1-2.1.rpkg files.txz tar -xvf files.txz unzip -p openscap_technique.zip configuration/techniques/OpenSCAP_Policies_plugin/category.xml cd /var/rudder/configuration-repository/techniques/OpenSCAP_Policies_plugin/ git add category.xml && git commit -m "Add OpenSCAP Policies plugin category" && rudder server reload-techniques
Then, in the UI, go to the 'Administration' -> 'Technique tree' and move the 'Plugin OpenSCAP policies' technique under the newly added category.
Updated by Nicolas CHARLES 6 months ago
- Subject changed from [Rudder 8.1] OpenSCAP technique doesn't show up in GUI after OpenSCAP plugin installation to OpenSCAP technique doesn't show up in GUI after OpenSCAP plugin installation
- Target version changed from 8.1 to 8.0
happens in 8.0 also
Updated by Nicolas CHARLES 6 months ago
- Status changed from New to In progress
- Assignee set to Nicolas CHARLES
Updated by Nicolas CHARLES 6 months ago
- Status changed from In progress to Pending technical review
- Assignee changed from Nicolas CHARLES to Félix DALLIDET
- Pull Request set to https://github.com/Normation/rudder-plugins/pull/715
Updated by Nicolas CHARLES 6 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder:rudder-plugins|45ff488c3733d1ff0dc807b47bcf8e9c756036ba.
Updated by Clark ANDRIANASOLO 6 months ago
- Fix check changed from To do to Checked
Updated by Vincent MEMBRÉ 6 months ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder plugin openscap v8.1.3-2.1
Updated by Vincent MEMBRÉ 6 months ago
This bug has been fixed in Rudder plugin openscap v8.0.9-2.1