Coder Social home page Coder Social logo

bvpatel / kong-plugin-mtls-acl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from callistaenterprise/kong-plugin-mtls-acl

0.0 1.0 0.0 8 KB

Kong Gateway plugin which restrict access by whitelisting or blacklisting clients using arbitrary information from an mTLS client certificate.

License: Apache License 2.0

Lua 100.00%

kong-plugin-mtls-acl's Introduction

kong-plugin-mtls-acl

kong-plugin-mtls-acl is an Open Source plugin for Kong which restricts access based on certificate information provided in an HTTP header. It is similar (but simpler) than the acl built-in plugin.

This plugin requires an mtls-auth plugin to have been already enabled on the Service or Route.

The implementation of this plugin was inspired by the acl and oidc-acl plugins.

Install

Install luarocks and run the following command

luarocks install kong-plugin-mtls-acl

You also need to set the KONG_PLUGINS environment variable

export KONG_PLUGINS=mtls-auth,mtls-acl

Configuration

To enable the plugin for a service:

curl -X POST http://localhost:8001/services/{ID}/plugins \
    --data "name=mtls-acl"  \
    --data "config.allow=client1" \
    --data "config.allow=client2"

To enable the plugin using declarative config in kong.yml:

plugins: 
- name: mtls-auth
  config:
    allow:
	- client1
	- client2
Form Parameter Default Required Description
certificate_header_name true The name of the HTTP header from where certificate information is going to be extracted. This should be same as what you have set in mtls-auth plugin.
hide_certificate_header false false Flag that if enabled (true), prevents the certificate_header_name to be sent in the request to the Upstream service.
allow semi-optional The certificate(s) to allow
deny semi-optional The certificate(s) to deny

You can’t configure an ACL with both allow and deny configurations. An ACL with an allow provides a positive security model, in which the configured groups are allowed access to the resources, and all others are inherently rejected. By contrast, a deny configuration provides a negative security model, in which certain groups are explicitly denied access to the resource (and all others are allowed).

License

Copyright 2023 Björn Beskow

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

kong-plugin-mtls-acl's People

Contributors

beskow 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.