Closed aravindraj29 closed 5 years ago
In FunctionShield v2 we added additional parameter cookie
to handle #3.
...
public class Handler implements RequestHandler<Map<String, Object>, String> {
static final int cookie = FunctionShield.configure(new JSONObject()
.put("policy", new JSONObject()
.put("read_write_tmp", "block")
.put("create_child_process", "block")
.put("outbound_connectivity", "block")
.put("read_handler", "block"))
.put("token", System.getenv("FUNCTION_SHIELD_TOKEN"))
.put("disable_analytics", true));
@Override
public String handleRequest(Map<String, Object> input, Context context) {
FunctionShield.configure(new JSONObject()
.put("policy", new JSONObject()
.put("outbound_connectivity", "alert")
.put("cookie", cookie));
...
I have added the function shield using Java in the static block of the handler. Configured the policy initially with 'block' mode and then changed it to 'alert' in a specific portion of code. But, it was not reflected. Still, seeing the 'block' mode error. Any idea about this issue?