public class SafeXMLConfiguration
extends org.apache.commons.configuration2.XMLConfiguration
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
SafeXMLConfiguration.XMLReader |
| Modifier and Type | Field and Description |
|---|---|
private static String |
ALLOW_EXTERNAL_DTD |
private static String |
ALLOW_EXTERNAL_GENERAL_ENTITIES |
private static String |
ALLOW_EXTERNAL_PARAM_ENTITIES |
private static String |
DISALLOW_DOCTYPES |
private static String |
JAXP_SCHEMA_LANGUAGE |
private static String |
W3C_XML_SCHEMA |
private static String |
XXE_ERROR_MESSAGE |
| Constructor and Description |
|---|
SafeXMLConfiguration() |
SafeXMLConfiguration(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> c) |
| Modifier and Type | Method and Description |
|---|---|
DocumentBuilder |
createDocumentBuilder()
This overridden createDocumentBuilder() method sets the appropriate factory attributes to disable XXE parsing.
|
private void |
delegateRead(SafeXMLConfiguration.XMLReader superRead) |
void |
initFileLocator(org.apache.commons.configuration2.io.FileLocator loc) |
private boolean |
isXXERelatedException(org.apache.commons.configuration2.ex.ConfigurationException e)
Determine if the ConfigurationException was thrown because the XML configuration file contains an external entity (XXE).
|
void |
read(InputStream in) |
void |
read(Reader in) |
createTransformer, getDocument, getDocumentBuilder, getEntityResolver, getPublicID, getRootElementNameInternal, getSystemID, isSchemaValidation, isValidating, setDocumentBuilder, setEntityResolver, setPublicID, setRootElementName, setSchemaValidation, setSystemID, setValidating, validate, writechildConfigurationsAt, childConfigurationsAt, cloneNodeModel, configurationAt, configurationAt, configurationsAt, configurationsAt, createSubConfigurationForTrackedNode, getNodeModel, getSubConfigurationNodeSelector, getSubConfigurationParentModel, immutableChildConfigurationsAt, immutableConfigurationAt, immutableConfigurationAt, immutableConfigurationsAt, initSubConfigurationForThisParent, interpolatedConfiguration, subnodeConfigurationChanged, subsetaddNodes, addNodesInternal, addPropertyDirect, addPropertyInternal, clearInternal, clearPropertyDirect, clearTree, clearTreeInternal, clone, containsKeyInternal, fetchNodeList, getExpressionEngine, getKeysInternal, getKeysInternal, getMaxIndex, getMaxIndexInternal, getModel, getPropertyInternal, getRootElementName, isEmptyInternal, nodeDefined, nodeKey, resolveAddKey, resolveKey, resolveNodeKey, resolveUpdateKey, setExpressionEngine, setPropertyInternal, sizeInternal, toStringaddErrorLogListener, addProperty, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, containsKey, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setSynchronizer, setThrowExceptionOnMissing, size, unlockaddEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEventsequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddProperty, clear, clearProperty, getInterpolator, installInterpolator, setInterpolator, setProperty, subsetcontainsKey, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getList, getList, getLong, getLong, getLong, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, immutableSubset, isEmpty, sizeprivate static final String JAXP_SCHEMA_LANGUAGE
private static final String W3C_XML_SCHEMA
private static final String DISALLOW_DOCTYPES
private static final String ALLOW_EXTERNAL_GENERAL_ENTITIES
private static final String ALLOW_EXTERNAL_PARAM_ENTITIES
private static final String ALLOW_EXTERNAL_DTD
private static final String XXE_ERROR_MESSAGE
public SafeXMLConfiguration()
public SafeXMLConfiguration(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> c)
public void initFileLocator(org.apache.commons.configuration2.io.FileLocator loc)
initFileLocator in interface org.apache.commons.configuration2.io.FileLocatorAwareinitFileLocator in class org.apache.commons.configuration2.XMLConfigurationpublic DocumentBuilder createDocumentBuilder() throws ParserConfigurationException
createDocumentBuilder in class org.apache.commons.configuration2.XMLConfigurationParserConfigurationException - A configuration errorpublic void read(Reader in) throws org.apache.commons.configuration2.ex.ConfigurationException, IOException
read in interface org.apache.commons.configuration2.io.FileBasedread in class org.apache.commons.configuration2.XMLConfigurationorg.apache.commons.configuration2.ex.ConfigurationExceptionIOExceptionpublic void read(InputStream in) throws org.apache.commons.configuration2.ex.ConfigurationException, IOException
read in interface org.apache.commons.configuration2.io.InputStreamSupportread in class org.apache.commons.configuration2.XMLConfigurationorg.apache.commons.configuration2.ex.ConfigurationExceptionIOExceptionprivate void delegateRead(SafeXMLConfiguration.XMLReader superRead) throws org.apache.commons.configuration2.ex.ConfigurationException, IOException
org.apache.commons.configuration2.ex.ConfigurationExceptionIOExceptionprivate boolean isXXERelatedException(org.apache.commons.configuration2.ex.ConfigurationException e)
e - A ConfigurationException that was thrown when parsing the XML configuration file.Copyright © 2019 Apache NiFi Project. All rights reserved.