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 file scanning #316

Merged
merged 28 commits into from
Feb 22, 2021
Merged

Add file scanning #316

merged 28 commits into from
Feb 22, 2021

Conversation

dcmcand
Copy link
Contributor

@dcmcand dcmcand commented Feb 22, 2021

Description of change
Add support for scanning files using worker instance.

How to test
Test happy path

  1. Pull down changes and start server.
  2. Wait for everything to come up (including clamav which takes a while since it updates the db the first time you run it)
  3. Fill in a grantee and the go to topics and resources.
  4. Upload a file this isn't plaintext, such as a docx or pdf
  5. refresh page and you should see either scanning queued or approved.
  6. If you see scanning queued refresh the page again and you should see approved.
  7. Watch the logs and you will see a message like worker_1 | {"message":"job 3e934f98-47b4-41d0-9e53-3a40cc565688.pdf completed with status 200 and result { Status: \"OK\", Description: \"\" }","level":"info","timestamp":"2021-02-17T18:27:23.442Z"
  8. yarn docker:stop and yarn docker:reset

Test retry
Same as above except don't wait for clamav to come all the way up. When the web ui is ready, you can start uploading.
Watch the logs, you will see the jobs fail and retry up to 5 times with an exponential backoff.
While this is happening if you refresh the web ui you should see a "scanning queued" status.
After you see a success message like above, refreshing the web ui should show a status of approved.

Test infected file
Same as the happy path, except use file virus-test.zip (note, this isn't a virus, just the clamav test file zipped so it will work with this app).
Refreshing the page will give you a status of rejected and you should see a message in the logs that says {"message":"job 49bcf537-4932-4b1b-9cbc-790cad8b23cc.zip completed with status 406 and result { Status: \"FOUND\", Description: \"Eicar-Signature\" }","level":"info","timestamp":"2021-02-17T18:32:14.287Z"}

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • Documentation updated

Chuck McAndrew and others added 28 commits February 15, 2021 14:45
commit ad7bcdd
Merge: 74a8308 4c04457
Author: Chuck McAndrew <[email protected]>
Date:   Wed Feb 17 13:05:43 2021 -0500

    Merge pull request #167 from adhocteam/cm-204-add-file-queue

    Cm 204 add file queue components to backend app

commit 4c04457
Author: Chuck McAndrew <[email protected]>
Date:   Wed Feb 17 11:57:54 2021 -0500

    update handler.test.js and switch to auditLogger
Add test thresholds
add additional tests
@dcmcand dcmcand requested a review from rahearn February 22, 2021 19:33
@dcmcand dcmcand merged commit 708a608 into HHS:main Feb 22, 2021
PatricePascual-ACF pushed a commit that referenced this pull request Jun 15, 2021
* First pass at a pattern for widgets

* Set coverage limits to 0 so we deploy to staging

These limits will be increased back to what they are on main before
merging.

* Reset coverage limits

* TTA Overview widget initial commit

* Add backend tests

* Deploy to sandbox

* Fix lint error

* Fix frontend lint errors

* Merge main and fix invalid region

* Refactor test

* Add frontend tests

* Add frontend tests

* Styling improvements

* Add region number in caption

* Update mocks in landing tests

* Adjusted sizing, flickering

* Add temp border to overview widget

Co-authored-by: Josh Salisbury <[email protected]>
PatricePascual-ACF added a commit that referenced this pull request Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants