mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-01 06:37:22 +00:00
new(userspace/falco): check lua data when handling gRPC
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
committed by
Leo Di Donato
parent
bef491ae20
commit
5e511d8f09
@@ -304,15 +304,19 @@ int falco_outputs::handle_http(lua_State *ls)
|
|||||||
// TODO(fntlnz, leodido): verify if this works with k8s_audit as source
|
// TODO(fntlnz, leodido): verify if this works with k8s_audit as source
|
||||||
int falco_outputs::handle_grpc(lua_State *ls)
|
int falco_outputs::handle_grpc(lua_State *ls)
|
||||||
{
|
{
|
||||||
|
// check parameters
|
||||||
|
if(!lua_istable(ls, -1) ||
|
||||||
|
!lua_istable(ls, -2) ||
|
||||||
|
!lua_isstring(ls, -3) ||
|
||||||
|
!lua_isstring(ls, -4) ||
|
||||||
|
!lua_isstring(ls, -5) ||
|
||||||
|
!lua_isstring(ls, -6))
|
||||||
|
{
|
||||||
|
lua_pushstring(ls, "Invalid arguments passed to handle_grpc()");
|
||||||
|
lua_error(ls);
|
||||||
|
}
|
||||||
|
|
||||||
response grpc_res = response();
|
response grpc_res = response();
|
||||||
// TODO(fntlnz, leodido): do the checks and make sure all the fields are sent
|
|
||||||
// fixme > check parameters later
|
|
||||||
// if(!lua_isstring(ls, -1) ||
|
|
||||||
// !lua_isstring(ls, -2))
|
|
||||||
// {
|
|
||||||
// lua_pushstring(ls, "Invalid arguments passed to handle_grpc()");
|
|
||||||
// lua_error(ls);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// todo(leodido, fntlnz) > pass the ID (?)
|
// todo(leodido, fntlnz) > pass the ID (?)
|
||||||
// grpc_res.set_id("...");
|
// grpc_res.set_id("...");
|
||||||
|
Reference in New Issue
Block a user