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

fix: store constraint status audit results in sorted order #3293

Merged
merged 7 commits into from
Mar 20, 2024

Commits on Feb 29, 2024

  1. Store constraint status audit results in sorted order.

    1. Implement LimitQueue, a max Priority Queue on StatusViolations which only hold items up to a certain limit L. Because the size is bounded by a constant limit, LimitQueue operations provide O(1) time complexity guarantees for all operations. The data structure only uses constant space so will not affect the audit manager's RAM usage.
    2. Unit test LimitQueue and SVQueue classes to verify functionality.
    3. Use LimitQueue as the value in the updateLists map instead of []updateListEntry so we can store audit results in sorted order up to constraintViolationsLimit.
    4. Remove the intermediate type updateListEntry in favor of saving the StatusViolation directly. The only difference between the two is that updateListEntry used util.EnforcementAction while StatusViolation uses string. Update logViolation to log a string enforcement action. Keep the same logic to track totalViolationsPerEnforcementAction.
    5. Move some variable definitions closer to where they will be used, for example details, labels, uid, and rv.
    
    Signed-off-by: Prachi Pendse <prachirp@google.com>
    prachirp committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    d3d959f View commit details
    Browse the repository at this point in the history
  2. Address review comments on change to store constraint status audit re…

    …sults in sorted order
    
    Signed-off-by: Prachi Pendse <prachirp@google.com>
    prachirp committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    9b576e1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    985f65b View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Configuration menu
    Copy the full SHA
    6622e32 View commit details
    Browse the repository at this point in the history
  2. Address review comment about invoking Pop on an empty heap.

    Signed-off-by: Prachi Pendse <prachirp@google.com>
    prachirp committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    0093c06 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ae51b88 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

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