patchman 4.0.18__tar.gz → 4.0.19__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.
Files changed (361) hide show
  1. {patchman-4.0.18 → patchman-4.0.19}/PKG-INFO +4 -4
  2. patchman-4.0.19/VERSION.txt +1 -0
  3. {patchman-4.0.18 → patchman-4.0.19}/errata/models.py +54 -52
  4. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/alma.py +21 -22
  5. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/arch.py +16 -11
  6. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/debian.py +52 -34
  7. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/rocky.py +31 -23
  8. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/ubuntu.py +17 -19
  9. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/repos/yum.py +14 -14
  10. {patchman-4.0.18 → patchman-4.0.19}/errata/tasks.py +14 -4
  11. {patchman-4.0.18 → patchman-4.0.19}/errata/utils.py +44 -21
  12. {patchman-4.0.18 → patchman-4.0.19}/etc/patchman/local_settings.py +1 -1
  13. {patchman-4.0.18 → patchman-4.0.19}/etc/systemd/system/patchman-celery-beat.service +2 -0
  14. {patchman-4.0.18 → patchman-4.0.19}/etc/systemd/system/patchman-celery-worker@.service +3 -0
  15. {patchman-4.0.18 → patchman-4.0.19}/hosts/models.py +56 -68
  16. {patchman-4.0.18 → patchman-4.0.19}/hosts/tables.py +4 -2
  17. {patchman-4.0.18 → patchman-4.0.19}/hosts/tests/test_models.py +106 -18
  18. {patchman-4.0.18 → patchman-4.0.19}/hosts/views.py +3 -0
  19. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/views.py +2 -2
  20. {patchman-4.0.18 → patchman-4.0.19}/packages/tables.py +95 -12
  21. patchman-4.0.19/packages/templates/packages/package_name_detail.html +20 -0
  22. patchman-4.0.19/packages/templates/packages/package_update_list.html +7 -0
  23. patchman-4.0.19/packages/tests/test_views.py +72 -0
  24. {patchman-4.0.18 → patchman-4.0.19}/packages/urls.py +1 -0
  25. {patchman-4.0.18 → patchman-4.0.19}/packages/utils.py +16 -0
  26. {patchman-4.0.18 → patchman-4.0.19}/packages/views.py +64 -4
  27. {patchman-4.0.18 → patchman-4.0.19}/patchman/celery.py +14 -0
  28. {patchman-4.0.18 → patchman-4.0.19}/patchman/receivers.py +4 -3
  29. {patchman-4.0.18 → patchman-4.0.19}/patchman/sqlite3/base.py +5 -0
  30. {patchman-4.0.18 → patchman-4.0.19}/patchman.egg-info/PKG-INFO +4 -4
  31. {patchman-4.0.18 → patchman-4.0.19}/patchman.egg-info/SOURCES.txt +2 -0
  32. {patchman-4.0.18 → patchman-4.0.19}/patchman.egg-info/requires.txt +3 -3
  33. {patchman-4.0.18 → patchman-4.0.19}/reports/models.py +1 -1
  34. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_utils.py +29 -0
  35. {patchman-4.0.18 → patchman-4.0.19}/reports/utils.py +0 -3
  36. {patchman-4.0.18 → patchman-4.0.19}/reports/views.py +1 -1
  37. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/yum.py +1 -0
  38. {patchman-4.0.18 → patchman-4.0.19}/repos/views.py +2 -2
  39. {patchman-4.0.18 → patchman-4.0.19}/requirements.txt +3 -3
  40. {patchman-4.0.18 → patchman-4.0.19}/sbin/patchman +13 -2
  41. {patchman-4.0.18 → patchman-4.0.19}/security/models.py +3 -1
  42. {patchman-4.0.18 → patchman-4.0.19}/security/utils.py +8 -4
  43. {patchman-4.0.18 → patchman-4.0.19}/util/__init__.py +47 -2
  44. {patchman-4.0.18 → patchman-4.0.19}/util/logging.py +15 -0
  45. {patchman-4.0.18 → patchman-4.0.19}/util/templates/navbar.html +7 -1
  46. patchman-4.0.18/VERSION.txt +0 -1
  47. patchman-4.0.18/packages/templates/packages/package_name_detail.html +0 -43
  48. {patchman-4.0.18 → patchman-4.0.19}/AUTHORS +0 -0
  49. {patchman-4.0.18 → patchman-4.0.19}/COPYING +0 -0
  50. {patchman-4.0.18 → patchman-4.0.19}/INSTALL.md +0 -0
  51. {patchman-4.0.18 → patchman-4.0.19}/MANIFEST.in +0 -0
  52. {patchman-4.0.18 → patchman-4.0.19}/README.md +0 -0
  53. {patchman-4.0.18 → patchman-4.0.19}/arch/__init__.py +0 -0
  54. {patchman-4.0.18 → patchman-4.0.19}/arch/admin.py +0 -0
  55. {patchman-4.0.18 → patchman-4.0.19}/arch/apps.py +0 -0
  56. {patchman-4.0.18 → patchman-4.0.19}/arch/migrations/0001_initial.py +0 -0
  57. {patchman-4.0.18 → patchman-4.0.19}/arch/migrations/0002_alter_machinearchitecture_options_and_more.py +0 -0
  58. {patchman-4.0.18 → patchman-4.0.19}/arch/migrations/__init__.py +0 -0
  59. {patchman-4.0.18 → patchman-4.0.19}/arch/models.py +0 -0
  60. {patchman-4.0.18 → patchman-4.0.19}/arch/serializers.py +0 -0
  61. {patchman-4.0.18 → patchman-4.0.19}/arch/tests/__init__.py +0 -0
  62. {patchman-4.0.18 → patchman-4.0.19}/arch/tests/test_api.py +0 -0
  63. {patchman-4.0.18 → patchman-4.0.19}/arch/tests/test_models.py +0 -0
  64. {patchman-4.0.18 → patchman-4.0.19}/arch/utils.py +0 -0
  65. {patchman-4.0.18 → patchman-4.0.19}/arch/views.py +0 -0
  66. {patchman-4.0.18 → patchman-4.0.19}/domains/__init__.py +0 -0
  67. {patchman-4.0.18 → patchman-4.0.19}/domains/admin.py +0 -0
  68. {patchman-4.0.18 → patchman-4.0.19}/domains/apps.py +0 -0
  69. {patchman-4.0.18 → patchman-4.0.19}/domains/migrations/0001_initial.py +0 -0
  70. {patchman-4.0.18 → patchman-4.0.19}/domains/migrations/0002_alter_domain_options.py +0 -0
  71. {patchman-4.0.18 → patchman-4.0.19}/domains/migrations/__init__.py +0 -0
  72. {patchman-4.0.18 → patchman-4.0.19}/domains/models.py +0 -0
  73. {patchman-4.0.18 → patchman-4.0.19}/domains/serializers.py +0 -0
  74. {patchman-4.0.18 → patchman-4.0.19}/domains/tests/__init__.py +0 -0
  75. {patchman-4.0.18 → patchman-4.0.19}/domains/tests/test_api.py +0 -0
  76. {patchman-4.0.18 → patchman-4.0.19}/domains/tests/test_models.py +0 -0
  77. {patchman-4.0.18 → patchman-4.0.19}/domains/views.py +0 -0
  78. {patchman-4.0.18 → patchman-4.0.19}/errata/__init__.py +0 -0
  79. {patchman-4.0.18 → patchman-4.0.19}/errata/admin.py +0 -0
  80. {patchman-4.0.18 → patchman-4.0.19}/errata/apps.py +0 -0
  81. {patchman-4.0.18 → patchman-4.0.19}/errata/managers.py +0 -0
  82. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0001_initial.py +0 -0
  83. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0002_alter_erratumreference_unique_together.py +0 -0
  84. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0003_delete_erratumreference_alter_erratum_references.py +0 -0
  85. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0004_rename_packages_erratum_fixed_packages.py +0 -0
  86. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0005_erratum_affected_packages_and_more.py +0 -0
  87. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0006_alter_erratum_options.py +0 -0
  88. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0007_alter_erratum_fixed_packages.py +0 -0
  89. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0008_add_cached_count_fields.py +0 -0
  90. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/0009_backfill_cached_counts.py +0 -0
  91. {patchman-4.0.18 → patchman-4.0.19}/errata/migrations/__init__.py +0 -0
  92. {patchman-4.0.18 → patchman-4.0.19}/errata/serializers.py +0 -0
  93. {patchman-4.0.18 → patchman-4.0.19}/errata/signals.py +0 -0
  94. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/__init__.py +0 -0
  95. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/__init__.py +0 -0
  96. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/distros/centos.py +0 -0
  97. {patchman-4.0.18 → patchman-4.0.19}/errata/sources/repos/__init__.py +0 -0
  98. {patchman-4.0.18 → patchman-4.0.19}/errata/tables.py +0 -0
  99. {patchman-4.0.18 → patchman-4.0.19}/errata/templates/errata/erratum_detail.html +0 -0
  100. {patchman-4.0.18 → patchman-4.0.19}/errata/templates/errata/erratum_list.html +0 -0
  101. {patchman-4.0.18 → patchman-4.0.19}/errata/tests/__init__.py +0 -0
  102. {patchman-4.0.18 → patchman-4.0.19}/errata/tests/test_api.py +0 -0
  103. {patchman-4.0.18 → patchman-4.0.19}/errata/tests/test_integration.py +0 -0
  104. {patchman-4.0.18 → patchman-4.0.19}/errata/tests/test_models.py +0 -0
  105. {patchman-4.0.18 → patchman-4.0.19}/errata/urls.py +0 -0
  106. {patchman-4.0.18 → patchman-4.0.19}/errata/views.py +0 -0
  107. {patchman-4.0.18 → patchman-4.0.19}/etc/patchman/apache.conf.example +0 -0
  108. {patchman-4.0.18 → patchman-4.0.19}/etc/patchman/celery.conf +0 -0
  109. {patchman-4.0.18 → patchman-4.0.19}/hosts/__init__.py +0 -0
  110. {patchman-4.0.18 → patchman-4.0.19}/hosts/admin.py +0 -0
  111. {patchman-4.0.18 → patchman-4.0.19}/hosts/apps.py +0 -0
  112. {patchman-4.0.18 → patchman-4.0.19}/hosts/forms.py +0 -0
  113. {patchman-4.0.18 → patchman-4.0.19}/hosts/managers.py +0 -0
  114. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0001_initial.py +0 -0
  115. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0002_initial.py +0 -0
  116. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0003_host_modules.py +0 -0
  117. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0004_remove_host_tags_host_tags.py +0 -0
  118. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0005_rename_os_host_osvariant.py +0 -0
  119. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0006_migrate_to_tz_aware.py +0 -0
  120. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0007_alter_host_tags.py +0 -0
  121. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0008_alter_host_options.py +0 -0
  122. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0009_host_errata.py +0 -0
  123. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0010_alter_hostrepo_options.py +0 -0
  124. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0011_host_bug_updates_count_host_errata_count_and_more.py +0 -0
  125. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/0012_backfill_cached_counts.py +0 -0
  126. {patchman-4.0.18 → patchman-4.0.19}/hosts/migrations/__init__.py +0 -0
  127. {patchman-4.0.18 → patchman-4.0.19}/hosts/serializers.py +0 -0
  128. {patchman-4.0.18 → patchman-4.0.19}/hosts/signals.py +0 -0
  129. {patchman-4.0.18 → patchman-4.0.19}/hosts/tasks.py +0 -0
  130. {patchman-4.0.18 → patchman-4.0.19}/hosts/templates/hosts/host_delete.html +0 -0
  131. {patchman-4.0.18 → patchman-4.0.19}/hosts/templates/hosts/host_detail.html +0 -0
  132. {patchman-4.0.18 → patchman-4.0.19}/hosts/templates/hosts/host_edit.html +0 -0
  133. {patchman-4.0.18 → patchman-4.0.19}/hosts/templates/hosts/host_list.html +0 -0
  134. {patchman-4.0.18 → patchman-4.0.19}/hosts/templatetags/__init__.py +0 -0
  135. {patchman-4.0.18 → patchman-4.0.19}/hosts/templatetags/report_alert.py +0 -0
  136. {patchman-4.0.18 → patchman-4.0.19}/hosts/tests/__init__.py +0 -0
  137. {patchman-4.0.18 → patchman-4.0.19}/hosts/tests/test_api.py +0 -0
  138. {patchman-4.0.18 → patchman-4.0.19}/hosts/tests/test_find_updates.py +0 -0
  139. {patchman-4.0.18 → patchman-4.0.19}/hosts/tests/test_managers.py +0 -0
  140. {patchman-4.0.18 → patchman-4.0.19}/hosts/urls.py +0 -0
  141. {patchman-4.0.18 → patchman-4.0.19}/hosts/utils.py +0 -0
  142. {patchman-4.0.18 → patchman-4.0.19}/modules/__init__.py +0 -0
  143. {patchman-4.0.18 → patchman-4.0.19}/modules/admin.py +0 -0
  144. {patchman-4.0.18 → patchman-4.0.19}/modules/apps.py +0 -0
  145. {patchman-4.0.18 → patchman-4.0.19}/modules/managers.py +0 -0
  146. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0001_initial.py +0 -0
  147. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0002_auto_20240204_2214.py +0 -0
  148. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0003_alter_module_options.py +0 -0
  149. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0004_alter_module_options.py +0 -0
  150. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0005_alter_module_unique_together.py +0 -0
  151. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/0006_alter_module_context_alter_module_name_and_more.py +0 -0
  152. {patchman-4.0.18 → patchman-4.0.19}/modules/migrations/__init__.py +0 -0
  153. {patchman-4.0.18 → patchman-4.0.19}/modules/models.py +0 -0
  154. {patchman-4.0.18 → patchman-4.0.19}/modules/serializers.py +0 -0
  155. {patchman-4.0.18 → patchman-4.0.19}/modules/tables.py +0 -0
  156. {patchman-4.0.18 → patchman-4.0.19}/modules/templates/modules/module_detail.html +0 -0
  157. {patchman-4.0.18 → patchman-4.0.19}/modules/templates/modules/module_list.html +0 -0
  158. {patchman-4.0.18 → patchman-4.0.19}/modules/urls.py +0 -0
  159. {patchman-4.0.18 → patchman-4.0.19}/modules/utils.py +0 -0
  160. {patchman-4.0.18 → patchman-4.0.19}/modules/views.py +0 -0
  161. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/__init__.py +0 -0
  162. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/admin.py +0 -0
  163. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/apps.py +0 -0
  164. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/fixtures/os.json +0 -0
  165. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/fixtures/osgroup.json +0 -0
  166. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/forms.py +0 -0
  167. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/managers.py +0 -0
  168. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0001_initial.py +0 -0
  169. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0002_initial.py +0 -0
  170. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0003_os_arch.py +0 -0
  171. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0003_osgroup_codename.py +0 -0
  172. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0004_alter_osgroup_unique_together.py +0 -0
  173. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0005_rename_osgroup_osrelease_rename_os_osvariant_and_more.py +0 -0
  174. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0006_osrelease_cpe_name_osvariant_codename.py +0 -0
  175. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0007_alter_osrelease_unique_together.py +0 -0
  176. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0008_alter_osrelease_options_alter_osvariant_options.py +0 -0
  177. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0009_osvariant_hosts_count.py +0 -0
  178. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0010_backfill_osvariant_counts.py +0 -0
  179. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/0011_alter_osrelease_codename_alter_osrelease_cpe_name_and_more.py +0 -0
  180. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/migrations/__init__.py +0 -0
  181. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/models.py +0 -0
  182. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/serializers.py +0 -0
  183. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/signals.py +0 -0
  184. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/tables.py +0 -0
  185. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/os_landing.html +0 -0
  186. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osrelease_delete.html +0 -0
  187. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osrelease_detail.html +0 -0
  188. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osrelease_list.html +0 -0
  189. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osvariant_delete.html +0 -0
  190. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osvariant_delete_multiple.html +0 -0
  191. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osvariant_detail.html +0 -0
  192. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/templates/operatingsystems/osvariant_list.html +0 -0
  193. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/tests/__init__.py +0 -0
  194. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/tests/test_api.py +0 -0
  195. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/tests/test_models.py +0 -0
  196. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/urls.py +0 -0
  197. {patchman-4.0.18 → patchman-4.0.19}/operatingsystems/utils.py +0 -0
  198. {patchman-4.0.18 → patchman-4.0.19}/packages/__init__.py +0 -0
  199. {patchman-4.0.18 → patchman-4.0.19}/packages/admin.py +0 -0
  200. {patchman-4.0.18 → patchman-4.0.19}/packages/apps.py +0 -0
  201. {patchman-4.0.18 → patchman-4.0.19}/packages/managers.py +0 -0
  202. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0001_initial.py +0 -0
  203. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0002_auto_20250207_1319.py +0 -0
  204. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0002_delete_erratum_delete_erratumreference.py +0 -0
  205. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0003_auto_20250207_1746.py +0 -0
  206. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0004_alter_package_options_alter_packagecategory_options_and_more.py +0 -0
  207. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0005_alter_package_packagetype.py +0 -0
  208. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0006_alter_packageupdate_options.py +0 -0
  209. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/0007_alter_package_epoch_alter_package_release_and_more.py +0 -0
  210. {patchman-4.0.18 → patchman-4.0.19}/packages/migrations/__init__.py +0 -0
  211. {patchman-4.0.18 → patchman-4.0.19}/packages/models.py +0 -0
  212. {patchman-4.0.18 → patchman-4.0.19}/packages/serializers.py +0 -0
  213. {patchman-4.0.18 → patchman-4.0.19}/packages/templates/packages/package_detail.html +0 -0
  214. {patchman-4.0.18 → patchman-4.0.19}/packages/templates/packages/package_list.html +0 -0
  215. {patchman-4.0.18 → patchman-4.0.19}/packages/templates/packages/package_name_list.html +0 -0
  216. {patchman-4.0.18 → patchman-4.0.19}/packages/tests/__init__.py +0 -0
  217. {patchman-4.0.18 → patchman-4.0.19}/packages/tests/test_api.py +0 -0
  218. {patchman-4.0.18 → patchman-4.0.19}/packages/tests/test_models.py +0 -0
  219. {patchman-4.0.18 → patchman-4.0.19}/packages/tests/test_version_compare.py +0 -0
  220. {patchman-4.0.18 → patchman-4.0.19}/patchman/__init__.py +0 -0
  221. {patchman-4.0.18 → patchman-4.0.19}/patchman/settings.py +0 -0
  222. {patchman-4.0.18 → patchman-4.0.19}/patchman/signals.py +0 -0
  223. {patchman-4.0.18 → patchman-4.0.19}/patchman/static/css/base.css +0 -0
  224. {patchman-4.0.18 → patchman-4.0.19}/patchman/static/js/expandable-text.js +0 -0
  225. {patchman-4.0.18 → patchman-4.0.19}/patchman/static/js/sidebar.js +0 -0
  226. {patchman-4.0.18 → patchman-4.0.19}/patchman/urls.py +0 -0
  227. {patchman-4.0.18 → patchman-4.0.19}/patchman/wsgi.py +0 -0
  228. {patchman-4.0.18 → patchman-4.0.19}/patchman.egg-info/dependency_links.txt +0 -0
  229. {patchman-4.0.18 → patchman-4.0.19}/patchman.egg-info/top_level.txt +0 -0
  230. {patchman-4.0.18 → patchman-4.0.19}/reports/__init__.py +0 -0
  231. {patchman-4.0.18 → patchman-4.0.19}/reports/admin.py +0 -0
  232. {patchman-4.0.18 → patchman-4.0.19}/reports/apps.py +0 -0
  233. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/0001_initial.py +0 -0
  234. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/0002_report_modules.py +0 -0
  235. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/0003_remove_report_accessed.py +0 -0
  236. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/0004_migrate_to_tz_aware.py +0 -0
  237. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/0005_alter_report_options.py +0 -0
  238. {patchman-4.0.18 → patchman-4.0.19}/reports/migrations/__init__.py +0 -0
  239. {patchman-4.0.18 → patchman-4.0.19}/reports/serializers.py +0 -0
  240. {patchman-4.0.18 → patchman-4.0.19}/reports/tables.py +0 -0
  241. {patchman-4.0.18 → patchman-4.0.19}/reports/tasks.py +0 -0
  242. {patchman-4.0.18 → patchman-4.0.19}/reports/templates/reports/report.txt +0 -0
  243. {patchman-4.0.18 → patchman-4.0.19}/reports/templates/reports/report_delete.html +0 -0
  244. {patchman-4.0.18 → patchman-4.0.19}/reports/templates/reports/report_detail.html +0 -0
  245. {patchman-4.0.18 → patchman-4.0.19}/reports/templates/reports/report_list.html +0 -0
  246. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/__init__.py +0 -0
  247. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_api.py +0 -0
  248. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_edge_cases.py +0 -0
  249. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_integration.py +0 -0
  250. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_models.py +0 -0
  251. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_parsing.py +0 -0
  252. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_serializers.py +0 -0
  253. {patchman-4.0.18 → patchman-4.0.19}/reports/tests/test_tasks.py +0 -0
  254. {patchman-4.0.18 → patchman-4.0.19}/reports/urls.py +0 -0
  255. {patchman-4.0.18 → patchman-4.0.19}/repos/__init__.py +0 -0
  256. {patchman-4.0.18 → patchman-4.0.19}/repos/admin.py +0 -0
  257. {patchman-4.0.18 → patchman-4.0.19}/repos/apps.py +0 -0
  258. {patchman-4.0.18 → patchman-4.0.19}/repos/forms.py +0 -0
  259. {patchman-4.0.18 → patchman-4.0.19}/repos/managers.py +0 -0
  260. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0001_initial.py +0 -0
  261. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0002_alter_repository_repotype.py +0 -0
  262. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0003_migrate_to_tz_aware.py +0 -0
  263. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0004_rename_file_checksum_mirror_package_checksum.py +0 -0
  264. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0005_rename_package_checksum_mirror_packages_checksum.py +0 -0
  265. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0006_mirror_errata_checksum_mirror_modules_checksum.py +0 -0
  266. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0007_alter_mirror_options_alter_mirrorpackage_options_and_more.py +0 -0
  267. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0008_mirror_packages_count.py +0 -0
  268. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/0009_backfill_mirror_counts.py +0 -0
  269. {patchman-4.0.18 → patchman-4.0.19}/repos/migrations/__init__.py +0 -0
  270. {patchman-4.0.18 → patchman-4.0.19}/repos/models.py +0 -0
  271. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/__init__.py +0 -0
  272. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/arch.py +0 -0
  273. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/deb.py +0 -0
  274. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/gentoo.py +0 -0
  275. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/rpm.py +0 -0
  276. {patchman-4.0.18 → patchman-4.0.19}/repos/repo_types/yast.py +0 -0
  277. {patchman-4.0.18 → patchman-4.0.19}/repos/serializers.py +0 -0
  278. {patchman-4.0.18 → patchman-4.0.19}/repos/signals.py +0 -0
  279. {patchman-4.0.18 → patchman-4.0.19}/repos/tables.py +0 -0
  280. {patchman-4.0.18 → patchman-4.0.19}/repos/tasks.py +0 -0
  281. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/mirror_delete.html +0 -0
  282. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/mirror_detail.html +0 -0
  283. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/mirror_edit.html +0 -0
  284. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/mirror_list.html +0 -0
  285. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/mirror_with_repo_list.html +0 -0
  286. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/repo_delete.html +0 -0
  287. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/repo_detail.html +0 -0
  288. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/repo_edit.html +0 -0
  289. {patchman-4.0.18 → patchman-4.0.19}/repos/templates/repos/repo_list.html +0 -0
  290. {patchman-4.0.18 → patchman-4.0.19}/repos/templatetags/__init__.py +0 -0
  291. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/__init__.py +0 -0
  292. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/test_api.py +0 -0
  293. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/test_managers.py +0 -0
  294. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/test_mirror_sync.py +0 -0
  295. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/test_models.py +0 -0
  296. {patchman-4.0.18 → patchman-4.0.19}/repos/tests/test_views.py +0 -0
  297. {patchman-4.0.18 → patchman-4.0.19}/repos/urls.py +0 -0
  298. {patchman-4.0.18 → patchman-4.0.19}/repos/utils.py +0 -0
  299. {patchman-4.0.18 → patchman-4.0.19}/sbin/patchman-manage +0 -0
  300. {patchman-4.0.18 → patchman-4.0.19}/sbin/patchman-set-secret-key +0 -0
  301. {patchman-4.0.18 → patchman-4.0.19}/scripts/clear-django-logs.py +0 -0
  302. {patchman-4.0.18 → patchman-4.0.19}/scripts/create_graph.sh +0 -0
  303. {patchman-4.0.18 → patchman-4.0.19}/scripts/rpm-install.sh +0 -0
  304. {patchman-4.0.18 → patchman-4.0.19}/scripts/rpm-post-install.sh +0 -0
  305. {patchman-4.0.18 → patchman-4.0.19}/security/__init__.py +0 -0
  306. {patchman-4.0.18 → patchman-4.0.19}/security/admin.py +0 -0
  307. {patchman-4.0.18 → patchman-4.0.19}/security/apps.py +0 -0
  308. {patchman-4.0.18 → patchman-4.0.19}/security/managers.py +0 -0
  309. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0001_initial.py +0 -0
  310. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0002_alter_cve_options.py +0 -0
  311. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0003_alter_cve_description_alter_cwe_description.py +0 -0
  312. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0004_alter_cve_options.py +0 -0
  313. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0005_reference_cve_references.py +0 -0
  314. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0006_alter_cve_options_alter_cvss_unique_together.py +0 -0
  315. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0007_remove_cve_title.py +0 -0
  316. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0008_alter_cwe_options_alter_reference_options.py +0 -0
  317. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0009_alter_cvss_severity_alter_cvss_vector_string_and_more.py +0 -0
  318. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/0010_fix_cvss_vector_string_length.py +0 -0
  319. {patchman-4.0.18 → patchman-4.0.19}/security/migrations/__init__.py +0 -0
  320. {patchman-4.0.18 → patchman-4.0.19}/security/serializers.py +0 -0
  321. {patchman-4.0.18 → patchman-4.0.19}/security/tables.py +0 -0
  322. {patchman-4.0.18 → patchman-4.0.19}/security/tasks.py +0 -0
  323. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/cve_detail.html +0 -0
  324. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/cve_list.html +0 -0
  325. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/cwe_detail.html +0 -0
  326. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/cwe_list.html +0 -0
  327. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/reference_list.html +0 -0
  328. {patchman-4.0.18 → patchman-4.0.19}/security/templates/security/security_landing.html +0 -0
  329. {patchman-4.0.18 → patchman-4.0.19}/security/tests/__init__.py +0 -0
  330. {patchman-4.0.18 → patchman-4.0.19}/security/tests/test_api.py +0 -0
  331. {patchman-4.0.18 → patchman-4.0.19}/security/tests/test_models.py +0 -0
  332. {patchman-4.0.18 → patchman-4.0.19}/security/urls.py +0 -0
  333. {patchman-4.0.18 → patchman-4.0.19}/security/views.py +0 -0
  334. {patchman-4.0.18 → patchman-4.0.19}/setup.cfg +0 -0
  335. {patchman-4.0.18 → patchman-4.0.19}/setup.py +0 -0
  336. {patchman-4.0.18 → patchman-4.0.19}/util/apps.py +0 -0
  337. {patchman-4.0.18 → patchman-4.0.19}/util/context_processors.py +0 -0
  338. {patchman-4.0.18 → patchman-4.0.19}/util/filterspecs.py +0 -0
  339. {patchman-4.0.18 → patchman-4.0.19}/util/management/__init__.py +0 -0
  340. {patchman-4.0.18 → patchman-4.0.19}/util/management/commands/__init__.py +0 -0
  341. {patchman-4.0.18 → patchman-4.0.19}/util/management/commands/create_api_key.py +0 -0
  342. {patchman-4.0.18 → patchman-4.0.19}/util/management/commands/list_api_keys.py +0 -0
  343. {patchman-4.0.18 → patchman-4.0.19}/util/management/commands/revoke_api_key.py +0 -0
  344. {patchman-4.0.18 → patchman-4.0.19}/util/tables.py +0 -0
  345. {patchman-4.0.18 → patchman-4.0.19}/util/tasks.py +0 -0
  346. {patchman-4.0.18 → patchman-4.0.19}/util/templates/404.html +0 -0
  347. {patchman-4.0.18 → patchman-4.0.19}/util/templates/500.html +0 -0
  348. {patchman-4.0.18 → patchman-4.0.19}/util/templates/base.html +0 -0
  349. {patchman-4.0.18 → patchman-4.0.19}/util/templates/bulk_actions.html +0 -0
  350. {patchman-4.0.18 → patchman-4.0.19}/util/templates/dashboard.html +0 -0
  351. {patchman-4.0.18 → patchman-4.0.19}/util/templates/objectlist.html +0 -0
  352. {patchman-4.0.18 → patchman-4.0.19}/util/templates/registration/login.html +0 -0
  353. {patchman-4.0.18 → patchman-4.0.19}/util/templates/searchbar.html +0 -0
  354. {patchman-4.0.18 → patchman-4.0.19}/util/templates/table.html +0 -0
  355. {patchman-4.0.18 → patchman-4.0.19}/util/templatetags/__init__.py +0 -0
  356. {patchman-4.0.18 → patchman-4.0.19}/util/templatetags/common.py +0 -0
  357. {patchman-4.0.18 → patchman-4.0.19}/util/tests/__init__.py +0 -0
  358. {patchman-4.0.18 → patchman-4.0.19}/util/tests/test_commands.py +0 -0
  359. {patchman-4.0.18 → patchman-4.0.19}/util/tests/test_utils.py +0 -0
  360. {patchman-4.0.18 → patchman-4.0.19}/util/urls.py +0 -0
  361. {patchman-4.0.18 → patchman-4.0.19}/util/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchman
