You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix command injection in go-getter when passing params to hg clone
The fix for this is to add -- to the arguments of each hg command,
before any user-input. This indicates the end of optional arguments,
only positional arguments are allowed.
* Remove upwards path traversal in subdirectories, filenames
* Prevent arbitrary file read, path traversal via subdirectory extraction
Not opt-in or opt-out, just never allowed. Upwards path traversal is not a subdirectory.
*Prevent arbitrary file write via `filename`
Not opt-in or opt-out, just never allowed. Upwards path traversal is not a filename in a subdirectory.
* Add Timeout option to HgGetter and GitGetter enforced with os/exec.CommandContext
* Add DisableSymlinks option to getter request
The fix for this is a new client request option, DisableSymlinks. When set to true, symlinks are disabled.
This prevents the client, likely in combination with the GitGetter, from following a symlink when the subdirectory
selection from the checked out repo is a symlink.
* Add custom symlink copy error
* Add DisableSymlinks as client option
Setting DisableSymlinks per request works but must be set on all request
made by a client. Adding it as a top-level client config option allows
for setting DisableSymlinks for all client.Get requests.
* Update get_http to address various get concerns
* Add XTerraformGetLimit and XTerraformGetDisabled
* Add Multiple new options to limit resource consumption:
DoNotCheckHeadFirst, HeadFirstTimeout, ReadTimeout, MaxBytes
* Add getter client to context for reuse
* Add setters/getters for storing configured getter.Client in a context
* Update HttpGetter to use ClientFromContext when available; otherwise
use a limited client for supporting X-Terraform-Get request
* Refactor HttpGetter function to make it clear when a configured
getter.Client is required
* Add security section to README
* Port changes from hashicorp/eastebry/timeout-for-getters
Adding timeout to s3Getter
* Port changes from from hashicorp/add-missing-timeouts
Add missing timeouts to `S3Getter` and `GCSGetter`
* Remove windows test for FileGetter
* Change to next-get image
Co-authored-by: Kent 'picat' Gruber <[email protected]>
Co-authored-by: Sylvia Moss <[email protected]>
The command is useful for verifying URL structures.
49
49
50
+
## Security
51
+
Fetching resources from user-supplied URLs is an inherently dangerous operation and may
52
+
leave your application vulnerable to [server side request forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery),
53
+
[path traversal](https://owasp.org/www-community/attacks/Path_Traversal), [denial of service](https://owasp.org/www-community/attacks/Denial_of_Service)
54
+
or other security flaws.
55
+
56
+
go-getter contains mitigations for some of these security issues, but should still be used with
57
+
caution in security-critical contexts. See the available [security options](#Security-Options) that
58
+
can be configured to mitigate some of these risks.
59
+
50
60
## URL Format
51
61
52
62
go-getter uses a single string URL as input to download from a variety of
@@ -83,7 +93,7 @@ is built-in by default:
83
93
file URLs.
84
94
* GitHub URLs, such as "github.com/mitchellh/vagrant" are automatically
85
95
changed to Git protocol over HTTP.
86
-
* GitLab URLs, such as "gitlab.com/inkscape/inkscape" are automatically
96
+
* GitLab URLs, such as "gitlab.com/inkscape/inkscape" are automatically
87
97
changed to Git protocol over HTTP.
88
98
* BitBucket URLs, such as "bitbucket.org/mitchellh/vagrant" are automatically
89
99
changed to a Git or mercurial protocol using the BitBucket API.
@@ -178,7 +188,7 @@ checksum string. Examples:
178
188
```
179
189
./foo.txt?checksum=file:./foo.txt.sha256sum
180
190
```
181
-
191
+
182
192
When checksumming from a file - ex: with `checksum=file:url` - go-getter will
183
193
get the file linked in the URL after `file:` using the same configuration. For
184
194
example, in `file:http://releases.ubuntu.com/cosmic/MD5SUMS` go-getter will
@@ -279,7 +289,7 @@ None
279
289
from a private key file on disk, you would run `base64 -w0 <file>`.
280
290
281
291
**Note**: Git 2.3+ is required to use this feature.
282
-
292
+
283
293
*`depth` - The Git clone depth. The provided number specifies the last `n`
284
294
revisions to clone from the repository.
285
295
@@ -374,35 +384,107 @@ files from a smb shared folder whenever the url is prefixed with `smb://`.
374
384
375
385
⚠️ The [`smbclient`](https://www.samba.org/samba/docs/current/man-html/smbclient.1.html) command is available only for Linux.
376
386
This is the ONLY option for a Linux user and therefore the client must be installed.
377
-
387
+
378
388
The `smbclient` cli is not available for Windows and MacOS. The go-getter
379
389
will try to get files using the file system, when this happens the getter uses the FileGetter implementation.
380
390
381
-
When connecting to a smb server, the OS creates a local mount in a system specific volume folder, and go-getter will
391
+
When connecting to a smb server, the OS creates a local mount in a system specific volume folder, and go-getter will
382
392
try to access the following folders when looking for local mounts.
0 commit comments