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

Introduce a limit of collected items #2051

Merged
merged 8 commits into from
Dec 5, 2023

Commits on Nov 13, 2023

  1. Refactor: Extract function

    This commit extracts the code that marks the item produced by
    probe as incomplete to a static function _mark_collected_object_as_incomplete
    so that it can be reused in other code later
    jan-cerny committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    d1045b2 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. Introduce a limit for collected objects

    If a single OVAL object matches more than 10000 items, we will
    stop collecting these items and mark the object as incomplete.
    This should prevent some situations in which the produced results
    are too large and cause memory problems or inability to generate
    the HTML report.
    jan-cerny committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    b20fca6 View commit details
    Browse the repository at this point in the history
  2. Test collected items limit

    This commit adds a simple test that covers a situation when
    the probe collects more items than the limit for a single OVAL object.
    jan-cerny committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    5e3d8bc View commit details
    Browse the repository at this point in the history
  3. Handle return value of probe_item_collect

    The `probe_item_collect` function can fail and it can return various
    return codes. But, the return codes aren't handled in the caller
    function `process_file`. That means the `process_file` continues to
    process items even if no other items can be collected due to memory
    constraints or other problems. With this commit, we will read the return
    code of `probe_item_collect` and react accordingly.
    jan-cerny committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    176f1a8 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Make probe items limit configurable

    Users can limit the amount of items collected by setting the
    `OSCAP_PROBE_MAX_COLLECTED_ITEMS` environment variable.
    By default, the amount of items is unlimited.
    jan-cerny committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    f2461c7 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2023

  1. Configuration menu
    Copy the full SHA
    fb97a51 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Remove empty line

    jan-cerny committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    dd1977c View commit details
    Browse the repository at this point in the history
  2. Rename "memory" directory to "probe_behavior"

    The behavior alteration we are testing here is not exactly connected to
    memory. I'd rather name it like probe_behavior to make the folder a
    collection of tests related to these env. vars.
    jan-cerny committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6b29c04 View commit details
    Browse the repository at this point in the history