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
Complete rewrite to support AWS V4 style signature
The rewrite also includes a lot of changes to the coding style. The core
logic of generating signatures now resides in a separate file from the
nginx module source. The nginx module code i.e. ngx_http_aws_auth now
only containts lines that glues the signature generation code to the
nginx lifecycle.
We also also introduced unit tests based on cmocka. Documentation on
usage of the unit tests is sparse. It however serves as a great
mechanism to both test correctness of any new functionality and also as
a way to detect regressions.
The V4 protocol does not need access to the actual secret keys that one obtains
45
+
from the IAM service. The correct way to use the IAM key is to actually generate
46
+
a scoped signing key and use this signing key to access S3. This nginx module
47
+
requires the signing key and not the actual secret key. It is an insecure practise
48
+
to let the secret key reside on your nginx server.
44
49
45
-
# Community
50
+
Note that signing keys have a validity of just one week. Hence, they need to
51
+
be refreshed constantly. Please useyour favourite configuration management
52
+
system such as saltstack, puppet, chef, etc. etc. to distribute the signing
53
+
keys to your nginx clusters. Do not forget to HUP the server after placing the new
54
+
signing key as nginx reads the configuration only at startup time.
46
55
47
-
The project uses google groups for discussions. The group name is nginx-aws-auth. You can visit the web forum [here](https://groups.google.com/forum/#!forum/nginx-aws-auth)
48
-
49
-
50
-
Request signing & Amazon Cloudfront Service
51
-
-------------------------------------------
52
-
53
-
54
-
If Nginx is behind Amazon's CloudFront CDN service, you need to add this setting :
56
+
A standalone python script has been provided to generate the signing key
57
+
```
58
+
./generate_signing_key -h
59
+
usage: generate_signing_key [-h] -k ACCESS_KEY -r REGION [-s SERVICE]
60
+
[-d DATE] [--no-base64] [-v]
61
+
62
+
Generate AWS S3 signing key in it's base64 encoded form
63
+
64
+
optional arguments:
65
+
-h, --help show this help message and exit
66
+
-k SECRET_KEY, --secret-key SECRET_KEY
67
+
The secret key generated using AWS IAM. Do not confuse
68
+
this with the access key id
69
+
-r REGION, --region REGION
70
+
The AWS region where this key would be used. Example:
71
+
us-east-1
72
+
-s SERVICE, --service SERVICE
73
+
The AWS service for which this key would be used.
74
+
Example: s3
75
+
-d DATE, --date DATE The date on which this key is generated in yyyymmdd
76
+
format
77
+
--no-base64 Disable output as a base64 encoded string. This NOT
78
+
recommended
79
+
-v, --verbose Produce verbose output on stderr
55
80
56
-
```nginx
57
-
proxy_set_header x-amz-cf-id "";
58
81
```
59
82
60
-
into nginx.conf in order to clear X-Amz-Cf-Id header before signing the request to Amazon S3 bucket.
83
+
## Known limitations
84
+
The 2.x version of the module currently only has support for GET and HEAD calls. This is because
85
+
signing request body is complex and has not yet been implemented.
The project uses google groups for discussions. The group name is nginx-aws-auth. You can visit the web forum [here](https://groups.google.com/forum/#!forum/nginx-aws-auth)
66
91
67
92
68
-
Credits:
69
-
========
93
+
## Credits
70
94
Original idea based on http://nginx.org/pipermail/nginx/2010-February/018583.html and suggestion of moving to variables rather than patching the proxy module.
71
95
72
96
Subsequent contributions can be found in the commit logs of the project.
73
-
74
-
License
75
-
-------
76
-
This project uses the same license as ngnix does i.e. the 2 clause BSD / simplified BSD / FreeBSD license
0 commit comments