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

Generate rule references from control files #11540

Merged
merged 16 commits into from
Feb 6, 2024

Commits on Feb 5, 2024

  1. Represent references as lists internally

    The reference values are stored in rule.yml files as strings
    that are comma-separated lists of identifiers. We won't change
    the rule.yml files stored in git because that would be a massive
    change, but we will change the way how the references are stored
    internally in build system and also in the resolved files.
    This should simplify the code but won't have impact on built
    SCAP data streams.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    1f88d87 View commit details
    Browse the repository at this point in the history
  2. Extend control file schema to support references

    With this change we will be able to use controls IDs as reference
    keys, which will allow us to add references to rules based
    on control files.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    7ca47cf View commit details
    Browse the repository at this point in the history
  3. Add references from control files to rules

    Starting from this change the references can be added to rules
    automatically based on control files control IDs.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    68c1558 View commit details
    Browse the repository at this point in the history
  4. Add a one-off script to remove references

    Remove references from rule.ymls
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    c352b30 View commit details
    Browse the repository at this point in the history
  5. Use references from control files

    For RHEL CIS profiles we will used the control files
    as the source of reference data.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    eafa5ef View commit details
    Browse the repository at this point in the history
  6. Remove refcheck test for CIS profiles

    The CIS references will now be set automatically based on data
    in control files. They will not be assigned manually to rule.ymls,
    therefore they won't be present in rule.ymls, therefore we
    shouldn't test if they're present there.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    8d3ee55 View commit details
    Browse the repository at this point in the history
  7. Add a unit test

    This commit adds a simple unit test for the feature of compiling
    rule references by adding references based on control file.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    f819d4e View commit details
    Browse the repository at this point in the history
  8. Remove CIS references from rules

    Remove CIS RHEL 7, RHEL 8, RHEL 9 references from rules
    because they are added automatically based on control
    files.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    25e4d24 View commit details
    Browse the repository at this point in the history
  9. Fix PEP 8 problems

    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    2447bf0 View commit details
    Browse the repository at this point in the history
  10. Solve Code Climate problem

    Reduce code complexity by extracting a code to a method.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    35ebe04 View commit details
    Browse the repository at this point in the history
  11. Solve Code Climate problem

    Reduce code complexity by extracting a code to a new function.
    jan-cerny committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    8b83c70 View commit details
    Browse the repository at this point in the history
  12. Solve Code Climate problem

    jan-cerny committed Feb 5, 2024
    Configuration menu