-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
VIRTS-1807 Adding exfil file download capability to the UI #2060
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2060 +/- ##
==========================================
- Coverage 64.55% 64.07% -0.48%
==========================================
Files 61 61
Lines 4672 4724 +52
==========================================
+ Hits 3016 3027 +11
- Misses 1656 1697 +41
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good aside from one bug.
And a couple things I don't think should hold this PR up:
- In the future we may want to add a "check all" button. The ability I used when testing only exfilled a single file, but if it's very many this would be easier than having to check each checkbox.
- I noticed we aren't consistent as far as capitalization with our http error messages, such as in
download_exfil_file()
. This isn't limited to this PR though; see alsocaldera/app/service/rest_svc.py
Lines 281 to 283 in 0dcafce
raise web.HTTPBadRequest(body='This operation has already finished.') elif state not in op[0].states.values(): raise web.HTTPBadRequest(body='state must be one of {}'.format(op[0].states.values()))
startdir = self.get_config('exfil_dir') | ||
|
||
exfil_files = dict() | ||
exfil_folders = [f.path for f in os.scandir(startdir) if f.is_dir()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went to the Exfills UI before running any operations, selected "all" and got an Internal Server Error on this line:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/caldera'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, looks like I forgot to check that, a simple validation should help prevent that. I'll push up a change.
Also @clenk I can address you other two issues when I push up my fix, both should be fairly simple to address, and I agree that we should have a consistency in our messages returned to the user. |
Description
adding the capability to download the exfilled files from agents via the UI
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I created multiple directories and operations and tested to make sure exfilled files were properly shown in the UI and that when downloaded files were un-encrypted and able to be extracted/read without having to pass through any additional scripts.
Checklist: