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

Add support for additional flags #53

Merged
merged 37 commits into from
Nov 3, 2022

Conversation

mjourdan
Copy link
Contributor

@mjourdan mjourdan commented May 13, 2022

🗣 Description

💭 Motivation and context

Wanted to automatically move the infected files to a quarantine folder. Also, allow some tuning.

This PR resolves #51 and #50.

🧪 Testing

I ran the role against a Debian 11 target host.

- hosts: all
  become: yes
  become_method: sudo
  vars:
    clamav_scan_move: true
  roles:
    - clamav

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

@mjourdan Thanks very much for contributing to this repo! Please take a look at my suggestions and let me know if you have any questions or concerns.

README.md Outdated Show resolved Hide resolved
defaults/main.yml Outdated Show resolved Hide resolved
defaults/main.yml Outdated Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
templates/virus_scan.sh Outdated Show resolved Hide resolved
templates/virus_scan.sh Outdated Show resolved Hide resolved
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Looks great to me now - thank you @mjourdan for contributing!

@jsf9k, @mcdonnnj, or @felddy - can you please give this PR a once-over?

@mcdonnnj mcdonnnj added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label May 27, 2022
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! This all looks solid. I have some minor changes I'd like to see below.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
defaults/main.yml Outdated Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
templates/virus_scan.tpl.sh Outdated Show resolved Hide resolved
templates/virus_scan.tpl.sh Outdated Show resolved Hide resolved
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

I'd like to see some additional tests that cover the new options you have added. It may make sense to create some new molecule scenarios for this, as is done, e.g., in cisagov/ansible-role-python#46.

README.md Outdated Show resolved Hide resolved
defaults/main.yml Outdated Show resolved Hide resolved
defaults/main.yml Outdated Show resolved Hide resolved
@ClementJ35
Copy link
Contributor

ClementJ35 commented Oct 14, 2022

Hi @jsf9k,
I did the tests as you did for modify_config. It works nice (see https://github.com/mjourdan/ansible-role-clamav/actions/runs/3250333690 )
Here, it can't run because of merge conflict.
What is your policy ?
Do we merge / rebase / do nothing ?

Mathieu Jourdan and others added 19 commits October 17, 2022 10:35
Alphabetize, clean up wording, and fix typos/formatting

Co-authored-by: dav3r <daver@geekpad.com>
Alphabetize

Co-authored-by: dav3r <daver@geekpad.com>
Co-authored-by: dav3r <daver@geekpad.com>
avoid abbreviation

Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
replace dict with list

Co-authored-by: Shane Frasier <maverick@maverickdolphin.com>
remove unnecessary quotes on file mode

Co-authored-by: Shane Frasier <maverick@maverickdolphin.com>
Add backticks to default values in readme

Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
@jsf9k
Copy link
Member

jsf9k commented Oct 17, 2022

Hi @jsf9k, I did the tests as you did for modify_config. It works nice (see https://github.com/mjourdan/ansible-role-clamav/actions/runs/3250333690 ) Here, it can't run because of merge conflict. What is your policy ? Do we merge / rebase / do nothing ?

Thanks @ClementJ35 and @mjourdan! I rebased the PR; once the tests pass I'll re-review.

@jsf9k
Copy link
Member

jsf9k commented Oct 17, 2022

The build is failing because of an issue in molecule. Hopefully that issue is resolved upstream soon.

@ClementJ35
Copy link
Contributor

Hi @jsf9k, thanks for rebasing.
It seems your PR as been merged : ansible/molecule#3687
I'll keep an eye here to see if it's passing all tests.

@jsf9k
Copy link
Member

jsf9k commented Oct 19, 2022

Hi @jsf9k, thanks for rebasing. It seems your PR as been merged : ansible-community/molecule#3687 I'll keep an eye here to see if it's passing all tests.

Yep, once they release a new version of Molecule I can re-run the tests and they should pass.

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Great work @mjourdan! Thank you for the contribution!

@jsf9k jsf9k unassigned dav3r Oct 26, 2022
@jsf9k
Copy link
Member

jsf9k commented Oct 26, 2022

@dav3r and @mcdonnnj, please re-review this pull request.

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Looks great - strong work! 🚀

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Thanks for the continued work in getting this implemented. I'm suggesting that the additional_flags scenario's files more closely mirror the form of the modify_config scenario so that we are consistent. Other than that all I saw was a typo.

README.md Outdated Show resolved Hide resolved
molecule/additional_flags/INSTALL.rst Outdated Show resolved Hide resolved
molecule/additional_flags/prepare.yml Outdated Show resolved Hide resolved
molecule/additional_flags/python.yml Outdated Show resolved Hide resolved
molecule/additional_flags/requirements.yml Outdated Show resolved Hide resolved
molecule/additional_flags/upgrade.yml Outdated Show resolved Hide resolved
molecule/additional_flags/molecule.yml Outdated Show resolved Hide resolved
molecule/additional_flags/molecule-no-systemd.yml Outdated Show resolved Hide resolved
molecule/additional_flags/molecule-with-systemd.yml Outdated Show resolved Hide resolved
jsf9k and others added 2 commits November 2, 2022 12:26
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
This entailed making several files in molecule/additional_flags
symlinks instead of hard copies.  I also broke the tests that were in
default/tests/test_default.py into two files so I could reuse most of
them in molecule/additional_flags but still create a slightly
different version of others specific to the scenario.

Co-authored-by: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com>
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Still good, aside from one missed docstring update. 🚀

Co-authored-by: dav3r <daver@geekpad.com>
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Just a small docstring fix from me.

molecule/additional_flags/tests/test_additional_flags.py Outdated Show resolved Hide resolved
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
@jsf9k jsf9k merged commit f0756e3 into cisagov:develop Nov 3, 2022
@jsf9k
Copy link
Member

jsf9k commented Nov 3, 2022

@mjourdan and @ClementJ35, thanks for the contribution and for sticking with us. This one is finally merged!

@mjourdan
Copy link
Contributor Author

mjourdan commented Nov 7, 2022

Thank you @jsf9k @dav3r @mcdonnnj @ClementJ35 \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Allow adding additional flags to the clamscan cron
5 participants