Working on Envoy Filter with LUA, hope that can connect with redis in cluster

Hi, every one.
I wanna use Envoy Filter to implement dynamic IP black list(It’s been bothering me for a while). First, I’m test to use Envoy Filter to read headers(xff and etc.), now I wanna use lua code to count and maintain black list.
In nginx, I can use OpenRestry, which have lua nginx module to connect a redis or simply we can use lua_shared_dict.
Is there any similar method to connect redis in istio-proxy ?Maybe I should copy some file like redis.lua into istio-proxy to local redis = require 'redis'
here is my istio-proxy log

[2019-09-29 09:38:05.485][26][error][lua] [external/envoy/source/extensions/filters/http/lua/lua_filter.cc:591] script log: [string "function envoy_on_request(request_handle)..."]:2: module 'redis' not found:
	no file './redis.lua'
	no file '/tmp/tmp.fnw0q64ZTT/./luajit/share/luajit-2.1.0-beta3/redis.lua'
	no file '/usr/local/share/lua/5.1/redis.lua'
	no file '/usr/local/share/lua/5.1/redis/init.lua'
	no file '/tmp/tmp.fnw0q64ZTT/./luajit/share/lua/5.1/redis.lua'
	no file '/tmp/tmp.fnw0q64ZTT/./luajit/share/lua/5.1/redis/init.lua'
	no file '/usr/local/lib/lua/5.1/redis.so'
	no file '/tmp/tmp.fnw0q64ZTT/./luajit/lib/lua/5.1/redis.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'

1 Like