Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSOC23 - A - Adapt the CVE auditing functionality to depend on OVAL data #7335

Closed

Commits on Aug 2, 2023

  1. Add basic oval types

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f0224ab View commit details
    Browse the repository at this point in the history
  2. Create OVAL objects, states and tests managers

    - It's an optimization to enable faster lookups of OVAL resources
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    4239ce2 View commit details
    Browse the repository at this point in the history
  3. Create a facade class that offers mock implementations for Uyuni APIs

    - This class is temporary and will be removed when the integration with Uyuni is complete.
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e7a1741 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1cfcf7 View commit details
    Browse the repository at this point in the history
  5. Add OVAL Criteria and Criterion types

    - Also, implemented the composite design pattern to enable the evaluation of the criteria tree
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f102c18 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5c27921 View commit details
    Browse the repository at this point in the history
  7. Implement the OVAL parser

    - This is a temporary implementation based on JAXB API which consumes a lot of memory. I plan to rewrite it with StAX for better performance.
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f34c943 View commit details
    Browse the repository at this point in the history
  8. Test TestEvaluatorTest

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    819aa38 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    619bfd4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c7e7d51 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    04476ab View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ffca7c1 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    2956986 View commit details
    Browse the repository at this point in the history
  14. Fix typo

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    b151d4b View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    8e39a3f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6bff303 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    918eb42 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b036e0d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4d50042 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    dd488c4 View commit details
    Browse the repository at this point in the history
  21. Define OVAL database access methods

    - Without implementation
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    5985980 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    c3d5e68 View commit details
    Browse the repository at this point in the history
  23. Create OVALVulnerablePackage and OVALPlatformVulnerablePackage entiti…

    …es and their corresponding tables
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f8ac354 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    3f9099c View commit details
    Browse the repository at this point in the history
  25. Use filed access strategy when appropriate

    - By default, hibernate will select the access strategy based on the @id annotation. If @id is used on getter, then strategy is PROPERTY and if used on field, then strategy is ACCESS. I override the access strategy and set it to FIELD when getter returns an Optional
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    0b02ef2 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    53f55e8 View commit details
    Browse the repository at this point in the history
  27. Format query

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    5006275 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    c94f5f3 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    d179293 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    8855941 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    da4f1e7 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    a1aebe6 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    3cfd061 View commit details
    Browse the repository at this point in the history
  34. Reference one cve per OVAL definition

    - Right now we're only processing vulnerability definitions which reference one cve per definition, so it's redundant to have a list of cves when it's going to always have one element.
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    6e66ac8 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    41a1c66 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    09f6a67 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    82d170d View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    e0a54c9 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    1809487 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    22b9018 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    08115ed View commit details
    Browse the repository at this point in the history
  42. Add source column to the oval definition table

    - This column represents the source from which we fetched the definition
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    742ba10 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    ce2680e View commit details
    Browse the repository at this point in the history
  44. Update tables.deps

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e3e21c3 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    c5a9c74 View commit details
    Browse the repository at this point in the history
  46. Cleanup

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    1596afe View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    704d862 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    e130606 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    f9e53c2 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    d66211b View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    9894fc7 View commit details
    Browse the repository at this point in the history
  52. Store platform cpe instead of plain name

    - CPE is easier to parse
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e5c0e00 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    dda21a7 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    7be2d5d View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    f6b49d3 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    4a31d77 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    46fd638 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    980cd4d View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    10d11fc View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    32e71b6 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    5b77a69 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    1e4b28f View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    0831a7f View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    87b1aab View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    9e8b470 View commit details
    Browse the repository at this point in the history
  66. Refactor

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    dd6f0f2 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    b5706b0 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    41e81e0 View commit details
    Browse the repository at this point in the history
  69. Go back to fetching all packages

    - It's more efficient in terms of speed. And memory footprint shouldn't be a problem since we're using a lightweight DTO
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f063415 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    9d49313 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    61b6e55 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    ff02aa0 View commit details
    Browse the repository at this point in the history
  73. Move the OVAL algorithm implementation to CVEAuditManagerOVAL

    - The idea here is decouple CVEAuditManager from the rest of the app by replacing all calls to CVEAuditManager to CVEAuditManagerOVAL, and make the CVEAuditManagerOVAL#listSystemsByPatchStatus method fallback to CVEAuditManager#listSystemsByPatchStatus when the system cannot be audited with OVAL (OVAL not synced or not supported by the system's OS). This way, in the future, when all distributions become supported for performing OVAL-based CVE auditing, we can just delete CVEAuditManager and its test class.
    
    - CVEAuditManager contains also methods for managing the CVE channels. For now, we can create the same methods in CVEAuditManagerOVAL and redirect them to their equivalent in CVEAuditManager. But in the future, when we don't need CVEAuditManager anymore, we can move them entirely to CVEAuditManagerOVAL or put them in their own class.
    
    - The upside is that we can keep the tests for CVEAuditManager, which tests the channels-based algorithm, and we make the transition later when we don't need the channels algorithm anymore, easier. The downside is a lot of potential duplication in CVEAuditManagerOVAL tests given that need to maintain both channels and OVAL-based implementations.
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    72fb551 View commit details
    Browse the repository at this point in the history
  74. Decouple CVEAuditManager completely from the rest of the code

    - Now, it's only used by CVEAuditManagerOVAL and CVEAuditManagerTest
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    75b2b92 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    4f6ef2b View commit details
    Browse the repository at this point in the history
  76. Fix null pointer exception

    - I miss Kotlin :(
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    ac96e1a View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    b0ba072 View commit details
    Browse the repository at this point in the history
  78. Avoid clearing session

    - Test fails with exception 'could not initialize proxy - no Session' otherwise
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    5487dd2 View commit details
    Browse the repository at this point in the history
  79. First passing test!

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    f014f9b View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    ad3f82f View commit details
    Browse the repository at this point in the history
  81. Remove custom caching of OVALPlatform objects

    - Since the hashmap used for caching was defined as a static field, it created collision between testcases
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    5535f90 View commit details
    Browse the repository at this point in the history
  82. New test case

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    aab8021 View commit details
    Browse the repository at this point in the history
  83. More test cases

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    eb4600a View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    6d23722 View commit details
    Browse the repository at this point in the history
  85. Remove uninstalled vulnerable packages

    - Because they are irrelevant and their presence could lead to false evaluations
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    3a2be39 View commit details
    Browse the repository at this point in the history
  86. Add comment

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    dd3cbbb View commit details
    Browse the repository at this point in the history
  87. Add test case

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    ce7074c View commit details
    Browse the repository at this point in the history
  88. Fix TestEvaluatorTest

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e223378 View commit details
    Browse the repository at this point in the history
  89. Delete UyuniAPI.java

    - Now we depend on the real APIs
    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e438fb1 View commit details
    Browse the repository at this point in the history
  90. Add 3 more test cases

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    3a32664 View commit details
    Browse the repository at this point in the history
  91. Add a testcase todo

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    0a88aad View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    63c4442 View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    29f6399 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    1a3eb05 View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    78a3efe View commit details
    Browse the repository at this point in the history
  96. Configuration menu
    Copy the full SHA
    ad89456 View commit details
    Browse the repository at this point in the history
  97. Rephrase comment

    HoussemNasri committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    4e015ae View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    e67ba6f View commit details
    Browse the repository at this point in the history
  99. Configuration menu
    Copy the full SHA
    e083e6b View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    4be0d3a View commit details
    Browse the repository at this point in the history