Install and Secure KONG

, , Comments Off on Install and Secure KONG

Install Casandra database

docker run -d --name kong-database -p 9042:9042 cassandra:3

Install Kong

docker run -d --name kong --link kong-database:kong-database -e
"KONG_DATABASE=cassandra" -e
"KONG_PG_HOST=kong-database" -p 8000:8000 -p 8443:8443 -p 8001:8001 -p
7946:7946 -p 7946:7946/udp kong:latest

Add a redirect

curl -i -X POST --url http://localhost:8001/apis/ --data
'name=example-api' --data '' --data

Add plugin to enforce security

curl -X POST --data "name=basic-auth" --data "config.hide_credentials=true"

Add user

curl -d "username=erick"

Give user a password

curl -X POST --data "username=erick" --data "password=passwd"

Encode username and password to Base64


curl -H 'Authorization: Basic ZXJpY2s6cGFzc3dk'