Groovy Module (Platform)

Last modified by Vincent Massol on 2021/03/17 21:27

cogPlatform-specific Groovy Compilation Customizers
TypeJAR
Category
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Description

This module complements the Commons Groovy Module  by adding the following features:

  • A Secure Customizer allowing to run Groovy scripts in a Security Sandbox

Secure Customizer

At this point in time the Secure Customizer is pretty restrictive in what it allows. We'll loosen it as a progress to allow more and more safe operations to be performed.

Currently:

  • Prevents bytecode expressions and sequences
  • Prevents synchronized blocks
  • Prevents imports
  • Prevents method definition
  • Prevents any token

Examples

Forbidden:

  • synchronized(this) { }
  • System.exit(0)
  • "Hello World".value[0]

Allowed:

  • new Integer(6)

Prerequisites & Installation Instructions

No Groovy Customizers are defined by default.

To add a Compilation Customizer see Groovy Module (Commons).

More specifically to enable the Secure Customizer, add the following to xwiki.properties:

groovy.compilationCustomizers=secure

Get Connected