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

fixes in file_groupownership template #10666

Merged

Commits on Jun 14, 2023

  1. update template documentation

    change parameter filegid of file_groupownership template to gid_or_name
    explain its behavior
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    f405e19 View commit details
    Browse the repository at this point in the history
  2. modify rule.yaml files to change the parameter name of file_groupowne…

    …rship template from filegid to gid_or_name
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    2616c29 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2ce03f5 View commit details
    Browse the repository at this point in the history
  4. modify remediations for file_groupownership template

    change the parameter name from filgeid to gid_or_name
    additionally, use the -group parameter instead of -gid parameter in find command invocation
    the -group parameter accepts both gid and group names, where the -gid parameter accepts only gid
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    53eac6f View commit details
    Browse the repository at this point in the history
  5. modify the preprocessing function of file_groupownership template

    establish a new variable which carries information if the parameter is a gid or a group name
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    d4ea27a View commit details
    Browse the repository at this point in the history
  6. modify the oval for file_groupownership template

    decide if to use group ID or group name based on the variable declared in the preprocessing function
    change parameter name from file_gid to gid_or_name
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    a4c870b View commit details
    Browse the repository at this point in the history
  7. extract duplicated function from file_(owner|groupowner|permissions) …

    …templates into shared module
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    e51a832 View commit details
    Browse the repository at this point in the history
  8. fix test scenarios for file_(groupownership|owner|permissions) template

    The test did not account for a case when a filepath is a directory and it does not exist on the system.
    Also the test made use of is_directory parameter which is only available at runtime when building the template and it is not saved anywhere.
    Instead of this parameter, scenarios now check if the path ends with a slash. This signifies the filepath is a directory as mentioned in the tempate documentation.
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    802ceb7 View commit details
    Browse the repository at this point in the history
  9. update missing_file_test test scenarios of file_groupownership and fi…

    …le_owner template
    
    These test scenarios would not work correctly if the filepath parameter was a directory.
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    039d2a3 View commit details
    Browse the repository at this point in the history
  10. add overriding test scenario to file_groupownership_sshd_pub_key rule

    This rule uses directory + regex, it needs a special test scenario because the template does only generic testing.
    vojtapolasek committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    d3dcd79 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2023

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

Commits on Jun 22, 2023

  1. file_groupownership_ssh_private_key: make sure that the group ssh_key…

    …s exists before using it in test scenario
    
    it migt not exist in FEdora container which is used as test environment
    vojtapolasek committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    181ccc5 View commit details
    Browse the repository at this point in the history
  2. file_groupownership_ssh_private_key: exclude templated test scenario

    the missing_file_test test scenario should fail, not pass.
    At the same time, we actually can't create a new failing test scenario - removing the ssh private key will break the testing workflow.
    vojtapolasek committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    7a3e7a1 View commit details
    Browse the repository at this point in the history