Skip to content

Commit 88a19de

Browse files
agunapalmsaroufimlxning
authored
updates to security guidelines and docker config (#2669)
* updates to security guidelines and docker config * updates to security guidelines and docker config * updates to security guidelines and docker config * updates to security guidelines and docker config * updates to security guidelines * updates to security guidelines * Update SECURITY.md --------- Co-authored-by: Mark Saroufim <[email protected]> Co-authored-by: lxning <[email protected]>
1 parent 8d12993 commit 88a19de

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ TorchServe as much as possible relies on automated tools to do security scanning
1414
2. Docker Scanning: Using Snyk
1515
3. Code Analysis: Using CodeQL
1616

17+
## Important Security Guidelines
18+
19+
1. TorchServe listens on the following ports
20+
1. HTTP - `8080`, `8081`, `8082`
21+
2. gRPC - `7070`, `7071`
22+
23+
These ports are accessible to `localhost` by default. The address can be configured by following the [guide](https://github.com/pytorch/serve/blob/master/docs/configuration.md#configure-torchserve-listening-address-and-port)
24+
TorchServe does not prevent users from configuring the address to be `0.0.0.0`. Please be aware of the security risks if you use `0.0.0.0`
25+
2. TorchServe's Docker image is configured to expose the ports `8080`, `8081`, `8082`, `7070`, `7071` to the host by default(https://github.com/pytorch/serve/blob/master/docker/Dockerfile). When these ports are mapped to the host, make sure to use `localhost` or a specific ip address.
26+
27+
3. Be sure to validate the authenticity of the `.mar` file being used with TorchServe.
28+
1. A `.mar` file being downloaded from the internet from an untrusted source may have malicious code, compromising the integrity of your application
29+
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
30+
31+
32+
33+
1734

1835
## Reporting a Vulnerability
1936

docker/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ Creates a docker image for codebuild environment
187187

188188
## Start a container with a TorchServe image
189189

190-
The following examples will start the container with 8080/81/82 and 7070/71 port exposed to outer-world/localhost.
190+
The following examples will start the container with 8080/81/82 and 7070/71 port exposed to `localhost`.
191+
192+
## Security Guideline
193+
194+
TorchServe's Dockerfile configures ports `8080`, `8081` , `8082`, `7070` and `7071` to be exposed to the host by default.
195+
196+
When mapping these ports to the host, make sure to specify `localhost` or a specific ip address.
191197

192198
#### Start CPU container
193199

0 commit comments

Comments
 (0)