You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an interceptor that will only log a summary of what has been intercepted but not block anything.
That information will be useful to known what new facades/features to provide or what changes need to be planned on rules.
Avoid values because facts, notifications, webhook payloads, headers, and credentials can leak.
Aggregation
Do not emit one log per intercepted call. Groovy rules use collections, streams, optionals, closures, and query builders; raw call volume will be noisy.
Aggregate by normalized signature per ruleset version. Emit first-seen log lines and periodic summaries.
Classification
Even in report-only, classify signatures:
Fail-Open Semantics
Report-only must never break rule execution. If reporting fails, log that reporting failed and call through.
Config
Add a clear mode, probably:
OFF
REPORT
ENFORCE
Also add filters: all rules, only a realm, only a ruleset id, max unique signatures per deployment, summary interval.
Known Gaps
Runtime interception will not fully cover compile-time behavior such as imports, annotations, AST transforms, and @grab. Add a cheap pre-parse/source or AST inventory for those so they show up in the report too.
Activity
ebariaux commentedon Jun 3, 2026
Define these things first so the data is useful:
Coverage
Report both phases:
Registering only around script.run() misses the important part: rule closures execute later.
Event Schema
Do not log argument values. Log normalized signatures:
Avoid values because facts, notifications, webhook payloads, headers, and credentials can leak.
Aggregation
Do not emit one log per intercepted call. Groovy rules use collections, streams, optionals, closures, and query builders; raw call volume will be noisy.
Aggregate by normalized signature per ruleset version. Emit first-seen log lines and periodic summaries.
Classification
Even in report-only, classify signatures:
Dangerous examples: System, Runtime, ProcessBuilder, File, URL, sockets, reflection, classloaders, Class.forName, getClass, .class, metaClass, thread creation, @grab.
Fail-Open Semantics
Report-only must never break rule execution. If reporting fails, log that reporting failed and call through.
Config
Add a clear mode, probably:
Also add filters: all rules, only a realm, only a ruleset id, max unique signatures per deployment, summary interval.
Known Gaps
Runtime interception will not fully cover compile-time behavior such as imports, annotations, AST transforms, and @grab. Add a cheap pre-parse/source or AST inventory for those so they show up in the report too.
Implementation shape:
class ReportingGroovyInterceptor extends GroovyInterceptor {
@OverRide
public Object onMethodCall(Invoker invoker, Object receiver, String method, Object... args) throws Throwable {
report("METHOD", receiver != null ? receiver.getClass() : null, method, args);
return invoker.call(receiver, method, args);
}
}
Then wrap execution with register/unregister:
interceptor.register();
try {
script.run();
} finally {
interceptor.unregister();
}
And similarly around Groovy engine.fire(...).
ebariaux commentedon Jun 12, 2026
Needs to be updated once Decide Groovy Sandbox library to use · Issue #2850 · openremote/openremote has been sorted out.