All Projects → anomalizer → Ngx_aws_auth

anomalizer / Ngx_aws_auth

Licence: bsd-2-clause
nginx module to proxy to authenticated AWS services

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Ngx aws auth

Ansible Playbooks
Ansible playbook collection that have been written for Ubuntu. Some of the playbooks are Elasticsearch, Mesos, AWS, MySql, Sensu, Nginx etc..
Stars: ✭ 429 (+8.06%)
Mutual labels:  aws-s3, nginx
Highdsa
2018年本科毕设项目,已更新所有开发和部署文档。基于Dubbo、SSM、Shiro、ELK、ActiveMQ、Redis等实现的一套高可用、高性能、高可扩展的分布式系统架构,实现可支持业务的基础公共服务,API使用Restful风格对外暴露。已经实现的包括:发送邮件服务、FastDFS文件存储服务、ELK实时日志查询服务、Redis缓存服务、Mybatis数据库、阿里短信推送、Goeasy消息推送、Druid监控、ActiveMQ消息队列、shiro权限认证、cas单点登录、权限配置web系统、移动端后台系统。持续更新中......
Stars: ✭ 385 (-3.02%)
Mutual labels:  nginx
Stacker
Stacker - The environment for local web development, ready for use.
Stars: ✭ 356 (-10.33%)
Mutual labels:  nginx
Cipi
An Open Source Control Panel for your Cloud! Deploy and manage LEMP apps in one click!
Stars: ✭ 376 (-5.29%)
Mutual labels:  nginx
Zenko
Zenko is the open source multi-cloud data controller: own and keep control of your data on any cloud.
Stars: ✭ 353 (-11.08%)
Mutual labels:  aws-s3
Storage
💿 Storage abstractions with implementations for .NET/.NET Standard
Stars: ✭ 380 (-4.28%)
Mutual labels:  aws-s3
Hi Nginx
A fast and robust web server and application server for C++,Python,Lua ,Java,quickjs language
Stars: ✭ 346 (-12.85%)
Mutual labels:  nginx
Django React Boilerplate
DIY Django + React Boilerplate for starting your SaaS
Stars: ✭ 385 (-3.02%)
Mutual labels:  nginx
Dockerfiles
Discontinued. Fork at your will.
Stars: ✭ 384 (-3.27%)
Mutual labels:  nginx
Kong Docs Cn
微服务 Api 网关 Kong 最新文档中文版
Stars: ✭ 371 (-6.55%)
Mutual labels:  nginx
Node Microservice Demo
✨ Example project for Micro-services w/ Node + TypeScript + Express + Swagger + Docker
Stars: ✭ 368 (-7.3%)
Mutual labels:  nginx
Salamanderwnmp
A beautiful Nginx PHP Mysql environment for windows( windows下用WPF制作的nginx,php,mysql集成环境(免安装))
Stars: ✭ 358 (-9.82%)
Mutual labels:  nginx
Notebook
🍎 笔记本
Stars: ✭ 381 (-4.03%)
Mutual labels:  nginx
Loadcat
NGINX load balancer configurator
Stars: ✭ 356 (-10.33%)
Mutual labels:  nginx
Naxsi
NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
Stars: ✭ 3,927 (+889.17%)
Mutual labels:  nginx
Nginx Build
Seamless nginx builder
Stars: ✭ 352 (-11.34%)
Mutual labels:  nginx
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (-7.81%)
Mutual labels:  nginx
Docker Django
A complete docker package for deploying django which is easy to understand and deploy anywhere.
Stars: ✭ 378 (-4.79%)
Mutual labels:  nginx
Skale
High performance distributed data processing engine
Stars: ✭ 390 (-1.76%)
Mutual labels:  aws-s3
Nginx Ui
Nginx UI allows you to access and modify the nginx configurations files without cli.
Stars: ✭ 4,067 (+924.43%)
Mutual labels:  nginx

AWS proxy module

Build Status Gitter chat

