-
Notifications
You must be signed in to change notification settings - Fork 863
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
Update security documentation to include security scanning tools #3084
Update security documentation to include security scanning tools #3084
Conversation
a731e49
to
42f331f
Compare
- `use_env_allowed_urls=true` is required in config.properties to read `allowed_urls` from environment variable | ||
1. A `.mar` file being downloaded from the internet from an untrustworthy source may have malicious code, compromising the integrity of your application. | ||
2. TorchServe executes arbitrary python code packaged in the `mar` file. Make sure that you've either audited that the code you're using is safe and/or is from a source that you trust. | ||
3. Torchserve supports custom [plugins](https://github.com/pytorch/serve/tree/master/plugins) and [handlers](https://github.com/pytorch/serve/blob/master/docs/custom_service.md). |
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.
Are we using these plugins?
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.
Plugins are not loaded by default but can be enabled by configuring the plugins_path
and placing the plugin JAR in that path. For example, this is how the token authorization is implemented: https://github.com/pytorch/serve/blob/master/docs/token_authorization_api.md
- `use_env_allowed_urls=true` is required in config.properties to read `allowed_urls` from environment variable | ||
1. A `.mar` file being downloaded from the internet from an untrustworthy source may have malicious code, compromising the integrity of your application. | ||
2. TorchServe executes arbitrary python code packaged in the `mar` file. Make sure that you've either audited that the code you're using is safe and/or is from a source that you trust. | ||
3. Torchserve supports custom [plugins](https://github.com/pytorch/serve/tree/master/plugins) and [handlers](https://github.com/pytorch/serve/blob/master/docs/custom_service.md). |
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.
Its not clear what the suggestion is in 3). Could you please elaborate
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.
The goal is to show that a custom TorchServe security scanning plugin can be created which makes use of existing tools such as clamd, virstotal and fickling. For example, it could be an endpoint plugin which:
- Accepts a model archive name or url as input
- Scans the model archive contents for security issues
- Places model archive in model store only once security scanning has passed
The above is just an example of functionality that an endpoint plugin can provide but can be customized based on the runtime security scanning requirements.
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.
LGTM
Description
Include security scanning tools in security documentation
Clamd: https://pypi.org/project/clamd/
VirusTotal: https://virustotal.github.io/vt-py/
Fickling: https://github.com/trailofbits/fickling
Link security documentation from the main Readme.
Fixes: #3065
Type of change