The initial REPL sandbox accepts all Java calls and Venice functions without any restrictions
venice> !sandbox status
No sandbox active (AcceptAllInterceptor)
venice>
venice> !sandbox reject-all
venice> !sandbox status
Sandbox active (RejectAllInterceptor). Rejects all Java calls and default blacklisted Venice functions
venice> !sandbox config
[reject-all] SAFE restricted sandbox
Java calls:
All rejected!
Blacklisted Venice functions:
agent
agent-error
agent-error-mode
:
venice>
venice> !sandbox customized
venice> !sandbox status
Customized sandbox active (SandboxInterceptor)
venice> !sandbox config
[customized] Customized sandbox
Sandbox rules:
class:java.io.IOException:*
class:java.io.InputStream
class:java.io.OutputStream
class:java.io.PrintStream:append
class:java.lang.Boolean
class:java.lang.Byte
class:java.lang.Character
class:java.lang.Double
class:java.lang.Exception:*
class:java.lang.Float
:
venice>
venice> !sandbox reject-all
; all Venice I/O functions are rejected
(io/exists-dir? (io/file "/tmp"))
; all Java calls are rejected
(. :java.lang.Math :min 2 3)
venice> !sandbox customized
; Venice I/O functions are accepted
(io/exists-dir? (io/file "/tmp"))
; Java calls matching the default rules are accepted
(. :java.util.Date :new)
; Java calls not matching the default rules are rejected
(. :java.lang.Math :min 2 3)
- enable calls to java.lang.Math
- enable access to system property java.class.path
- enable access to system environment variable JAVA___HOME
- blacklist all Venice I/O functions
- blacklist the Venice 'count' function
venice> !sandbox customized
venice> !sandbox add-rule class:java.lang.Math:*
venice> !sandbox add-rule system.property:java.class.path
venice> !sandbox add-rule system.env:JAVA_HOME
venice> !sandbox add-rule blacklist:venice:*io*
venice> !sandbox add-rule blacklist:venice:count
; Java calls to java.lang.Math are accepted
(. :java.lang.Math :min 2 3)
; Accessing system property 'java.class.path'
(system-prop :java.class.path)
; Accessing environment variable 'JAVA_HOME'
(system-env :JAVA_HOME)
; all Venice I/O functions are rejected
(io/exists-dir? (io/file "/tmp"))
; the Venice function 'count' is rejected
(count [1 2 3])