This nginx module can proxy requests to authenticated S3 backends using Amazon's V4 authentication API. The first version of this module was written for the V2 authentication protocol and can be found in the AuthV2 branch.

License

This project uses the same license as ngnix does i.e. the 2 clause BSD / simplified BSD / FreeBSD license

Usage example

Implements proxying of authenticated requests to S3.

  server {
    listen     8000;

    aws_access_key your_aws_access_key; # Example AKIDEXAMPLE
    aws_key_scope scope_of_generated_signing_key; #Example 20150830/us-east-1/service/aws4_request
    aws_signing_key signing_key_generated_using_script; #Example L4vRLWAO92X5L3Sqk5QydUSdB0nC9+1wfqLMOKLbRp4=
    aws_s3_bucket your_s3_bucket;

    location / {
      aws_sign;
      proxy_pass http://your_s3_bucket.s3.amazonaws.com;
    }

    # This is an example that does not use the server root for the proxy root
    location /myfiles {

      rewrite /myfiles/(.*) /$1 break;
      proxy_pass http://your_s3_bucket.s3.amazonaws.com/$1;

      aws_access_key your_aws_access_key;
      aws_key_scope scope_of_generated_signing_key;
      aws_signing_key signing_key_generated_using_script;
    }

    # This is an example that use specific s3 endpoint, default endpoint is s3.amazonaws.com
    location /s3_beijing {

      rewrite /s3_beijing/(.*) /$1 break;
      proxy_pass http://your_s3_bucket.s3.cn-north-1.amazonaws.com.cn/$1;

      aws_sign;
      aws_endpoint "s3.cn-north-1.amazonaws.com.cn";
      aws_access_key your_aws_access_key;
      aws_key_scope scope_of_generated_signing_key;
      aws_signing_key signing_key_generated_using_script;
    }
  }

Security considerations

The V4 protocol does not need access to the actual secret keys that one obtains from the IAM service. The correct way to use the IAM key is to actually generate a scoped signing key and use this signing key to access S3. This nginx module requires the signing key and not the actual secret key. It is an insecure practise to let the secret key reside on your nginx server.

Note that signing keys have a validity of just one week. Hence, they need to be refreshed constantly. Please useyour favourite configuration management system such as saltstack, puppet, chef, etc. etc. to distribute the signing keys to your nginx clusters. Do not forget to HUP the server after placing the new signing key as nginx reads the configuration only at startup time.

A standalone python script has been provided to generate the signing key

./generate_signing_key -h
usage: generate_signing_key [-h] -k SECRET_KEY -r REGION [-s SERVICE]
                            [-d DATE] [--no-base64] [-v]

Generate AWS S3 signing key in it's base64 encoded form

optional arguments:
  -h, --help            show this help message and exit
  -k SECRET_KEY, --secret-key SECRET_KEY
                        The secret key generated using AWS IAM. Do not confuse
                        this with the access key id
  -r REGION, --region REGION
                        The AWS region where this key would be used. Example:
                        us-east-1
  -s SERVICE, --service SERVICE
                        The AWS service for which this key would be used.
                        Example: s3
  -d DATE, --date DATE  The date on which this key is generated in yyyymmdd
                        format
  --no-base64           Disable output as a base64 encoded string. This NOT
                        recommended
  -v, --verbose         Produce verbose output on stderr


./generate_signing_key -k wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY -r us-east-1
L4vRLWAO92X5L3Sqk5QydUSdB0nC9+1wfqLMOKLbRp4=
20160902/us-east-1/s3/aws4_request

Supported environments

This plugin is tested against a variety of nginx versions, compilers, OS versions and hardware architectures. Take a look at the .travis.yml file or the latest travis build status to see the versions that the plugin has been tested against

Known limitations

The 2.x version of the module currently only has support for GET and HEAD calls. This is because signing request body is complex and has not yet been implemented.

Credits

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.

Subsequent contributions can be found in the commit logs of the project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].