final String clazz = (String) config.getOrDefault("sandbox", "");
SecurityCustomizerProvider securityCustomizerProvider = null;
if (!clazz.isEmpty()) {
try {
final Class providerClass = Class.forName(clazz);
final GroovyInterceptor interceptor = (GroovyInterceptor) providerClass.newInstance();
securityCustomizerProvider = new SecurityCustomizerProvider(interceptor);
} catch (Exception ex) {
logger.warn("Could not instantiate GroovyInterceptor implementation [%s] for the SecurityCustomizerProvider. It will not be applied.", clazz);
securityCustomizerProvider = null;
}