mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 04:58:50 +00:00
This fixes the `lenient` parameter to be `missingClasses`. I will remove this boolean and we can handle them via the normal whitelist. It also adds a check for sheisty classes (jar hell with the jdk). This is inspired by the lucene "sheisty" classes check, but it has false positives. This check is more evil, it validates every class file against the extension classloader as a resource, to see if it exists there. If so: jar hell. This jar hell is a problem for several reasons: 1. causes insanely-hard-to-debug problems (like bugs in forbidden-apis) 2. hides problems (like internal api access) 3. the code you think is executing, is not really executing 4. security permissions are not what you think they are 5. brings in unnecessary dependencies 6. its jar hell The more difficult problems are stuff like jython, where these classes are simply 'uberjared' directly in, so you cant just fix them by removing a bogus dependency. And there is a legit reason for them to do that, they want to support java 1.4.
47 lines
1.6 KiB
Groovy
47 lines
1.6 KiB
Groovy
/*
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
* license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
* not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
esplugin {
|
|
description 'Groovy scripting integration for Elasticsearch'
|
|
classname 'org.elasticsearch.script.groovy.GroovyPlugin'
|
|
}
|
|
|
|
dependencies {
|
|
compile 'org.codehaus.groovy:groovy-all:2.4.4:indy'
|
|
}
|
|
|
|
compileJava.options.compilerArgs << '-Xlint:-rawtypes,-unchecked,-cast,-deprecation'
|
|
compileTestJava.options.compilerArgs << '-Xlint:-rawtypes,-unchecked,-cast,-deprecation'
|
|
|
|
integTest {
|
|
cluster {
|
|
systemProperty 'es.script.inline', 'on'
|
|
systemProperty 'es.script.indexed', 'on'
|
|
}
|
|
}
|
|
|
|
// classes are missing, e.g. jline.console.completer.Completer
|
|
thirdPartyAudit.missingClasses = true
|
|
thirdPartyAudit.excludes = [
|
|
// uses internal java api: sun.misc.Unsafe
|
|
'groovy.json.internal.FastStringUtils',
|
|
'groovy.json.internal.FastStringUtils$StringImplementation$1',
|
|
'groovy.json.internal.FastStringUtils$StringImplementation$2',
|
|
]
|