From 95bb2f59f34fbc57d9d6445ba704f5dd949b61f9 Mon Sep 17 00:00:00 2001 From: Xiangce Liu Date: Wed, 11 Dec 2024 19:50:22 +0800 Subject: [PATCH] chore: resort the manifests for malware-detection and compliance - add canonical facts to persist collection - resort the specs order Signed-off-by: Xiangce Liu --- insights/specs/datasources/manifests.py | 189 +++++++++++++++++++----- 1 file changed, 148 insertions(+), 41 deletions(-) diff --git a/insights/specs/datasources/manifests.py b/insights/specs/datasources/manifests.py index 543df5b761..851ec8a0c0 100644 --- a/insights/specs/datasources/manifests.py +++ b/insights/specs/datasources/manifests.py @@ -35,7 +35,23 @@ persist: # determines what will appear in the archive - - name: insights.specs.default.DefaultSpecs.malware_detection + - name: insights.specs.Specs.malware_detection + enabled: true + - name: insights.specs.Specs.ansible_host + enabled: true + - name: insights.specs.Specs.blacklist_report + enabled: true + - name: insights.specs.Specs.blacklisted_specs + enabled: true + - name: insights.specs.Specs.branch_info + enabled: true + - name: insights.specs.Specs.display_name + enabled: true + - name: insights.specs.Specs.egg_release + enabled: true + - name: insights.specs.Specs.tags + enabled: true + - name: insights.specs.Specs.version_info enabled: true run_strategy: @@ -47,43 +63,82 @@ # disable everything by default # defaults to false if not specified. default_component_enabled: false + packages: # determines which packages are loaded. These will be namespaced to the relevant collector - - insights.specs.datasources.malware_detection - insights.specs.default + - insights.specs.datasources.malware_detection + configs: # determines which specs get loaded - - name: insights.specs.default.DefaultSpecs.malware_detection + - name: insights.specs.Specs.malware_detection enabled: true - # Enable specs for collecting the system's canonical facts - - name: insights.specs.default.DefaultSpecs.mac_addresses + - name: insights.specs.Specs.ansible_host enabled: true - - name: insights.specs.Specs.mac_addresses + - name: insights.specs.Specs.blacklist_report enabled: true - - name: insights.specs.default.DefaultSpecs.etc_machine_id + - name: insights.specs.Specs.blacklisted_specs enabled: true - - name: insights.specs.Specs.etc_machine_id + - name: insights.specs.Specs.branch_info enabled: true - - name: insights.specs.default.DefaultSpecs.hostname + - name: insights.specs.Specs.display_name enabled: true - - name: insights.specs.Specs.hostname + - name: insights.specs.Specs.egg_release enabled: true - - name: insights.specs.default.DefaultSpecs.dmidecode + - name: insights.specs.Specs.tags + enabled: true + - name: insights.specs.Specs.version_info enabled: true - name: insights.specs.Specs.dmidecode enabled: true - - name: insights.specs.default.DefaultSpecs.machine_id + - name: insights.specs.Specs.etc_machine_id enabled: true - - name: insights.specs.Specs.machine_id + - name: insights.specs.Specs.hostname enabled: true - - name: insights.specs.default.DefaultSpecs.ip_addresses + - name: insights.specs.Specs.installed_rpms enabled: true - name: insights.specs.Specs.ip_addresses enabled: true - - name: insights.specs.default.DefaultSpecs.subscription_manager_id + - name: insights.specs.Specs.mac_addresses + enabled: true + - name: insights.specs.Specs.machine_id enabled: true - name: insights.specs.Specs.subscription_manager_id enabled: true + - name: insights.specs.default.DefaultSpecs.malware_detection + enabled: true + - name: insights.specs.default.DefaultSpecs.ansible_host + enabled: true + - name: insights.specs.default.DefaultSpecs.blacklist_report + enabled: true + - name: insights.specs.default.DefaultSpecs.blacklisted_specs + enabled: true + - name: insights.specs.default.DefaultSpecs.branch_info + enabled: true + - name: insights.specs.default.DefaultSpecs.display_name + enabled: true + - name: insights.specs.default.DefaultSpecs.egg_release + enabled: true + - name: insights.specs.default.DefaultSpecs.tags + enabled: true + - name: insights.specs.default.DefaultSpecs.version_info + enabled: true + - name: insights.specs.default.DefaultSpecs.dmidecode + enabled: true + - name: insights.specs.default.DefaultSpecs.etc_machine_id + enabled: true + - name: insights.specs.default.DefaultSpecs.hostname + enabled: true + - name: insights.specs.default.DefaultSpecs.installed_rpms + enabled: true + - name: insights.specs.default.DefaultSpecs.ip_addresses + enabled: true + - name: insights.specs.default.DefaultSpecs.mac_addresses + enabled: true + - name: insights.specs.default.DefaultSpecs.machine_id + enabled: true + - name: insights.specs.default.DefaultSpecs.subscription_manager_id + enabled: true """.lstrip() compliance_manifest = """ @@ -114,6 +169,22 @@ enabled: true - name: insights.specs.Specs.compliance_unassign enabled: true + - name: insights.specs.Specs.ansible_host + enabled: true + - name: insights.specs.Specs.blacklist_report + enabled: true + - name: insights.specs.Specs.blacklisted_specs + enabled: true + - name: insights.specs.Specs.branch_info + enabled: true + - name: insights.specs.Specs.display_name + enabled: true + - name: insights.specs.Specs.egg_release + enabled: true + - name: insights.specs.Specs.tags + enabled: true + - name: insights.specs.Specs.version_info + enabled: true run_strategy: name: serial @@ -130,66 +201,102 @@ - insights.specs.default configs: # determines which specs get loaded - - name: insights.specs.datasources.compliance.compliance_ds - enabled: true - name: insights.specs.Specs.compliance enabled: true - - name: insights.specs.default.DefaultSpecs.compliance + - name: insights.specs.Specs.compliance_policies enabled: true - - name: insights.specs.default.DefaultSpecs.compliance_policies + - name: insights.specs.Specs.compliance_assign enabled: true - - name: insights.specs.default.DefaultSpecs.compliance_assign + - name: insights.specs.Specs.compliance_unassign enabled: true - - name: insights.specs.default.DefaultSpecs.compliance_unassign + - name: insights.specs.Specs.ansible_host enabled: true - - # Enable specs for collecting the system's canonical facts - - name: insights.specs.default.DefaultSpecs.mac_addresses + - name: insights.specs.Specs.blacklist_report enabled: true - - name: insights.specs.Specs.mac_addresses + - name: insights.specs.Specs.blacklisted_specs enabled: true - - name: insights.specs.default.DefaultSpecs.etc_machine_id + - name: insights.specs.Specs.branch_info enabled: true - - name: insights.specs.Specs.etc_machine_id + - name: insights.specs.Specs.display_name enabled: true - - name: insights.specs.default.DefaultSpecs.hostname + - name: insights.specs.Specs.egg_release enabled: true - - name: insights.specs.Specs.hostname + - name: insights.specs.Specs.tags enabled: true - - name: insights.specs.default.DefaultSpecs.dmidecode + - name: insights.specs.Specs.version_info enabled: true - name: insights.specs.Specs.dmidecode enabled: true - - name: insights.specs.default.DefaultSpecs.machine_id + - name: insights.specs.Specs.etc_machine_id enabled: true - - name: insights.specs.Specs.machine_id + - name: insights.specs.Specs.hostname enabled: true - - name: insights.specs.default.DefaultSpecs.ip_addresses + - name: insights.specs.Specs.installed_rpms enabled: true - name: insights.specs.Specs.ip_addresses enabled: true - - name: insights.specs.default.DefaultSpecs.subscription_manager_id + - name: insights.specs.Specs.mac_addresses enabled: true - - name: insights.specs.Specs.subscription_manager_id + - name: insights.specs.Specs.machine_id + enabled: true + - name: insights.specs.Specs.os_release enabled: true - name: insights.specs.Specs.redhat_release enabled: true - - name: insights.specs.default.DefaultSpecs.redhat_release + - name: insights.specs.Specs.subscription_manager_id enabled: true - - name: insights.specs.Specs.os_release + - name: insights.specs.default.DefaultSpecs.compliance enabled: true - - name: insights.specs.default.DefaultSpecs.os_release + - name: insights.specs.default.DefaultSpecs.compliance_policies enabled: true - - name: insights.parsers.redhat_release.RedhatRelease + - name: insights.specs.default.DefaultSpecs.compliance_assign enabled: true - - name: insights.parsers.os_release.OsRelease + - name: insights.specs.default.DefaultSpecs.compliance_unassign enabled: true - - name: insights.specs.Specs.installed_rpms + - name: insights.specs.default.DefaultSpecs.ansible_host + enabled: true + - name: insights.specs.default.DefaultSpecs.blacklist_report + enabled: true + - name: insights.specs.default.DefaultSpecs.blacklisted_specs + enabled: true + - name: insights.specs.default.DefaultSpecs.branch_info + enabled: true + - name: insights.specs.default.DefaultSpecs.display_name + enabled: true + - name: insights.specs.default.DefaultSpecs.egg_release + enabled: true + - name: insights.specs.default.DefaultSpecs.tags + enabled: true + - name: insights.specs.default.DefaultSpecs.version_info + enabled: true + - name: insights.specs.default.DefaultSpecs.dmidecode + enabled: true + - name: insights.specs.default.DefaultSpecs.etc_machine_id + enabled: true + - name: insights.specs.default.DefaultSpecs.hostname enabled: true - name: insights.specs.default.DefaultSpecs.installed_rpms enabled: true + - name: insights.specs.default.DefaultSpecs.ip_addresses + enabled: true + - name: insights.specs.default.DefaultSpecs.mac_addresses + enabled: true + - name: insights.specs.default.DefaultSpecs.machine_id + enabled: true + - name: insights.specs.default.DefaultSpecs.os_release + enabled: true + - name: insights.specs.default.DefaultSpecs.redhat_release + enabled: true + - name: insights.specs.default.DefaultSpecs.subscription_manager_id + enabled: true - name: insights.parsers.installed_rpms.InstalledRpms enabled: true + - name: insights.parsers.os_release.OsRelease + enabled: true + - name: insights.parsers.redhat_release.RedhatRelease + enabled: true + - name: insights.specs.datasources.compliance.compliance_ds + enabled: true """.lstrip() manifests = {'compliance': compliance_manifest, 'malware-detection': malware_detection_manifest}