-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix!: Validate paths for Job Bundles #171
Conversation
f7cc051
to
15adea0
Compare
15adea0
to
f72a039
Compare
f72a039
to
621e3c7
Compare
1032d21
to
7c62124
Compare
8c15f35
to
17c200b
Compare
I've also updated the screenshots with some UI changes I made based on Mark's feedback, take another look at the description! |
17c200b
to
2ffbc7a
Compare
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.
Thanks for making lots of refactoring and making the GUI submitter prettier! I posted minor comments mainly related to variable names.
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.
Look great to me, thank you!
Breaking change! Adds validation to Job Bundles, including the following: - default PATH values in Job Bundle templates MUST be relative AND must resolve within the bundle directory - that includes any symlinks within the bundle itself - if any paths in the overall submission resolve outside of the job bundle directory or any configured storage profile filesystem locations, a warning message is raised - `S3AssetManager` changes: - `prepare_paths_for_upload` was added and needs to be called before hash_assets_and_create_manifest - `hash_assets_and_create_manifest` interface changed Signed-off-by: Caden Marofke <marofke@amazon.com>
bef2e07
to
32a8611
Compare
Breaking change! Adds validation to Job Bundles, including the following: - default PATH values in Job Bundle templates MUST be relative AND must resolve within the bundle directory - that includes any symlinks within the bundle itself - if any paths in the overall submission resolve outside of the job bundle directory or any configured storage profile filesystem locations, a warning message is raised - `S3AssetManager` changes: - `prepare_paths_for_upload` was added and needs to be called before hash_assets_and_create_manifest - `hash_assets_and_create_manifest` interface changed Signed-off-by: Caden Marofke <marofke@amazon.com>
What was the problem/requirement? (What/Why)
We need to safeguard users when uploading inputs. There's a few cases here:
a. cannot have default parameters that are absolute, and
b. the default relative paths must resolve inside the bundle directory (so no escaping with
../
)a. If the path resolves outside of the job bundle directory AND is not part of a configured storage profile location for the queue being submitted to, we need to warn the user, so they're aware files will be uploaded from an unexpected area
What was the solution? (How)
a. This was mostly added in
src/deadline/client/job_bundle/parameters.py
andsrc/deadline/client/job_bundle/loader.py
src/deadline/job_attachments/upload.py
to first process all asset paths (these are combined with the validated Job Bundle, parameters file, queue environment parameters, and asset references files), and prompt the user to confirm if they want to continue submission if files are found outside of the Job Bundle dir and any storage profile locations for the queuea. Note that I moved the confirmation popup that happens AFTER hashing to BEFORE hashing to include a combined confirmation message
b. Also note: when submitting through the GUI, since we move the job bundle to the
~/.deadline/job_history/
dir, the actual input files for the job bundle do not move, so if the files in the original job bundle are not part of a Storage Profile filesystem location, it will always prompt the usera. Fixed some text that didn't render as it was using HTML tags
b. Grouped the progress bars so it's more clear
What is the impact of this change?
Users should have more information about what they're submitting when they attempt to submit a Job Bundle. This protects users from job bundles that could contain symlinks that resolve outside of the job bundle directory. Also, the UI is a little nicer to look at (at least I think so ;) )
How was this change tested?
UI Changes
Old UI
New UI
Was this change documented?
Not yet
Is this a breaking change?
Yes, the interface for the Job Attachments S3AssetManager has changed (should only affect custom Python scripts that import the library)
hash_assets_and_create_manifest
takes different argumentsprepare_paths_for_upload
was added and needs to be called beforehash_assets_and_create_manifest
Also: