Skip to content

Instantly share code, notes, and snippets.

View DanukaPraneeth's full-sized avatar

Danuka Praneeth DanukaPraneeth

View GitHub Profile
@DanukaPraneeth
DanukaPraneeth / kong-jwt-plugin.yml
Last active July 31, 2020 17:38
Kong | JWT plugin Configs
oc create secret \
generic app-admin-jwt \
--from-literal=kongCredType=jwt \
--from-literal=key="admin-issuer" \
--from-literal=algorithm=RS256 \
--from-literal=rsa_public_key="-----BEGIN PUBLIC KEY-----
K9+fdfgdfgfgdfggdfggg4Q7rL15PejvkFEQx7m3TzWmm0sx9xukU8Gc49rYLxKv
CK5OO5vMnZ2v9yXBQwAp50LFrY28NflkQcJ0GU6WFnySQZErwn0DM0cDWsaRpfkW
-----END PUBLIC KEY-----"
@DanukaPraneeth
DanukaPraneeth / openId-plugin.yml
Last active July 31, 2020 17:37
Kong | OpenId Connect Plugin
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: openid-connect
config:
audience_claim:
- aud
hide_credentials: true
auth_methods:
- client_credentials
@DanukaPraneeth
DanukaPraneeth / key-auth-plugin.yml
Last active July 31, 2020 17:37
Kong | Key Auth Plugin
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: key-auth
labels:
global: "true"
plugin: key-auth
---
oc create secret generic sp-apikey --from-literal=kongCredType=key-auth --from-literal=key=2a0dfb1b-8c8b
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: ip-restrict
config:
whitelist:
- 165.22.22.22
- 10.10.10.10
plugin: ip-restriction
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: bot-detect
plugin: bot-detection
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: cors-plugin
config:
credentials: false
exposed_headers: null
headers:
- Content-Type, Accept
max_age: 3666
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: rl-by-ip
config:
minute: 10
policy: local
limit_by: ip
plugin: rate-limiting
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: size-limit
config:
allowed_payload_size: 10
size_unit: bytes
plugin: request-size-limiting
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: request-validator
config:
allowed_content_types:
- application/json
body_schema: '[{"firstName":{"type": "string", "required": false}},{"lastName":{"type": "string", "required": true}}]'
parameter_schema: null
verbose_response: false
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: acl-plugin
config:
whitelist: ['app-admin']
hide_groups_header: true
plugin: acl