patchman 4.0.21__tar.gz → 4.0.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of patchman might be problematic. Click here for more details.
- {patchman-4.0.21 → patchman-4.0.23}/INSTALL.md +214 -0
- {patchman-4.0.21 → patchman-4.0.23}/PKG-INFO +2 -2
- patchman-4.0.23/VERSION.txt +1 -0
- {patchman-4.0.21 → patchman-4.0.23}/etc/patchman/local_settings.py +32 -0
- patchman-4.0.23/patchman/apps.py +7 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/apps.py +2 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/tests/test_api.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/tests/test_models.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/utils.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/views.py +2 -2
- patchman-4.0.23/patchman/compliance/admin.py +53 -0
- patchman-4.0.23/patchman/compliance/apps.py +22 -0
- patchman-4.0.23/patchman/compliance/migrations/0001_initial.py +82 -0
- patchman-4.0.23/patchman/compliance/models.py +119 -0
- patchman-4.0.23/patchman/compliance/serializers.py +58 -0
- patchman-4.0.23/patchman/compliance/tables.py +111 -0
- patchman-4.0.23/patchman/compliance/templates/compliance/compliance_host.html +76 -0
- patchman-4.0.23/patchman/compliance/templates/compliance/compliance_rule.html +58 -0
- patchman-4.0.23/patchman/compliance/templates/compliance/compliance_summary.html +58 -0
- patchman-4.0.23/patchman/compliance/tests/test_compliance.py +494 -0
- patchman-4.0.23/patchman/compliance/urls.py +27 -0
- patchman-4.0.23/patchman/compliance/utils.py +98 -0
- patchman-4.0.23/patchman/compliance/views.py +190 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/apps.py +2 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/tests/test_api.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/tests/test_models.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/views.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/apps.py +3 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/models.py +8 -8
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/signals.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/alma.py +8 -8
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/arch.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/centos.py +13 -9
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/debian.py +16 -13
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/rocky.py +8 -8
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/distros/ubuntu.py +12 -11
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/sources/repos/yum.py +11 -12
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tasks.py +13 -13
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tests/test_api.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tests/test_integration.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tests/test_models.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/utils.py +6 -4
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/views.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/apps.py +3 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/forms.py +1 -1
- patchman-4.0.23/patchman/hosts/migrations/0014_drop_legacy_tagging.py +34 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/models.py +18 -13
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/signals.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tasks.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/templatetags/report_alert.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tests/test_api.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tests/test_find_updates.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tests/test_managers.py +5 -5
- patchman-4.0.23/patchman/hosts/tests/test_migrations.py +99 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/tests/test_models.py +47 -8
- patchman-4.0.23/patchman/hosts/tests/test_utils.py +91 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/utils.py +39 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/views.py +96 -12
- patchman-4.0.23/patchman/management/commands/clean_reports.py +42 -0
- patchman-4.0.23/patchman/management/commands/create_enrollment_token.py +93 -0
- patchman-4.0.23/patchman/management/commands/dbcheck.py +49 -0
- patchman-4.0.23/patchman/management/commands/delete_hosts.py +41 -0
- patchman-4.0.23/patchman/management/commands/diff_hosts.py +101 -0
- patchman-4.0.23/patchman/management/commands/dns_checks.py +37 -0
- patchman-4.0.23/patchman/management/commands/find_updates.py +48 -0
- patchman-4.0.23/patchman/management/commands/list_certificates.py +91 -0
- patchman-4.0.23/patchman/management/commands/list_enrollment_tokens.py +82 -0
- patchman-4.0.23/patchman/management/commands/list_hosts.py +37 -0
- patchman-4.0.23/patchman/management/commands/list_repos.py +37 -0
- patchman-4.0.23/patchman/management/commands/process_reports.py +60 -0
- patchman-4.0.23/patchman/management/commands/refresh_repos.py +44 -0
- patchman-4.0.23/patchman/management/commands/revoke_certificate.py +89 -0
- patchman-4.0.23/patchman/management/commands/toggle_check_dns.py +49 -0
- patchman-4.0.23/patchman/management/commands/toggle_host_repos_only.py +49 -0
- patchman-4.0.23/patchman/management/commands/update_cves.py +43 -0
- patchman-4.0.23/patchman/management/commands/update_errata.py +66 -0
- patchman-4.0.23/patchman/management/helpers.py +83 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/apps.py +2 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/models.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/utils.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/views.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/apps.py +3 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/forms.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/models.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/signals.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osrelease_list.html +11 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osvariant_list.html +11 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/tests/test_api.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/tests/test_models.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/utils.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/views.py +57 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/apps.py +2 -1
- patchman-4.0.23/patchman/packages/migrations/0009_fix_null_version_fields.py +22 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/models.py +8 -8
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/tables.py +18 -4
- patchman-4.0.23/patchman/packages/templates/packages/package_list.html +37 -0
- patchman-4.0.23/patchman/packages/templates/packages/package_update_list.html +37 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/tests/test_api.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/tests/test_models.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/tests/test_version_compare.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/tests/test_views.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/urls.py +3 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/utils.py +5 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/views.py +176 -8
- {patchman-4.0.21 → patchman-4.0.23}/patchman/receivers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/apps.py +2 -1
- patchman-4.0.23/patchman/reports/migrations/0006_alter_report_options.py +17 -0
- patchman-4.0.23/patchman/reports/migrations/0007_report_compliance.py +16 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/models.py +33 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tasks.py +6 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_api.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_edge_cases.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_integration.py +7 -7
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_models.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_parsing.py +4 -4
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_tasks.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/tests/test_utils.py +25 -25
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/utils.py +10 -10
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/views.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/apps.py +3 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/forms.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/models.py +9 -9
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/arch.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/deb.py +8 -10
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/gentoo.py +8 -9
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/rpm.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/yast.py +12 -6
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/repo_types/yum.py +53 -54
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/signals.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tasks.py +4 -4
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tests/test_api.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tests/test_managers.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tests/test_mirror_sync.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tests/test_models.py +3 -3
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/tests/test_views.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/utils.py +9 -9
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/views.py +94 -10
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/admin.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/apps.py +2 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/models.py +5 -5
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/serializers.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/tables.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/tasks.py +6 -6
- patchman-4.0.23/patchman/security/tests/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/tests/test_api.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/tests/test_models.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/urls.py +1 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/utils.py +2 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/views.py +6 -6
- {patchman-4.0.21 → patchman-4.0.23}/patchman/settings.py +26 -13
- {patchman-4.0.21 → patchman-4.0.23}/patchman/urls.py +28 -18
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/__init__.py +31 -4
- patchman-4.0.23/patchman/util/api.py +240 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/apps.py +2 -1
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/context_processors.py +17 -7
- patchman-4.0.23/patchman/util/middleware.py +63 -0
- patchman-4.0.23/patchman/util/migrations/0001_initial.py +51 -0
- patchman-4.0.23/patchman/util/migrations/__init__.py +1 -0
- patchman-4.0.23/patchman/util/models.py +120 -0
- patchman-4.0.23/patchman/util/pki.py +282 -0
- patchman-4.0.23/patchman/util/serializers.py +78 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/tasks.py +5 -5
- patchman-4.0.23/patchman/util/templates/dashboard.html +295 -0
- patchman-4.0.23/patchman/util/templates/issues.html +148 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/navbar.html +3 -1
- patchman-4.0.23/patchman/util/templatetags/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templatetags/common.py +4 -2
- patchman-4.0.23/patchman/util/tests/__init__.py +0 -0
- patchman-4.0.23/patchman/util/tests/test_api.py +327 -0
- patchman-4.0.23/patchman/util/tests/test_mtls.py +402 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/tests/test_utils.py +22 -2
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/urls.py +8 -1
- patchman-4.0.23/patchman/util/views.py +352 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman.egg-info/PKG-INFO +2 -2
- patchman-4.0.23/patchman.egg-info/SOURCES.txt +416 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman.egg-info/requires.txt +1 -1
- patchman-4.0.23/patchman.egg-info/top_level.txt +1 -0
- {patchman-4.0.21 → patchman-4.0.23}/requirements.txt +1 -1
- {patchman-4.0.21 → patchman-4.0.23}/sbin/patchman +15 -15
- patchman-4.0.21/VERSION.txt +0 -1
- patchman-4.0.21/packages/templates/packages/package_list.html +0 -7
- patchman-4.0.21/packages/templates/packages/package_update_list.html +0 -7
- patchman-4.0.21/patchman.egg-info/SOURCES.txt +0 -364
- patchman-4.0.21/patchman.egg-info/top_level.txt +0 -12
- patchman-4.0.21/util/templates/dashboard.html +0 -251
- patchman-4.0.21/util/views.py +0 -158
- {patchman-4.0.21 → patchman-4.0.23}/AUTHORS +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/COPYING +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/MANIFEST.in +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/README.md +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/etc/patchman/apache.conf.example +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/etc/patchman/celery.conf +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/etc/systemd/system/patchman-celery-beat.service +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/etc/systemd/system/patchman-celery-worker@.service +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/migrations/0002_alter_machinearchitecture_options_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/migrations/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/models.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/arch/tests/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/celery.py +0 -0
- {patchman-4.0.21/domains → patchman-4.0.23/patchman/compliance}/__init__.py +0 -0
- {patchman-4.0.21/domains → patchman-4.0.23/patchman/compliance}/migrations/__init__.py +0 -0
- {patchman-4.0.21/domains → patchman-4.0.23/patchman/compliance}/tests/__init__.py +0 -0
- {patchman-4.0.21/errata → patchman-4.0.23/patchman/domains}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/migrations/0002_alter_domain_options.py +0 -0
- {patchman-4.0.21/errata → patchman-4.0.23/patchman/domains}/migrations/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/domains/models.py +0 -0
- {patchman-4.0.21/errata/sources → patchman-4.0.23/patchman/domains/tests}/__init__.py +0 -0
- {patchman-4.0.21/errata/sources/distros → patchman-4.0.23/patchman/errata}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0002_alter_erratumreference_unique_together.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0003_delete_erratumreference_alter_erratum_references.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0004_rename_packages_erratum_fixed_packages.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0005_erratum_affected_packages_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0006_alter_erratum_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0007_alter_erratum_fixed_packages.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0008_add_cached_count_fields.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0009_backfill_cached_counts.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/migrations/0010_synopsis_textfield.py +0 -0
- {patchman-4.0.21/errata/sources/repos → patchman-4.0.23/patchman/errata/migrations}/__init__.py +0 -0
- {patchman-4.0.21/hosts → patchman-4.0.23/patchman/errata/sources}/__init__.py +0 -0
- {patchman-4.0.21/hosts/migrations → patchman-4.0.23/patchman/errata/sources/distros}/__init__.py +0 -0
- {patchman-4.0.21/hosts/templatetags → patchman-4.0.23/patchman/errata/sources/repos}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/templates/errata/erratum_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/templates/errata/erratum_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/errata/tests/__init__.py +0 -0
- {patchman-4.0.21/hosts/tests → patchman-4.0.23/patchman/hosts}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0002_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0003_host_modules.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0004_remove_host_tags_host_tags.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0005_rename_os_host_osvariant.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0006_migrate_to_tz_aware.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0007_alter_host_tags.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0008_alter_host_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0009_host_errata.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0010_alter_hostrepo_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0011_host_bug_updates_count_host_errata_count_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0012_backfill_cached_counts.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/migrations/0013_alter_hostrepo_unique_together_and_more.py +0 -0
- {patchman-4.0.21/modules → patchman-4.0.23/patchman/hosts/migrations}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/templates/hosts/host_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/templates/hosts/host_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/templates/hosts/host_edit.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/hosts/templates/hosts/host_list.html +0 -0
- {patchman-4.0.21/modules/migrations → patchman-4.0.23/patchman/hosts/templatetags}/__init__.py +0 -0
- {patchman-4.0.21/operatingsystems → patchman-4.0.23/patchman/hosts/tests}/__init__.py +0 -0
- {patchman-4.0.21/operatingsystems/migrations → patchman-4.0.23/patchman/management}/__init__.py +0 -0
- {patchman-4.0.21/packages → patchman-4.0.23/patchman/management/commands}/__init__.py +0 -0
- {patchman-4.0.21/util → patchman-4.0.23/patchman}/management/commands/create_api_key.py +0 -0
- {patchman-4.0.21/util → patchman-4.0.23/patchman}/management/commands/list_api_keys.py +0 -0
- {patchman-4.0.21/util → patchman-4.0.23/patchman}/management/commands/revoke_api_key.py +0 -0
- {patchman-4.0.21/packages/migrations → patchman-4.0.23/patchman/modules}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0002_auto_20240204_2214.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0003_alter_module_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0004_alter_module_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0005_alter_module_unique_together.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0006_alter_module_context_alter_module_name_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/migrations/0007_alter_module_unique_together_module_unique_module.py +0 -0
- {patchman-4.0.21/packages/tests → patchman-4.0.23/patchman/modules/migrations}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/templates/modules/module_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/modules/templates/modules/module_list.html +0 -0
- {patchman-4.0.21/reports → patchman-4.0.23/patchman/operatingsystems}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/fixtures/os.json +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/fixtures/osgroup.json +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0002_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0003_os_arch.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0003_osgroup_codename.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0004_alter_osgroup_unique_together.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0005_rename_osgroup_osrelease_rename_os_osvariant_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0006_osrelease_cpe_name_osvariant_codename.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0007_alter_osrelease_unique_together.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0008_alter_osrelease_options_alter_osvariant_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0009_osvariant_hosts_count.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0010_backfill_osvariant_counts.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0011_alter_osrelease_codename_alter_osrelease_cpe_name_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/migrations/0012_alter_osrelease_unique_together_and_more.py +0 -0
- {patchman-4.0.21/reports → patchman-4.0.23/patchman/operatingsystems}/migrations/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/os_landing.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osrelease_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osrelease_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osvariant_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osvariant_delete_multiple.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/templates/operatingsystems/osvariant_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/operatingsystems/tests/__init__.py +0 -0
- {patchman-4.0.21/reports/tests → patchman-4.0.23/patchman/packages}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0002_auto_20250207_1319.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0002_delete_erratum_delete_erratumreference.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0003_auto_20250207_1746.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0004_alter_package_options_alter_packagecategory_options_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0005_alter_package_packagetype.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0006_alter_packageupdate_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0007_alter_package_epoch_alter_package_release_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/migrations/0008_alter_package_unique_together_and_more.py +0 -0
- {patchman-4.0.21/repos → patchman-4.0.23/patchman/packages/migrations}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/templates/packages/package_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/templates/packages/package_name_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/packages/templates/packages/package_name_list.html +0 -0
- {patchman-4.0.21/repos/migrations → patchman-4.0.23/patchman/packages/tests}/__init__.py +0 -0
- {patchman-4.0.21/repos/repo_types → patchman-4.0.23/patchman/reports}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/migrations/0002_report_modules.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/migrations/0003_remove_report_accessed.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/migrations/0004_migrate_to_tz_aware.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/migrations/0005_alter_report_options.py +0 -0
- {patchman-4.0.21/repos/templatetags → patchman-4.0.23/patchman/reports/migrations}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/templates/reports/report.txt +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/templates/reports/report_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/templates/reports/report_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/reports/templates/reports/report_list.html +0 -0
- {patchman-4.0.21/repos → patchman-4.0.23/patchman/reports}/tests/__init__.py +0 -0
- {patchman-4.0.21/security → patchman-4.0.23/patchman/repos}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0002_alter_repository_repotype.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0003_migrate_to_tz_aware.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0004_rename_file_checksum_mirror_package_checksum.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0005_rename_package_checksum_mirror_packages_checksum.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0006_mirror_errata_checksum_mirror_modules_checksum.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0007_alter_mirror_options_alter_mirrorpackage_options_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0008_mirror_packages_count.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/migrations/0009_backfill_mirror_counts.py +0 -0
- {patchman-4.0.21/security → patchman-4.0.23/patchman/repos}/migrations/__init__.py +0 -0
- {patchman-4.0.21/security/tests → patchman-4.0.23/patchman/repos/repo_types}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/mirror_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/mirror_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/mirror_edit.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/mirror_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/mirror_with_repo_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/repo_delete.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/repo_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/repo_edit.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/repos/templates/repos/repo_list.html +0 -0
- {patchman-4.0.21/util/management → patchman-4.0.23/patchman/repos/templatetags}/__init__.py +0 -0
- {patchman-4.0.21/util/management/commands → patchman-4.0.23/patchman/repos/tests}/__init__.py +0 -0
- {patchman-4.0.21/util/templatetags → patchman-4.0.23/patchman/security}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/managers.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0001_initial.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0002_alter_cve_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0003_alter_cve_description_alter_cwe_description.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0004_alter_cve_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0005_reference_cve_references.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0006_alter_cve_options_alter_cvss_unique_together.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0007_remove_cve_title.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0008_alter_cwe_options_alter_reference_options.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0009_alter_cvss_severity_alter_cvss_vector_string_and_more.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0010_fix_cvss_vector_string_length.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/migrations/0011_alter_cvss_unique_together_and_more.py +0 -0
- {patchman-4.0.21/util/tests → patchman-4.0.23/patchman/security/migrations}/__init__.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/cve_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/cve_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/cwe_detail.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/cwe_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/reference_list.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/security/templates/security/security_landing.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/signals.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/sqlite3/base.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/static/css/base.css +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/static/js/expandable-text.js +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/static/js/sidebar.js +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/filterspecs.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/logging.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/tables.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/404.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/500.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/base.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/bulk_actions.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/objectlist.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/registration/login.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/searchbar.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/templates/table.html +0 -0
- {patchman-4.0.21 → patchman-4.0.23/patchman}/util/tests/test_commands.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman/wsgi.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/patchman.egg-info/dependency_links.txt +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/sbin/patchman-manage +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/sbin/patchman-set-secret-key +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/scripts/clear-django-logs.py +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/scripts/create_graph.sh +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/scripts/rpm-install.sh +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/scripts/rpm-post-install.sh +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/setup.cfg +0 -0
- {patchman-4.0.21 → patchman-4.0.23}/setup.py +0 -0
|
@@ -527,6 +527,220 @@ $ patchman-client -s http://patchman.example.com -p 2 -k abc123...
|
|
|
527
527
|
```
|
|
528
528
|
|
|
529
529
|
|
|
530
|
+
## Client Certificate Authentication (mTLS)
|
|
531
|
+
|
|
532
|
+
Patchman supports mutual TLS (mTLS) authentication using client certificates.
|
|
533
|
+
This provides stronger security than API keys by cryptographically verifying
|
|
534
|
+
client identity.
|
|
535
|
+
|
|
536
|
+
### Overview
|
|
537
|
+
|
|
538
|
+
- **CA-agnostic design**: Supports step-ca (recommended) or HashiCorp Vault
|
|
539
|
+
- **Automated enrollment**: Clients can obtain certificates using one-time tokens
|
|
540
|
+
- **Auto-renewal**: Clients automatically renew certificates before expiry
|
|
541
|
+
- **Fail-secure**: If mTLS is configured, it must work (no silent fallback)
|
|
542
|
+
- **Backward compatible**: All mTLS features are optional
|
|
543
|
+
|
|
544
|
+
### Prerequisites
|
|
545
|
+
|
|
546
|
+
Install step-ca (recommended) or configure HashiCorp Vault PKI.
|
|
547
|
+
|
|
548
|
+
**Smallstep CA (step-ca):**
|
|
549
|
+
|
|
550
|
+
```shell
|
|
551
|
+
# Debian/Ubuntu
|
|
552
|
+
curl -sL https://packages.smallstep.com/stable/debian/step-ca.gpg | gpg --dearmor > /usr/share/keyrings/smallstep.gpg
|
|
553
|
+
echo "deb [signed-by=/usr/share/keyrings/smallstep.gpg] https://packages.smallstep.com/stable/debian any main" > /etc/apt/sources.list.d/smallstep.list
|
|
554
|
+
apt update && apt install step-ca step-cli
|
|
555
|
+
|
|
556
|
+
# RHEL/Rocky/Alma
|
|
557
|
+
dnf config-manager --add-repo https://packages.smallstep.com/stable/fedora/packages.smallstep.com.repo
|
|
558
|
+
dnf install step-ca step-cli
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Initialize your CA:
|
|
562
|
+
|
|
563
|
+
```shell
|
|
564
|
+
step ca init --name "Patchman CA" --provisioner patchman --address ":8443"
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
### Server Configuration
|
|
568
|
+
|
|
569
|
+
1. Add mTLS settings to `/etc/patchman/local_settings.py`:
|
|
570
|
+
|
|
571
|
+
```python
|
|
572
|
+
# Require client certificates for /api/report/ endpoint
|
|
573
|
+
REQUIRE_CLIENT_CERT = True
|
|
574
|
+
|
|
575
|
+
# Header names (set by web server)
|
|
576
|
+
CLIENT_CERT_CN_HEADER = 'HTTP_X_SSL_CLIENT_CN'
|
|
577
|
+
CLIENT_CERT_VERIFY_HEADER = 'HTTP_X_SSL_CLIENT_VERIFY'
|
|
578
|
+
|
|
579
|
+
# PKI provider for certificate enrollment
|
|
580
|
+
PKI_PROVIDER = 'util.pki.StepCAProvider'
|
|
581
|
+
PKI_PROVIDER_CONFIG = {
|
|
582
|
+
'ca_url': 'https://ca.example.com:8443',
|
|
583
|
+
'provisioner': 'patchman',
|
|
584
|
+
'provisioner_password_file': '/etc/patchman/ca-password',
|
|
585
|
+
'root_cert': '/etc/patchman/ca-root.crt',
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
# Certificate validity settings
|
|
589
|
+
CERT_VALIDITY_DAYS = 365
|
|
590
|
+
CERT_RENEW_THRESHOLD_DAYS = 30
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
2. Configure your web server to request and pass client certificates:
|
|
594
|
+
|
|
595
|
+
**Apache:**
|
|
596
|
+
|
|
597
|
+
```apache
|
|
598
|
+
SSLVerifyClient optional
|
|
599
|
+
SSLVerifyDepth 2
|
|
600
|
+
SSLCACertificateFile /etc/patchman/ca-root.crt
|
|
601
|
+
SSLOptions +StdEnvVars
|
|
602
|
+
|
|
603
|
+
RequestHeader set X-SSL-Client-CN "%{SSL_CLIENT_S_DN_CN}s"
|
|
604
|
+
RequestHeader set X-SSL-Client-Verify "%{SSL_CLIENT_VERIFY}s"
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
**nginx:**
|
|
608
|
+
|
|
609
|
+
```nginx
|
|
610
|
+
ssl_client_certificate /etc/patchman/ca-root.crt;
|
|
611
|
+
ssl_verify_client optional;
|
|
612
|
+
|
|
613
|
+
location / {
|
|
614
|
+
proxy_set_header X-SSL-Client-CN $ssl_client_s_dn_cn;
|
|
615
|
+
proxy_set_header X-SSL-Client-Verify $ssl_client_verify;
|
|
616
|
+
proxy_pass http://127.0.0.1:8000;
|
|
617
|
+
}
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
3. Add the middleware to `MIDDLEWARE` in settings (if not already present):
|
|
621
|
+
|
|
622
|
+
```python
|
|
623
|
+
MIDDLEWARE = [
|
|
624
|
+
# ... other middleware ...
|
|
625
|
+
'util.middleware.ClientCertMiddleware',
|
|
626
|
+
]
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
4. Run migrations:
|
|
630
|
+
|
|
631
|
+
```shell
|
|
632
|
+
patchman-manage migrate
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
### Enrolling Clients
|
|
636
|
+
|
|
637
|
+
1. Create an enrollment token on the server:
|
|
638
|
+
|
|
639
|
+
```shell
|
|
640
|
+
# Single host
|
|
641
|
+
$ patchman-manage create_enrollment_token --hostname "host1.example.com"
|
|
642
|
+
Created enrollment token for pattern: host1.example.com
|
|
643
|
+
Token: enroll_abc123...
|
|
644
|
+
Expires: 2026-02-07 03:00:00 UTC
|
|
645
|
+
|
|
646
|
+
# Wildcard pattern
|
|
647
|
+
$ patchman-manage create_enrollment_token --hostname "*.example.com" --expires 72h
|
|
648
|
+
|
|
649
|
+
# Single-use token
|
|
650
|
+
$ patchman-manage create_enrollment_token --hostname "newhost.example.com" --single-use
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
2. On the client, run enrollment:
|
|
654
|
+
|
|
655
|
+
```shell
|
|
656
|
+
# Python client
|
|
657
|
+
$ patchman-client.py --enroll --token enroll_abc123... -s https://patchman.example.com
|
|
658
|
+
|
|
659
|
+
# This will:
|
|
660
|
+
# - Generate a private key and CSR
|
|
661
|
+
# - Submit CSR to server
|
|
662
|
+
# - Receive signed certificate
|
|
663
|
+
# - Save to /etc/patchman/client.crt and /etc/patchman/client.key
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
3. Configure the client to use the certificate:
|
|
667
|
+
|
|
668
|
+
```shell
|
|
669
|
+
# /etc/patchman/patchman-client.conf
|
|
670
|
+
server=https://patchman.example.com
|
|
671
|
+
client_cert=/etc/patchman/client.crt
|
|
672
|
+
client_key=/etc/patchman/client.key
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
### Managing Certificates
|
|
676
|
+
|
|
677
|
+
List enrolled certificates:
|
|
678
|
+
|
|
679
|
+
```shell
|
|
680
|
+
$ patchman-manage list_certificates
|
|
681
|
+
host1.example.com Serial: ABC123 Expires: 2027-02-06 Valid
|
|
682
|
+
host2.example.com Serial: DEF456 Expires: 2027-02-06 Valid
|
|
683
|
+
oldhost.example.com Serial: GHI789 Expires: 2026-01-01 Expired
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Revoke a certificate:
|
|
687
|
+
|
|
688
|
+
```shell
|
|
689
|
+
$ patchman-manage revoke_certificate host1.example.com
|
|
690
|
+
Revoked certificate for host1.example.com
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
List enrollment tokens:
|
|
694
|
+
|
|
695
|
+
```shell
|
|
696
|
+
$ patchman-manage list_enrollment_tokens
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
### Auto-Renewal
|
|
700
|
+
|
|
701
|
+
The Python client automatically checks certificate expiry on each run. If the
|
|
702
|
+
certificate expires within the threshold (default 30 days), it will renew
|
|
703
|
+
before submitting the report.
|
|
704
|
+
|
|
705
|
+
To adjust the threshold:
|
|
706
|
+
|
|
707
|
+
```shell
|
|
708
|
+
# In patchman-client.conf
|
|
709
|
+
cert_renew_threshold=30
|
|
710
|
+
|
|
711
|
+
# Or disable auto-renewal
|
|
712
|
+
$ patchman-client.py --no-renew
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### Bash Client
|
|
716
|
+
|
|
717
|
+
The bash client supports mTLS but not automatic enrollment:
|
|
718
|
+
|
|
719
|
+
```shell
|
|
720
|
+
# Use existing certificate
|
|
721
|
+
$ patchman-client --cert /etc/patchman/client.crt --key /etc/patchman/client.key
|
|
722
|
+
|
|
723
|
+
# Or in config file
|
|
724
|
+
client_cert=/etc/patchman/client.crt
|
|
725
|
+
client_key=/etc/patchman/client.key
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
### Using Vault Instead of step-ca
|
|
729
|
+
|
|
730
|
+
To use HashiCorp Vault PKI instead:
|
|
731
|
+
|
|
732
|
+
```python
|
|
733
|
+
# /etc/patchman/local_settings.py
|
|
734
|
+
PKI_PROVIDER = 'util.pki.VaultProvider'
|
|
735
|
+
PKI_PROVIDER_CONFIG = {
|
|
736
|
+
'vault_addr': 'https://vault.example.com:8200',
|
|
737
|
+
'vault_token': 's.xxxxx', # Or use VAULT_TOKEN env var
|
|
738
|
+
'pki_mount': 'pki',
|
|
739
|
+
'pki_role': 'patchman-client',
|
|
740
|
+
}
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
|
|
530
744
|
# Test Installation
|
|
531
745
|
|
|
532
746
|
To test the installation, run the client locally on the patchman server:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: patchman
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.23
|
|
4
4
|
Summary: Django based patch status monitoring tool for linux systems
|
|
5
5
|
Home-page: http://patchman.openbytes.ie/
|
|
6
6
|
Author: Marcus Furlong
|
|
@@ -29,7 +29,7 @@ Requires-Dist: django-filter==25.1
|
|
|
29
29
|
Requires-Dist: humanize==4.12.1
|
|
30
30
|
Requires-Dist: version-utils==0.3.2
|
|
31
31
|
Requires-Dist: python-magic==0.4.27
|
|
32
|
-
Requires-Dist: gitpython==3.1.
|
|
32
|
+
Requires-Dist: gitpython==3.1.58
|
|
33
33
|
Requires-Dist: tenacity==8.2.3
|
|
34
34
|
Requires-Dist: celery==5.4.0
|
|
35
35
|
Requires-Dist: redis==6.4.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.23
|
|
@@ -115,3 +115,35 @@ LOGGING = {
|
|
|
115
115
|
'celery': {'level': 'WARNING', 'handlers': ['console'], 'propagate': False},
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
+
|
|
119
|
+
# =============================================================================
|
|
120
|
+
# Client Certificate Authentication (mTLS) - Optional
|
|
121
|
+
# =============================================================================
|
|
122
|
+
# See INSTALL.md for full setup instructions
|
|
123
|
+
|
|
124
|
+
# Enable mTLS requirement for report endpoints
|
|
125
|
+
# REQUIRE_CLIENT_CERT = True
|
|
126
|
+
|
|
127
|
+
# Require client cert CN to match report hostname
|
|
128
|
+
# CLIENT_CERT_STRICT_HOSTNAME = True
|
|
129
|
+
|
|
130
|
+
# =============================================================================
|
|
131
|
+
# PKI Provider Configuration (for certificate enrollment)
|
|
132
|
+
# =============================================================================
|
|
133
|
+
# Configure step-ca for certificate enrollment:
|
|
134
|
+
# PKI_PROVIDER = 'util.pki.StepCAProvider'
|
|
135
|
+
# PKI_PROVIDER_CONFIG = {
|
|
136
|
+
# 'ca_url': 'https://ca.example.com:9000',
|
|
137
|
+
# 'provisioner': 'patchman',
|
|
138
|
+
# 'provisioner_password_file': '/etc/patchman/step-ca-password',
|
|
139
|
+
# 'root_cert': '/etc/patchman/ca.crt',
|
|
140
|
+
# }
|
|
141
|
+
|
|
142
|
+
# Or configure Vault PKI:
|
|
143
|
+
# PKI_PROVIDER = 'util.pki.VaultProvider'
|
|
144
|
+
# PKI_PROVIDER_CONFIG = {
|
|
145
|
+
# 'vault_addr': 'https://vault.example.com:8200',
|
|
146
|
+
# 'vault_token_file': '/etc/patchman/vault-token',
|
|
147
|
+
# 'pki_path': 'pki',
|
|
148
|
+
# 'pki_role': 'patchman-client',
|
|
149
|
+
# }
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
from django.contrib import admin
|
|
19
19
|
|
|
20
|
-
from arch.models import MachineArchitecture, PackageArchitecture
|
|
20
|
+
from patchman.arch.models import MachineArchitecture, PackageArchitecture
|
|
21
21
|
|
|
22
22
|
admin.site.register(PackageArchitecture)
|
|
23
23
|
admin.site.register(MachineArchitecture)
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
from rest_framework import serializers
|
|
18
18
|
|
|
19
|
-
from arch.models import MachineArchitecture, PackageArchitecture
|
|
19
|
+
from patchman.arch.models import MachineArchitecture, PackageArchitecture
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class PackageArchitectureSerializer(serializers.HyperlinkedModelSerializer):
|
|
@@ -19,7 +19,7 @@ from django.test import TestCase, override_settings
|
|
|
19
19
|
from rest_framework import status
|
|
20
20
|
from rest_framework.test import APITestCase
|
|
21
21
|
|
|
22
|
-
from arch.models import MachineArchitecture, PackageArchitecture
|
|
22
|
+
from patchman.arch.models import MachineArchitecture, PackageArchitecture
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@override_settings(
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
# You should have received a copy of the GNU General Public License
|
|
15
15
|
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
|
|
16
16
|
|
|
17
|
-
from arch.models import MachineArchitecture, PackageArchitecture
|
|
18
|
-
from util.logging import info_message
|
|
17
|
+
from patchman.arch.models import MachineArchitecture, PackageArchitecture
|
|
18
|
+
from patchman.util.logging import info_message
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def clean_package_architectures():
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
from rest_framework import viewsets
|
|
18
18
|
|
|
19
|
-
from arch.models import MachineArchitecture, PackageArchitecture
|
|
20
|
-
from arch.serializers import (
|
|
19
|
+
from patchman.arch.models import MachineArchitecture, PackageArchitecture
|
|
20
|
+
from patchman.arch.serializers import (
|
|
21
21
|
MachineArchitectureSerializer, PackageArchitectureSerializer,
|
|
22
22
|
)
|
|
23
23
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Copyright 2025 Marcus Furlong <furlongm@gmail.com>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Patchman.
|
|
4
|
+
#
|
|
5
|
+
# Patchman is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, version 3 only.
|
|
8
|
+
#
|
|
9
|
+
# Patchman is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
|
|
16
|
+
|
|
17
|
+
from django.contrib import admin
|
|
18
|
+
|
|
19
|
+
from patchman.compliance.models import (
|
|
20
|
+
ComplianceProfile, ComplianceResult, ComplianceRule, ComplianceScan,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@admin.register(ComplianceProfile)
|
|
25
|
+
class ComplianceProfileAdmin(admin.ModelAdmin):
|
|
26
|
+
list_display = ('profile_id', 'title')
|
|
27
|
+
search_fields = ('profile_id', 'title', 'description')
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@admin.register(ComplianceRule)
|
|
31
|
+
class ComplianceRuleAdmin(admin.ModelAdmin):
|
|
32
|
+
list_display = ('rule_id', 'title', 'severity')
|
|
33
|
+
list_filter = ('severity',)
|
|
34
|
+
search_fields = ('rule_id', 'title', 'description')
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@admin.register(ComplianceScan)
|
|
38
|
+
class ComplianceScanAdmin(admin.ModelAdmin):
|
|
39
|
+
list_display = (
|
|
40
|
+
'host', 'profile', 'score', 'pass_count',
|
|
41
|
+
'fail_count', 'error_count', 'scanned_at',
|
|
42
|
+
)
|
|
43
|
+
list_filter = ('profile', 'scanned_at')
|
|
44
|
+
search_fields = ('host__hostname', 'profile__profile_id')
|
|
45
|
+
raw_id_fields = ('host', 'profile')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@admin.register(ComplianceResult)
|
|
49
|
+
class ComplianceResultAdmin(admin.ModelAdmin):
|
|
50
|
+
list_display = ('scan', 'rule', 'result')
|
|
51
|
+
list_filter = ('result',)
|
|
52
|
+
search_fields = ('rule__rule_id', 'scan__host__hostname')
|
|
53
|
+
raw_id_fields = ('scan', 'rule')
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright 2025 Marcus Furlong <furlongm@gmail.com>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Patchman.
|
|
4
|
+
#
|
|
5
|
+
# Patchman is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, version 3 only.
|
|
8
|
+
#
|
|
9
|
+
# Patchman is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
|
|
16
|
+
|
|
17
|
+
from django.apps import AppConfig
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ComplianceConfig(AppConfig):
|
|
21
|
+
name = 'patchman.compliance'
|
|
22
|
+
label = 'compliance'
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Generated by Django 4.2.28 on 2026-05-12 21:30
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
initial = True
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
('hosts', '0013_alter_hostrepo_unique_together_and_more'),
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
operations = [
|
|
16
|
+
migrations.CreateModel(
|
|
17
|
+
name='ComplianceProfile',
|
|
18
|
+
fields=[
|
|
19
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
20
|
+
('profile_id', models.CharField(max_length=255, unique=True)),
|
|
21
|
+
('title', models.CharField(blank=True, default='', max_length=512)),
|
|
22
|
+
('description', models.TextField(blank=True, default='')),
|
|
23
|
+
],
|
|
24
|
+
options={
|
|
25
|
+
'ordering': ['profile_id'],
|
|
26
|
+
},
|
|
27
|
+
),
|
|
28
|
+
migrations.CreateModel(
|
|
29
|
+
name='ComplianceRule',
|
|
30
|
+
fields=[
|
|
31
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
32
|
+
('rule_id', models.CharField(max_length=255, unique=True)),
|
|
33
|
+
('title', models.CharField(blank=True, default='', max_length=512)),
|
|
34
|
+
('severity', models.CharField(blank=True, default='', max_length=32)),
|
|
35
|
+
('description', models.TextField(blank=True, default='')),
|
|
36
|
+
],
|
|
37
|
+
options={
|
|
38
|
+
'ordering': ['rule_id'],
|
|
39
|
+
},
|
|
40
|
+
),
|
|
41
|
+
migrations.CreateModel(
|
|
42
|
+
name='ComplianceScan',
|
|
43
|
+
fields=[
|
|
44
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
45
|
+
('datastream', models.CharField(blank=True, default='', max_length=255)),
|
|
46
|
+
('score', models.FloatField(default=0.0)),
|
|
47
|
+
('score_maximum', models.FloatField(default=100.0)),
|
|
48
|
+
('pass_count', models.IntegerField(default=0)),
|
|
49
|
+
('fail_count', models.IntegerField(default=0)),
|
|
50
|
+
('error_count', models.IntegerField(default=0)),
|
|
51
|
+
('notapplicable_count', models.IntegerField(default=0)),
|
|
52
|
+
('scanned_at', models.DateTimeField()),
|
|
53
|
+
('created', models.DateTimeField(auto_now_add=True)),
|
|
54
|
+
('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compliance_scans', to='hosts.host')),
|
|
55
|
+
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='scans', to='compliance.complianceprofile')),
|
|
56
|
+
],
|
|
57
|
+
options={
|
|
58
|
+
'ordering': ['-scanned_at'],
|
|
59
|
+
},
|
|
60
|
+
),
|
|
61
|
+
migrations.CreateModel(
|
|
62
|
+
name='ComplianceResult',
|
|
63
|
+
fields=[
|
|
64
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
65
|
+
('result', models.CharField(choices=[('pass', 'Pass'), ('fail', 'Fail'), ('error', 'Error'), ('notapplicable', 'Not Applicable'), ('notchecked', 'Not Checked'), ('notselected', 'Not Selected'), ('informational', 'Informational'), ('fixed', 'Fixed')], max_length=32)),
|
|
66
|
+
('rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='compliance.compliancerule')),
|
|
67
|
+
('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='compliance.compliancescan')),
|
|
68
|
+
],
|
|
69
|
+
),
|
|
70
|
+
migrations.AddConstraint(
|
|
71
|
+
model_name='compliancescan',
|
|
72
|
+
constraint=models.UniqueConstraint(fields=('host', 'profile', 'scanned_at'), name='unique_compliance_scan'),
|
|
73
|
+
),
|
|
74
|
+
migrations.AddIndex(
|
|
75
|
+
model_name='complianceresult',
|
|
76
|
+
index=models.Index(fields=['rule', 'result'], name='compliance__rule_id_3f1e07_idx'),
|
|
77
|
+
),
|
|
78
|
+
migrations.AddConstraint(
|
|
79
|
+
model_name='complianceresult',
|
|
80
|
+
constraint=models.UniqueConstraint(fields=('scan', 'rule'), name='unique_compliance_result'),
|
|
81
|
+
),
|
|
82
|
+
]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Copyright 2025 Marcus Furlong <furlongm@gmail.com>
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Patchman.
|
|
4
|
+
#
|
|
5
|
+
# Patchman is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, version 3 only.
|
|
8
|
+
#
|
|
9
|
+
# Patchman is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
|
|
16
|
+
|
|
17
|
+
from django.db import models
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ComplianceProfile(models.Model):
|
|
21
|
+
|
|
22
|
+
profile_id = models.CharField(max_length=255, unique=True)
|
|
23
|
+
title = models.CharField(max_length=512, blank=True, default='')
|
|
24
|
+
description = models.TextField(blank=True, default='')
|
|
25
|
+
|
|
26
|
+
class Meta:
|
|
27
|
+
ordering = ['profile_id']
|
|
28
|
+
|
|
29
|
+
def __str__(self):
|
|
30
|
+
return self.profile_id
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ComplianceRule(models.Model):
|
|
34
|
+
|
|
35
|
+
rule_id = models.CharField(max_length=255, unique=True)
|
|
36
|
+
title = models.CharField(max_length=512, blank=True, default='')
|
|
37
|
+
severity = models.CharField(max_length=32, blank=True, default='')
|
|
38
|
+
description = models.TextField(blank=True, default='')
|
|
39
|
+
|
|
40
|
+
class Meta:
|
|
41
|
+
ordering = ['rule_id']
|
|
42
|
+
|
|
43
|
+
def __str__(self):
|
|
44
|
+
return self.rule_id
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ComplianceScan(models.Model):
|
|
48
|
+
|
|
49
|
+
host = models.ForeignKey(
|
|
50
|
+
'hosts.Host',
|
|
51
|
+
on_delete=models.CASCADE,
|
|
52
|
+
related_name='compliance_scans',
|
|
53
|
+
)
|
|
54
|
+
profile = models.ForeignKey(
|
|
55
|
+
ComplianceProfile,
|
|
56
|
+
on_delete=models.CASCADE,
|
|
57
|
+
related_name='scans',
|
|
58
|
+
)
|
|
59
|
+
datastream = models.CharField(max_length=255, blank=True, default='')
|
|
60
|
+
score = models.FloatField(default=0.0)
|
|
61
|
+
score_maximum = models.FloatField(default=100.0)
|
|
62
|
+
pass_count = models.IntegerField(default=0)
|
|
63
|
+
fail_count = models.IntegerField(default=0)
|
|
64
|
+
error_count = models.IntegerField(default=0)
|
|
65
|
+
notapplicable_count = models.IntegerField(default=0)
|
|
66
|
+
scanned_at = models.DateTimeField()
|
|
67
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
68
|
+
|
|
69
|
+
class Meta:
|
|
70
|
+
ordering = ['-scanned_at']
|
|
71
|
+
constraints = [
|
|
72
|
+
models.UniqueConstraint(
|
|
73
|
+
fields=['host', 'profile', 'scanned_at'],
|
|
74
|
+
name='unique_compliance_scan',
|
|
75
|
+
),
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
def __str__(self):
|
|
79
|
+
return f'{self.host} - {self.profile} @ {self.scanned_at}'
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class ComplianceResult(models.Model):
|
|
83
|
+
|
|
84
|
+
RESULT_CHOICES = [
|
|
85
|
+
('pass', 'Pass'),
|
|
86
|
+
('fail', 'Fail'),
|
|
87
|
+
('error', 'Error'),
|
|
88
|
+
('notapplicable', 'Not Applicable'),
|
|
89
|
+
('notchecked', 'Not Checked'),
|
|
90
|
+
('notselected', 'Not Selected'),
|
|
91
|
+
('informational', 'Informational'),
|
|
92
|
+
('fixed', 'Fixed'),
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
scan = models.ForeignKey(
|
|
96
|
+
ComplianceScan,
|
|
97
|
+
on_delete=models.CASCADE,
|
|
98
|
+
related_name='results',
|
|
99
|
+
)
|
|
100
|
+
rule = models.ForeignKey(
|
|
101
|
+
ComplianceRule,
|
|
102
|
+
on_delete=models.CASCADE,
|
|
103
|
+
related_name='results',
|
|
104
|
+
)
|
|
105
|
+
result = models.CharField(max_length=32, choices=RESULT_CHOICES)
|
|
106
|
+
|
|
107
|
+
class Meta:
|
|
108
|
+
constraints = [
|
|
109
|
+
models.UniqueConstraint(
|
|
110
|
+
fields=['scan', 'rule'],
|
|
111
|
+
name='unique_compliance_result',
|
|
112
|
+
),
|
|
113
|
+
]
|
|
114
|
+
indexes = [
|
|
115
|
+
models.Index(fields=['rule', 'result']),
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
def __str__(self):
|
|
119
|
+
return f'{self.rule} - {self.result}'
|