3
- Version: 4.0.18
3
+ Version: 4.0.19
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
@@ -15,14 +15,14 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: COPYING
17
17
  License-File: AUTHORS
18
- Requires-Dist: Django==4.2.29
18
+ Requires-Dist: Django==4.2.30
19
19
  Requires-Dist: django-taggit==4.0.0
20
20
  Requires-Dist: django-extensions==3.2.3
21
21
  Requires-Dist: django-bootstrap3==23.1
22
22
  Requires-Dist: python-debian==1.0.1
23
23
  Requires-Dist: defusedxml==0.7.1
24
24
  Requires-Dist: PyYAML==6.0.2
25
- Requires-Dist: requests==2.32.4
25
+ Requires-Dist: requests==2.33.0
26
26
  Requires-Dist: colorama==0.4.6
27
27
  Requires-Dist: djangorestframework==3.15.2
28
28
  Requires-Dist: djangorestframework-api-key==3.0.0
@@ -30,7 +30,7 @@ Requires-Dist: django-filter==25.1
30
30
  Requires-Dist: humanize==4.12.1
31
31
  Requires-Dist: version-utils==0.3.2
32
32
  Requires-Dist: python-magic==0.4.27
33
- Requires-Dist: gitpython==3.1.44
33
+ Requires-Dist: gitpython==3.1.47
34
34
  Requires-Dist: tenacity==8.2.3
