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

Small changes in bash and ansible fixes of the rule aide_build_database #11158

Merged

Conversation

rumch-se
Copy link
Contributor

Description:

  • _Fixes in bash/ansible remediation of the rule aide_build_database _

Rationale:

  • These changes are necessary, because the current code does not consider the specifies of the SLE 12/15 OS

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Sep 29, 2023
@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

Hi @rumch-se. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Comment on lines 18 to 20
- name: "{{{ rule_title }}} - Ensure Repositories Are Updated"
ansible.builtin.command: {{{ packager_refresh_cmd }}}
ignore_errors: True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this solution. On systems other than SLE this will generate a task "Ensure repositories are updated" that contains an "echo" command. The people that will see this code will be confused. Instead, I would prefer to wrap this entire block into an {{% if 'sle' in product %}} Jinja block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @jan-cerny

I was also thinking to as you, but ...I had an error in our test environment and the main reason of the error was that fact that repositories i.e. the sources of installation packages was not updated. After the update/refresh everything was fine. Because I am not familiar with rhel*/ubuntu - do you think that similar action will be necessary for them. For example I think that rpm --justdb works in the similar manner ( https://jfearn.fedorapeople.org/en-US/RPM/4/html/RPM_Guide/ch-command-reference.html).

Do you believe that the rules which require installation of a package always will install the package without any problem. I am not covering the case when for some reason you don't have access to the internet, but when the execution of another rules breaks your system. For example after the execution of an ansible remediation on SUSE OS - of the following rules: rpm_verify_hashes and rpm_verify_permissions - the DNS on my test machine was broken, and after for me was not possible to install nothing when the rule requires that. These rules are created for good reason to guarantee the consistence of the OS, but at the same time, they can break some of existing configurations (because for them these configurations are not correct) and to put your OS in not working state.

Have a nice day
Rumen

@rumch-se
Copy link
Contributor Author

rumch-se commented Oct 2, 2023

Hello @jan-cerny
I have created a new commit based on your comment.
Have a nice day
Rumen

@codeclimate
Copy link

codeclimate bot commented Oct 2, 2023

Code Climate has analyzed commit d243b00 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 56.9%.

View more on Code Climate.

@vojtapolasek vojtapolasek self-assigned this Oct 4, 2023
Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the changes and mainly for using the jinja variable.

@vojtapolasek
Copy link
Collaborator

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Oct 5, 2023
@vojtapolasek vojtapolasek added Ansible Ansible remediation update. SLES SUSE Linux Enterprise Server product related. labels Oct 5, 2023
@vojtapolasek vojtapolasek added this to the 0.1.71 milestone Oct 5, 2023
@vojtapolasek
Copy link
Collaborator

The failing test is not caused by this PR. See #11179
Merging.

@vojtapolasek vojtapolasek merged commit ef31b4a into ComplianceAsCode:master Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. ok-to-test Used by openshift-ci bot. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants