serverless-secure
v1.0.5
Published
Lambda Serverless Secure tools to improving the security of your serverless applications.
Downloads
23
Readme
Lambda Secure Serverless Services - [ Beta ]
🕸️ Website 🏠 Homepage ✨ Demo
Install
$ npm install serverless-secure -D
Configure
plugins: [
....,
'serverless-secure',
],
Usage
$ serverless secure
or
$ sls secure -p <route-path>
***Adds Secure Layer:***
# secureAuthorizer: {
# handler: "secure_layer/handler.secureAuthorizer
# }
***..to desired route:***
# hello: {
# handler: 'handler.hello',
# events: [
# {
# http: {
# method: 'get',
# path: 'hello',
# cors: '${self:custom.corsValue}',
# authorizer: 'secureAuthorizer'
/##############################################/
Secure a token
$ curl --location --request POST 'http://localhost:3000/dev/secure_token' \
--header 'x-api-key: <YOUR GENERATED API KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "you can also request a session token: below",
"expires": "5" <---<< Request a Session Route!!
}'
Employ token
$ curl --location --request GET 'http://localhost:3000/dev/hello' \
--header 'Authorization: eyJhbGciOiJIUzI1NiJ9.....Z3wXEsAIdXzCIY'
Build a Session Route
$ sls secure-session -p mysession
Employ session
$ curl --location --request POST 'http://localhost:3000/dev/b34ef189e......143de480387a/session' \
--header 'Authorization: true' \
--header 'Content-Type: text/plain' \
--data-raw '{
}'
Build an Encryption Route (MITM)
$ sls secure-secret --passphrase mysecret
Employ EnCryption / DeCryption
$ curl --location --request POST 'http://localhost:3000/dev/EnCryptMessage' \
--header 'Content-Type: application/json' \
--data-raw '{"message": "Man in the middle message"}'
$ curl --location --request POST 'http://localhost:3000/dev/DeCryptMessage' \
--header 'Content-Type: application/json' \
--data-raw '{"message":"gePrUcw2F....dYLhnknBG4ttegpP0fA=="}'
Headers:
- N.B: All --header Authorization requests require a value!
Black-List IPAdresses
$ sls secure-blacklist -ip 127.0.0.1
White-List IPAdresses
$ sls secure-whitelist -ip 127.0.0.1
Run tests
$ npm run test
Utilities:
- $ sls secure-key
- $ sls secure-policy
Alpha Version 🛠 TODO 🛠️
- $ sls secure-email
- $ sls secure-message
- $ sls secure-headers
- $ sls secure-monitor
- $ sls secure-database
- ...and much much more...
Author 👤 Serverless-Secure
- Website: https://serverless-secure.com/
- Twitter: @serverless-secure
- Github: @serverless-secure
- LinkedIn: @serverless-secure
Contributing 🤝
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a ⭐️ if this project helped you!
License 📝
Copyright © 2020 Serverless-Secure Software Publishing House. This project is MIT licensed.