35
35
  Requires-Dist: celery==5.4.0
36
36
  Requires-Dist: redis==6.4.0
@@ -0,0 +1 @@
1
+ 4.0.19
@@ -21,7 +21,7 @@ from django.urls import reverse
21
21
 
22
22
  from errata.managers import ErratumManager
23
23
  from packages.models import Package, PackageUpdate
24
- from packages.utils import find_evr, get_matching_packages
24
+ from packages.utils import find_evr, get_matching_packages_q
25
25
  from security.models import CVE, Reference
26
26
  from security.utils import get_or_create_cve, get_or_create_reference
27
27
  from util import get_url
@@ -64,55 +64,58 @@ class Erratum(models.Model):
64
64
 
65
65
  def scan_for_security_updates(self):
66
66
  if self.e_type == 'security':
67
- for package in self.fixed_packages.all():
68
- affected_updates = PackageUpdate.objects.filter(
69
- newpackage=package,
70
- security=False,
67
+ fixed_pks = list(self.fixed_packages.values_list('pk', flat=True))
68
+ if fixed_pks:
69
+ self._mark_updates_security(
70
+ PackageUpdate.objects.filter(newpackage__in=fixed_pks, security=False)
71
71
  )
72
- for affected_update in affected_updates:
73
- affected_update.security = True
74
- try:
75
- affected_update.save()
76
- except IntegrityError as e:
77
- error_message(text=e)
78
- # a version of this update already exists that is
79
- # marked as a security update, so delete this one
80
- affected_update.delete()
81
- for package in self.affected_packages.all():
82
- affected_updates = PackageUpdate.objects.filter(
83
- oldpackage=package,
84
- security=False,
72
+ affected_pks = list(self.affected_packages.values_list('pk', flat=True))
73
+ if affected_pks:
74
+ self._mark_updates_security(
75
+ PackageUpdate.objects.filter(oldpackage__in=affected_pks, security=False)
85
76
  )
86
- for affected_update in affected_updates:
87
- affected_update.security = True
88
- try:
89
- affected_update.save()
90
- except IntegrityError as e:
91
- error_message(text=e)
92
- # a version of this update already exists that is
93
- # marked as a security update, so delete this one
94
- affected_update.delete()
95
-
96
- def fetch_osv_dev_data(self):
77
+
78
+ def _mark_updates_security(self, updates):
79
+ """ Mark a queryset of PackageUpdates as security updates.
80
+ Handles IntegrityError by deleting duplicates.
81
+ """
82
+ try:
83
+ updates.update(security=True)
84
+ except IntegrityError:
85
+ # fall back to individual saves to handle duplicates
86
+ for update in updates:
87
+ update.security = True
88
+ try:
89
+ update.save()
90
+ except IntegrityError as e:
91
+ error_message(text=e)
92
+ update.delete()
93
+
94
+ def fetch_osv_dev_data(self, session=None):
95
+ """ Fetch osv.dev JSON for this erratum. Returns parsed JSON or None.
96
+ """
97
97
  osv_dev_url = f'https://api.osv.dev/v1/vulns/{self.name}'
98
- res = get_url(osv_dev_url)
98
+ res = get_url(osv_dev_url, session=session)
99
+ if res is None:
100
+ return None
99
101
  if res.status_code == 404:
100
- error_message(text=f'404 - Skipping {self.name} - {osv_dev_url}')
101
- return
102
- data = res.content
103
- osv_dev_json = json.loads(data)
104
- self.parse_osv_dev_data(osv_dev_json)
102
+ return None
103
+ return json.loads(res.content)
105
104
 
106
105
  def parse_osv_dev_data(self, osv_dev_json):
106
+ from django.db.models import Q
107
107
  name = osv_dev_json.get('id')
108
108
  if name != self.name:
109
109
  error_message(text=f'Erratum name mismatch - {self.name} != {name}')
110
110
  return
111
111
  related = osv_dev_json.get('related')
112
112
  if related:
113
+ cves = []
113
114
  for vuln in related:
114
115
  if vuln.startswith('CVE'):
115
- self.add_cve(vuln)
116
+ cves.append(vuln)
117
+ for cve_id in cves:
118
+ self.add_cve(cve_id)
116
119
  affected = osv_dev_json.get('affected')
117
120
  if not affected:
118
121
  return
@@ -129,30 +132,29 @@ class Erratum(models.Model):
129
132
  for match in matching_packages:
130
133
  fixed_packages.add(match)
131
134
  affected_versions = package.get('versions')
132
- if not affected_versions:
135
+ if not affected_versions or not fixed_packages:
133
136
  continue
134
- for package in fixed_packages:
137
+ for fp in fixed_packages:
138
+ q = Q()
135
139
  for version in affected_versions:
136
140
  epoch, ver, rel = find_evr(version)
137
- matching_packages = get_matching_packages(
138
- name=package.name,
139
- epoch=epoch,
140
- version=ver,
141
- release=rel,
142
- arch=package.arch,
143
- p_type=package.packagetype,
144
- )
145
- for match in matching_packages:
146
- affected_packages.add(match)
141
+ q |= Q(epoch=epoch, version=ver, release=rel)
142
+ matching_packages = get_matching_packages_q(
143
+ name=fp.name,
144
+ q=q,
145
+ arch=fp.arch,
146
+ p_type=fp.packagetype,
147
+ )
148
+ affected_packages.update(matching_packages)
147
149
  self.add_affected_packages(affected_packages)
148
150
 
149
151
  def add_fixed_packages(self, packages):
150
- for package in packages:
151
- self.fixed_packages.add(package)
152
+ if packages:
153
+ self.fixed_packages.add(*packages)
152
154
 
153
155
  def add_affected_packages(self, packages):
154
- for package in packages:
155
- self.affected_packages.add(package)
156
+ if packages:
157
+ self.affected_packages.add(*packages)
156
158
 
157
159
  def add_cve(self, cve_id):
158
160
  """ Add a CVE to an Erratum object
@@ -14,19 +14,21 @@
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
- import concurrent.futures
18
17
  import json
19
18
 
20
- from django.db import connections
21
-
22
- from operatingsystems.utils import get_or_create_osrelease
19
+ from errata.utils import get_or_create_erratum
20
+ from modules.utils import get_matching_modules
21
+ from operatingsystems.utils import (
22
+ get_or_create_osrelease, normalize_el_osrelease,
23
+ )
23
24
  from packages.models import Package
24
25
  from packages.utils import get_or_create_package, parse_package_string
25
26
  from patchman.signals import pbar_start, pbar_update
26
- from util import fetch_content, get_setting_of_type, get_url
27
+ from util import fetch_content, get_setting_of_type, get_url, run_concurrently
28
+ from util.logging import clear_forked_pbar
27
29
 
28
30
 
29
- def update_alma_errata(concurrent_processing=True):
31
+ def update_alma_errata(concurrent_processing=True, max_workers=25):
30
32
  """ Update Alma Linux advisories from errata.almalinux.org:
31
33
  https://errata.almalinux.org/8/errata.full.json
32
34
  https://errata.almalinux.org/9/errata.full.json
@@ -40,7 +42,7 @@ def update_alma_errata(concurrent_processing=True):
40
42
  )
41
43
  for release in alma_releases:
42
44
  advisories = fetch_alma_advisories(release)
43
- process_alma_errata(release, advisories, concurrent_processing)
45
+ process_alma_errata(release, advisories, concurrent_processing, max_workers)
44
46
 
45
47
 
46
48
  def fetch_alma_advisories(release):
@@ -54,11 +56,11 @@ def fetch_alma_advisories(release):
54
56
  return advisories
55
57
 
56
58
 
57
- def process_alma_errata(release, advisories, concurrent_processing):
59
+ def process_alma_errata(release, advisories, concurrent_processing, max_workers=25):
58
60
  """ Process Alma Linux Errata
59
61
  """
60
62
  if concurrent_processing:
61
- process_alma_errata_concurrently(release, advisories)
63
+ process_alma_errata_concurrently(release, advisories, max_workers)
62
64
  else:
63
65
  process_alma_errata_serially(release, advisories)
64
66
 
@@ -73,24 +75,24 @@ def process_alma_errata_serially(release, advisories):
73
75
  pbar_update.send(sender=None, index=i + 1)
74
76
 
75
77
 
76
- def process_alma_errata_concurrently(release, advisories):
78
+ def process_alma_errata_concurrently(release, advisories, max_workers=25):
77
79
  """ Process Alma Linux Errata concurrently
78
80
  """
79
- connections.close_all()
80
81
  elen = len(advisories)
81
82
  pbar_start.send(sender=None, ptext=f'Processing {elen} Alma {release} Errata', plen=elen)
82
- i = 0
83
- with concurrent.futures.ProcessPoolExecutor(max_workers=25) as executor:
84
- futures = [executor.submit(process_alma_erratum, release, advisory) for advisory in advisories]
85
- for future in concurrent.futures.as_completed(futures):
86
- i += 1
87
- pbar_update.send(sender=None, index=i + 1)
83
+ args = [(release, advisory) for advisory in advisories]
84
+ for i, _ in enumerate(run_concurrently(process_alma_erratum_wrapper, args, max_workers)):
85
+ pbar_update.send(sender=None, index=i + 1)
86
+
87
+
88
+ def process_alma_erratum_wrapper(args):
89
+ clear_forked_pbar()
90
+ return process_alma_erratum(*args)
88
91
 
89
92
 
90
93
  def process_alma_erratum(release, advisory):
91
94
  """ Process a single Alma Linux Erratum
92
95
  """
93
- from errata.utils import get_or_create_erratum
94
96
  erratum_name = advisory.get('id')
95
97
  issue_date = advisory.get('issued_date')
96
98
  synopsis = advisory.get('title')
@@ -110,7 +112,6 @@ def process_alma_erratum(release, advisory):
110
112
  def add_alma_erratum_osreleases(e, release):
111
113
  """ Update OS Release for Alma Linux errata
112
114
  """
113
- from operatingsystems.utils import normalize_el_osrelease
114
115
  osrelease_name = normalize_el_osrelease(f'Alma Linux {release}')
115
116
  osrelease = get_or_create_osrelease(name=osrelease_name)
116
117
  e.osreleases.add(osrelease)
@@ -150,7 +151,6 @@ def add_alma_erratum_packages(e, advisory):
150
151
  def add_alma_erratum_modules(e, advisory):
151
152
  """ Parse and add modules for Alma Linux errata
152
153
  """
153
- from modules.utils import get_matching_modules
154
154
  fixed_packages = set()
155
155
  modules = advisory.get('modules')
156
156
  for module in modules:
@@ -160,8 +160,7 @@ def add_alma_erratum_modules(e, advisory):
160
160
  stream = module.get('stream')
161
161
  version = module.get('version')
162
162
  matching_modules = get_matching_modules(name, stream, version, context, arch)
163
- for match in matching_modules:
163
+ for match in matching_modules.prefetch_related('packages'):
164
164
  for fixed_package in match.packages.all():
165
- match.packages.add(fixed_package)
166
165
  fixed_packages.add(fixed_package)
167
166
  e.add_fixed_packages(fixed_packages)
@@ -17,8 +17,7 @@
17
17
  import concurrent.futures
18
18
  import json
19
19
 
20
- from django.db import connections
21
-
20
+ from errata.utils import get_or_create_erratum
22
21
  from operatingsystems.utils import get_or_create_osrelease
23
22
  from packages.models import Package
24
23
  from packages.utils import (
@@ -26,16 +25,17 @@ from packages.utils import (
26
25
  )
27
26
  from patchman.signals import pbar_start, pbar_update
28
27
  from util import fetch_content, get_url
29
- from util.logging import error_message
28
+ from util.logging import clear_forked_pbar, error_message
30
29
 
31
30
 
32
- def update_arch_errata(concurrent_processing=False):
31
+ def update_arch_errata(concurrent_processing=False, max_workers=25):
33
32
  """ Update Arch Linux Errata from the following sources:
34
33
  https://security.archlinux.org/advisories.json
35
34
  """
36
35
  add_arch_linux_osrelease()
37
36
  advisories = fetch_arch_errata()
38
- parse_arch_errata(advisories, concurrent_processing)
37
+ if advisories:
38
+ parse_arch_errata(advisories, concurrent_processing, max_workers)
39
39
 
40
40
 
41
41
  def fetch_arch_errata():
@@ -44,14 +44,16 @@ def fetch_arch_errata():
44
44
  """
45
45
  res = get_url('https://security.archlinux.org/advisories.json')
46
46
  advisories = fetch_content(res, 'Fetching Arch Advisories')
47
+ if advisories is None:
48
+ return None
47
49
  return json.loads(advisories)
48
50
 
49
51
 
50
- def parse_arch_errata(advisories, concurrent_processing):
52
+ def parse_arch_errata(advisories, concurrent_processing, max_workers=25):
51
53
  """ Parse Arch Linux Errata Advisories
52
54
  """
53
55
  if concurrent_processing:
54
- parse_arch_errata_concurrently(advisories)
56
+ parse_arch_errata_concurrently(advisories, max_workers)
55
57
  else:
56
58
  parse_arch_errata_serially(advisories)
57
59
 
@@ -67,15 +69,14 @@ def parse_arch_errata_serially(advisories):
67
69
  pbar_update.send(sender=None, index=i + 1)
68
70
 
69
71
 
70
- def parse_arch_errata_concurrently(advisories):
72
+ def parse_arch_errata_concurrently(advisories, max_workers=25):
71
73
  """ Parse Arch Linux Errata Advisories concurrently
72
74
  """
73
75
  osrelease = get_or_create_osrelease(name='Arch Linux')
74
- connections.close_all()
75
76
  elen = len(advisories)
76
77
  pbar_start.send(sender=None, ptext=f'Processing {elen} Arch Advisories', plen=elen)
77
78
  i = 0
78
- with concurrent.futures.ProcessPoolExecutor(max_workers=25) as executor:
79
+ with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
79
80
  futures = [executor.submit(process_arch_erratum, advisory, osrelease) for advisory in advisories]
80
81
  for future in concurrent.futures.as_completed(futures):
81
82
  i += 1
@@ -85,7 +86,7 @@ def parse_arch_errata_concurrently(advisories):
85
86
  def process_arch_erratum(advisory, osrelease):
86
87
  """ Process a single Arch Linux Erratum
87
88
  """
88
- from errata.utils import get_or_create_erratum
89
+ clear_forked_pbar()
89
90
  try:
90
91
  name = advisory.get('name')
91
92
  issue_date = advisory.get('date')
@@ -121,6 +122,8 @@ def add_arch_erratum_references(e, advisory):
121
122
  e.add_reference('ASA', url)
122
123
  raw_url = f'{url}/raw'
123
124
  res = get_url(raw_url)
125
+ if res is None:
126
+ return
124
127
  data = res.content
125
128
  parse_arch_erratum_raw(e, data.decode())
126
129
 
@@ -152,6 +155,8 @@ def add_arch_erratum_packages(e, advisory):
152
155
  group_id = advisory.get('group')
153
156
  group_url = f'https://security.archlinux.org/group/{group_id}.json'
154
157
  res = get_url(group_url)
158
+ if res is None:
159
+ return
155
160
  data = res.content
156
161
  group = json.loads(data)
157
162
  packages = group.get('packages')
@@ -14,27 +14,29 @@
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
- import concurrent.futures
18
17
  import csv
19
18
  import re
20
19
  from datetime import datetime
21
20
  from io import StringIO
22
21
 
23
22
  from debian.deb822 import Dsc
24
- from django.db import connections
25
23
 
24
+ from errata.utils import get_or_create_erratum
26
25
  from operatingsystems.models import OSRelease
27
26
  from operatingsystems.utils import get_or_create_osrelease
28
27
  from packages.models import Package
29
28
  from packages.utils import find_evr, get_or_create_package
30
29
  from patchman.signals import pbar_start, pbar_update
31
- from util import extract, fetch_content, get_setting_of_type, get_url
32
- from util.logging import error_message, warning_message
30
+ from util import (
31
+ extract, fetch_concurrently, fetch_content, get_setting_of_type, get_url,
32
+ run_concurrently,
33
+ )
34
+ from util.logging import clear_forked_pbar, error_message, warning_message
33
35
 
34
36
  DSCs = {}
35
37
 
36
38
 
37
- def update_debian_errata(concurrent_processing=True):
39
+ def update_debian_errata(concurrent_processing=True, max_workers=25):
38
40
  """ Update Debian errata using:
39
41
  https://salsa.debian.org/security-tracker-team/security-tracker/raw/master/data/DSA/list
40
42
  https://salsa.debian.org/security-tracker-team/security-tracker/raw/master/data/DSA/list
@@ -46,8 +48,8 @@ def update_debian_errata(concurrent_processing=True):
46
48
  advisories = dsas + dlas
47
49
  fetch_dscs_from_debian_package_file_maps()
48
50
  accepted_codenames = get_accepted_debian_codenames()
49
- errata = parse_debian_errata(advisories, accepted_codenames)
50
- create_debian_errata(errata, accepted_codenames, concurrent_processing)
51
+ errata = parse_debian_errata(advisories, accepted_codenames, concurrent_processing, max_workers)
52
+ create_debian_errata(errata, accepted_codenames, concurrent_processing, max_workers)
51
53
 
52
54
 
53
55
  def fetch_debian_dsa_advisories():
@@ -108,12 +110,14 @@ def parse_debian_package_file_map(data, repo):
108
110
  parsing_dsc = False
109
111
 
110
112
 
111
- def parse_debian_errata(advisories, accepted_codenames):
113
+ def parse_debian_errata(advisories, accepted_codenames, concurrent_processing=True, max_workers=25):
112
114
  """ Parse Debian DSA/DLA files for security advisories
113
115
  """
114
116
  distro_pattern = re.compile(r'^\t\[(.+?)\] - .*')
115
117
  title_pattern = re.compile(r'^\[(.+?)\] (.+?) (.+?)[ ]+[-]+ (.*)')
118
+ distro_package_pattern = re.compile(r'^\t\[(.+?)\] - (.+?) (.*)')
116
119
  errata = []
120
+ dsc_fetches = []
117
121
  e = {'packages': {}, 'cve_ids': [], 'releases': []}
118
122
  for line in advisories.splitlines():
119
123
  if line.startswith('['):
@@ -132,9 +136,17 @@ def parse_debian_errata(advisories, accepted_codenames):
132
136
  e['releases'].append(release)
133
137
  if not e.get('packages').get(release):
134
138
  e['packages'][release] = []
135
- e['packages'][release].append(parse_debian_erratum_package(line, accepted_codenames))
139
+ pkg_match = re.match(distro_package_pattern, line)
140
+ if pkg_match and pkg_match.group(1) in accepted_codenames:
141
+ source_package = pkg_match.group(2)
142
+ source_version = pkg_match.group(3)
143
+ dsc_fetches.append((source_package, source_version))
144
+ e['packages'][release].append((source_package, source_version))
145
+ else:
146
+ e['packages'][release].append(None)
136
147
  # add the last one
137
148
  errata = add_errata_by_codename(errata, e, accepted_codenames)
149
+ fetch_debian_dsc_package_lists(dsc_fetches, concurrent_processing, max_workers)
138
150
  return errata
139
151
 
140
152
 
@@ -162,11 +174,11 @@ def parse_debian_erratum_advisory(e, match):
162
174
  return e
163
175
 
164
176
 
165
- def create_debian_errata(errata, accepted_codenames, concurrent_processing):
177
+ def create_debian_errata(errata, accepted_codenames, concurrent_processing, max_workers=25):
166
178
  """ Create Debian Errata
167
179
  """
168
180
  if concurrent_processing:
169
- create_debian_errata_concurrently(errata, accepted_codenames)
181
+ create_debian_errata_concurrently(errata, accepted_codenames, max_workers)
170
182
  else:
171
183
  create_debian_errata_serially(errata, accepted_codenames)
172
184
 
@@ -181,25 +193,25 @@ def create_debian_errata_serially(errata, accepted_codenames):
181
193
  pbar_update.send(sender=None, index=i + 1)
182
194
 
183
195
 
184
- def create_debian_errata_concurrently(errata, accepted_codenames):
196
+ def create_debian_errata_concurrently(errata, accepted_codenames, max_workers=25):
185
197
  """ Create Debian Errata concurrently
186
198
  """
187
- connections.close_all()
188
199
  elen = len(errata)
189
200
  pbar_start.send(sender=None, ptext=f'Processing {elen} Debian Errata', plen=elen)
190
- i = 0
191
- with concurrent.futures.ProcessPoolExecutor(max_workers=25) as executor:
192
- futures = [executor.submit(process_debian_erratum, erratum, accepted_codenames) for erratum in errata]
193
- for future in concurrent.futures.as_completed(futures):
194
- i += 1
195
- pbar_update.send(sender=None, index=i + 1)
201
+ args = [(erratum, accepted_codenames) for erratum in errata]
202
+ for i, _ in enumerate(run_concurrently(process_debian_erratum_wrapper, args, max_workers)):
203
+ pbar_update.send(sender=None, index=i + 1)
204
+
205
+
206
+ def process_debian_erratum_wrapper(args):
207
+ clear_forked_pbar()
208
+ return process_debian_erratum(*args)
196
209
 
197
210
 
198
211
  def process_debian_erratum(erratum, accepted_codenames):
199
212
  """ Process a single Debian Erratum
200
213
  """
201
214
  try:
202
- from errata.utils import get_or_create_erratum
203
215
  erratum_name = erratum.get('name')
204
216
  e, created = get_or_create_erratum(
205
217
  name=erratum_name,
@@ -221,19 +233,23 @@ def process_debian_erratum(erratum, accepted_codenames):
221
233
  error_message(text=exc)
222
234
 
223
235
 
224
- def parse_debian_erratum_package(line, accepted_codenames):
225
- """ Parse the codename and source package from a DSA/DLA file
226
- Returns the source package and source version
236
+ def fetch_debian_dsc_package_lists(dsc_fetches, concurrent_processing=True, max_workers=25):
237
+ """ Fetch DSC package lists with a progress bar
227
238
  """
228
- distro_package_pattern = re.compile(r'^\t\[(.+?)\] - (.+?) (.*)')
229
- match = re.match(distro_package_pattern, line)
230
- if match:
231
- codename = match.group(1)
232
- if codename in accepted_codenames:
233
- source_package = match.group(2)
234
- source_version = match.group(3)
235
- fetch_debian_dsc_package_list(source_package, source_version)
236
- return source_package, source_version
239
+ flen = len(dsc_fetches)
240
+ pbar_start.send(sender=None, ptext=f'Fetching {flen} Debian DSC files', plen=flen)
241
+ if concurrent_processing:
242
+ for i, _ in enumerate(fetch_concurrently(fetch_dsc_worker, dsc_fetches, max_workers)):
243
+ pbar_update.send(sender=None, index=i + 1)
244
+ else:
245
+ for i, (package, version) in enumerate(dsc_fetches):
246
+ fetch_debian_dsc_package_list(package, version)
247
+ pbar_update.send(sender=None, index=i + 1)
248
+
249
+
250
+ def fetch_dsc_worker(item, session):
251
+ package, version = item
252
+ fetch_debian_dsc_package_list(package, version, session=session)
237
253
 
238
254
 
239
255
  def get_debian_dsc_package_list(package, version):
@@ -246,14 +262,14 @@ def get_debian_dsc_package_list(package, version):
246
262
  return package_list
247
263
 
248
264
 
249
- def fetch_debian_dsc_package_list(package, version):
265
+ def fetch_debian_dsc_package_list(package, version, session=None):
250
266
  """ Fetch the package list from a DSC file for a given source package/version
251
267
  """
252
268
  if not DSCs.get(package) or not DSCs[package].get(version):
253
269
  warning_message(text=f'No DSC found for {package} {version}')
254
270
  return
255
271
  source_url = DSCs[package][version]['url']
256
- res = get_url(source_url)
272
+ res = get_url(source_url, session=session)
257
273
  data = res.content
258
274
  dsc = Dsc(data.decode())
259
275
  package_list = dsc.get('package-list')
@@ -301,6 +317,8 @@ def create_debian_os_releases(codename_to_version):
301
317
  def process_debian_erratum_fixed_packages(e, package_data):
302
318
  """ Process packages fixed in a Debian errata
303
319
  """
320
+ if not package_data:
321
+ return
304
322
  source_package, source_version = package_data
305
323
  epoch, ver, rel = find_evr(source_version)
306
324
  package_list = get_debian_dsc_package_list(source_package, source_version)