-
Notifications
You must be signed in to change notification settings - Fork 1
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
Clamav sidecar proof of concept #81
Conversation
Add initial New Relic integration
CI: Accessibility scan
Got some feedback from other 18f engineers on this as well. They suggested the possibility of setting up another cloud.gov app that exposes a clamav API. https://blog.theodo.com/2017/11/implement-antivirus-api-10-min/ describes the general approach, and there are reports of similar setups being successfully implemented in cloud.gov Pros to this approach:
Cons to this approach:
|
Nice. And it looks like clamav is one of the top free solutions for virus scanning. I haven't tested it yet, but had a couple of questions:
How should we read this scan summary? Did it actually scan any data? (0 MB, 0 files). Do we have any idea how big the uploaded files will be? I took a look at the architecture behind setting up another cloud.gov app exposing the clamav API. It definitely is an interesting approach. I think the advantage in that scenario would be that we could call the service via a REST api from our backend. While there are ways to call a shell command from nodejs, using a REST api seems like a better interface. The downside in addition to the "cons" listed above, could be introducing more complex setup, potentially bringing in more points of failure. |
This would be an important advantage |
Oops, no, needed a
Given the difference between this scan and the original one, looks like the vast majority of the time is startup overhead. That would be mitigated by running I'm definitely leaning towards the separate app/REST api for our use rather than running |
Decision made: we will run a separate ClamAV app w/ REST API. Work tracked here: HHS#203 |
Description of change
This installs
clamav
in our app container, and ensures that virus file definitions are kept up to date. It does not include running theclamd
daemon in the background, so scans only happen by manually callingclamscan
with a file or directory.Pros to this approach:
Downsides:
clamscan
on uploaded files1.5G
of RAM was the bare minimum to not crash out of scanning thesrc
directory.1G
was the minimum to just get thefreshclam
process to completeOther notes:
This requires version 7 of the cf-cli tool. That's easily installed on macs (
brew install cf-cli@7
), but I didn't look into other operating systems.How to test
This app is deployed as tta-smarthub-ryan to the tta-transient-ryan space. Run
cf target -s tta-transient-ryan
cf ssh tta-smarthub-ryan
/tmp/lifecycle/shell
clamscan -d $CLAMAV_DATA_DIR src
will run a scan of thesrc
directoryIssue(s)
Checklist
Not ready to merge, so deleting the checklist.