Git Product home page Git Product logo

api-waf-example-cdk's Introduction

CDK Waf authorizer demo

Demo using coraza in a API gateway authorizer to protect api endpoints

Stack Setup

As this demo uses a CGO enabled build for a arm64 target, a docker installation configured for arm64 builds will be required.

https://www.docker.com/blog/multi-arch-images/

go build -v ./cmd/application
๐Ÿ› ๏ธ  cmd/application done
โœ“  stacks/build done
โœ“  build done
cdk deploy --app ./application
2022/02/08 19:46:26 Starting Application Build
Bundling asset OpenenterpriseProductionWafStack/Hosting/Lambda/Code/Stage...
Bundling asset OpenenterpriseProductionWafStack/Hosting/AuthLambda/Code/Stage...
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
go: downloading github.com/aws/aws-lambda-go v1.28.0
...snip...
go: downloading golang.org/x/text v0.3.6

โœจ  Synthesis time: 389.27s

OpenenterpriseProductionWafStack: deploying...
[0%] start: Publishing 9389c3589f32bfd1b87004861d601e2975779b9cab5e93b343b6ce714f1be21b:current
[33%] success: Published 9389c3589f32bfd1b87004861d601e2975779b9cab5e93b343b6ce714f1be21b:current
[33%] start: Publishing 6c0316fef24d0df8a9a705c77052001217d864f49af386539d01df54618cd131:current
[66%] success: Published 6c0316fef24d0df8a9a705c77052001217d864f49af386539d01df54618cd131:current
[66%] start: Publishing 03a6956a2874eef697c616680543da701996309b495a79361634bb7569687fd6:current
[100%] success: Published 03a6956a2874eef697c616680543da701996309b495a79361634bb7569687fd6:current
OpenenterpriseProductionWafStack: creating CloudFormation changeset...

 โœ…  OpenenterpriseProductionWafStack

โœจ  Deployment time: 72.56s

Outputs:
OpenenterpriseProductionWafStack.HostingUrlOutput7A35DF00 = https://aaaaaaaaa.execute-api.eu-west-1.amazonaws.com/
Stack ARN:
arn:aws:cloudformation:eu-west-1:074705540277:stack/OpenenterpriseProductionWafStack/d6550f30-867f-11ec-98f3-0a8ba53abf81

โœจ  Total time: 461.83s

๐Ÿ› ๏ธ  deploy/application done
โœ“  deploy done

License

MIT

Useful commands

  • make deploy deploy this stack to your default AWS account/region
  • make waf/test/auth call the authorizor with a clean request
  • make waf/test/authblock call the authorizor with a blocking request
  • make waf/test/hello call the hello endpoint
  • make waf/test/version call the version endpoint

api-waf-example-cdk's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.