public interface SecurityConfiguration extends EsapiPropertyLoader
SecurityConfiguration
interface stores all configuration information
that directs the behavior of the ESAPI implementation.
Modifier and Type | Interface and Description |
---|---|
static class |
SecurityConfiguration.Threshold
Models a simple threshold as a count and an interval, along with a set of actions to take if
the threshold is exceeded.
|
Modifier and Type | Method and Description |
---|---|
String |
getAccessControlImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
List<String> |
getAdditionalAllowedCipherModes()
Return
List of strings of additional cipher modes that are
permitted (i.e., in addition to those returned by
getCombinedCipherModes() ) to be used for encryption and
decryption operations. |
List<String> |
getAllowedExecutables()
Gets the allowed executables to run with the Executor.
|
List<String> |
getAllowedFileExtensions()
Gets the allowed file extensions for files that are uploaded to this application.
|
int |
getAllowedFileUploadSize()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
int |
getAllowedLoginAttempts()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
boolean |
getAllowMixedEncoding()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getAllowMultipleEncoding()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
String |
getApplicationName()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getAuthenticationImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getCharacterEncoding()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getCipherTransformation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
List<String> |
getCombinedCipherModes()
Return a
List of strings of combined cipher modes that support
both confidentiality and authenticity. |
List<String> |
getDefaultCanonicalizationCodecs()
Returns the List of Codecs to use when canonicalizing data
|
String |
getDigitalSignatureAlgorithm()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
int |
getDigitalSignatureKeyLength()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
boolean |
getDisableIntrusionDetection()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
String |
getEncoderImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getEncryptionAlgorithm()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getEncryptionImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
int |
getEncryptionKeyLength()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
String |
getExecutorImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
boolean |
getForceHttpOnlyCookies()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getForceHttpOnlySession()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getForceSecureCookies()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getForceSecureSession()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
String |
getHashAlgorithm()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
int |
getHashIterations()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
String |
getHttpSessionIdName()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getHTTPUtilitiesImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getIntrusionDetectionImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getIVType()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
This method will be removed in a future release as it is now moot since
it can only legitimately have the single value of "random".
|
String |
getKDFPseudoRandomFunction()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
boolean |
getLenientDatesAccepted()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getLogApplicationName()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
boolean |
getLogEncodingRequired()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
String |
getLogImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
boolean |
getLogServerIP()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
byte[] |
getMasterKey()
Deprecated.
Use SecurityConfiguration.getByteArrayProp("appropriate_esapi_prop_name") instead.
|
byte[] |
getMasterSalt()
Deprecated.
Use SecurityConfiguration.getByteArrayProp("appropriate_esapi_prop_name") instead.
|
int |
getMaxHttpHeaderSize()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
int |
getMaxOldPasswordHashes()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
String |
getPasswordParameterName()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getPreferredJCEProvider()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
SecurityConfiguration.Threshold |
getQuota(String eventName)
Gets the intrusion detection quota for the specified event.
|
String |
getRandomAlgorithm()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getRandomizerImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
long |
getRememberTokenDuration()
Gets the length of the time to live window for remember me tokens (in milliseconds).
|
File |
getResourceFile(String filename)
Gets a file from the resource directory
|
InputStream |
getResourceStream(String filename)
Gets an InputStream to a file in the resource directory
|
String |
getResponseContentType()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
int |
getSessionAbsoluteTimeoutLength()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
int |
getSessionIdleTimeoutLength()
Deprecated.
Use SecurityConfiguration.getIntProp("appropriate_esapi_prop_name") instead.
|
File |
getUploadDirectory()
Retrieves the upload directory as specified in the ESAPI.properties file.
|
File |
getUploadTempDirectory()
Retrieves the temp directory to use when uploading files, as specified in ESAPI.properties.
|
String |
getUsernameParameterName()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
String |
getValidationImplementation()
Deprecated.
Use SecurityConfiguration.getStringProp("appropriate_esapi_prop_name") instead.
|
Pattern |
getValidationPattern(String typeName)
Returns the validation pattern for a particular type
|
File |
getWorkingDirectory()
Returns the default working directory for executing native processes with Runtime.exec().
|
boolean |
overwritePlainText()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
String |
setCipherTransformation(String cipherXform)
Deprecated.
To be replaced by new class in ESAPI 2.1, but here if you need it
until then. Details of replacement forthcoming to ESAPI-Dev
list. Most likely to be replaced by a new CTOR for
JavaEncryptor that takes a list of properties to override.
|
void |
setResourceDirectory(String dir)
Sets the ESAPI resource directory.
|
boolean |
useMACforCipherText()
Deprecated.
Use SecurityConfiguration.getBooleanProp("appropriate_esapi_prop_name") instead.
|
getBooleanProp, getByteArrayProp, getIntProp, getStringProp
@Deprecated String getApplicationName()
@Deprecated String getLogImplementation()
@Deprecated String getAuthenticationImplementation()
@Deprecated String getEncoderImplementation()
@Deprecated String getAccessControlImplementation()
@Deprecated String getIntrusionDetectionImplementation()
@Deprecated String getRandomizerImplementation()
@Deprecated String getEncryptionImplementation()
@Deprecated String getValidationImplementation()
Pattern getValidationPattern(String typeName)
typeName
- @Deprecated boolean getLenientDatesAccepted()
Validator.AcceptLenientDates
, which defaults to false
if unset.DateFormat.setLenient(boolean)
@Deprecated String getExecutorImplementation()
@Deprecated String getHTTPUtilitiesImplementation()
@Deprecated byte[] getMasterKey()
File getUploadDirectory()
File getUploadTempDirectory()
@Deprecated int getEncryptionKeyLength()
@Deprecated byte[] getMasterSalt()
List<String> getAllowedExecutables()
List<String> getAllowedFileExtensions()
@Deprecated int getAllowedFileUploadSize()
@Deprecated String getPasswordParameterName()
@Deprecated String getUsernameParameterName()
@Deprecated String getEncryptionAlgorithm()
@Deprecated String getCipherTransformation()
String
that takes the following form:
cipher_alg/cipher_mode[bits]/padding_schemewhere cipher_alg is the JCE cipher algorithm (e.g., "DESede"), cipher_mode is the cipher mode (e.g., "CBC", "CFB", "CTR", etc.), and padding_scheme is the cipher padding scheme (e.g., "NONE" for no padding, "PKCS5Padding" for PKCS#5 padding, etc.) and where [bits] is an optional bit size that applies to certain cipher modes such as
CFB
and OFB
. Using modes such as CFB and
OFB, block ciphers can encrypt data in units smaller than the cipher's
actual block size. When requesting such a mode, you may optionally
specify the number of bits to be processed at a time. This generally must
be an integral multiple of 8-bits so that it can specify a whole number
of octets.
Examples are:
"AES/ECB/NoPadding" // Default for ESAPI Java 1.4 (insecure) "AES/CBC/PKCS5Padding" // Default for ESAPI Java 2.0 "DESede/OFB32/PKCS5Padding"NOTE: Occasionally, in cryptographic literature, you may also see the key size (in bits) specified after the cipher algorithm in the cipher transformation. Generally, this is done to account for cipher algorithms that have variable key sizes. The Blowfish cipher for example supports key sizes from 32 to 448 bits. So for Blowfish, you might see a cipher transformation something like this:
"Blowfish-192/CFB8/PKCS5Padding"in the cryptographic literature. It should be noted that the Java Cryptography Extensions (JCE) do not generally support this (at least not the reference JCE implementation of "SunJCE"), and therefore it should be avoided.
@Deprecated String setCipherTransformation(String cipherXform)
ESAPI.properties
file. For instance
you may normally want to use AES/CBC/PKCS5Padding, but have some legacy
encryption where you have ciphertext that was encrypted using 3DES.cipherXform
- The new cipher transformation. See
getCipherTransformation()
for format. If
null
is passed as the parameter, the cipher
transformation will be set to the the default taken
from the property Encryptor.CipherTransformation
in the ESAPI.properties
file. BEWARE:
there is NO sanity checking here (other than
the empty string, and then, only if Java assertions are
enabled), so if you set this wrong, you will not get
any errors until you later try to use it to encrypt
or decrypt data.@Deprecated String getPreferredJCEProvider()
Encryptor.PreferredJCEProvider
in the
ESAPI.properties
file, which will cause the specified JCE
provider to be automatically and dynamically loaded (assuming that
SecurityManager
permissions allow) as the Ii>preferred
JCE provider. (Note this only happens if the JCE provider is not already
loaded.) This method returns the property Encryptor.PreferredJCEProvider
.
By default, this Encryptor.PreferredJCEProvider
property is set
to an empty string, which means that the preferred JCE provider is not
changed.Encryptor.PreferredJCEProvider
is returned.SecurityProviderLoader
@Deprecated boolean useMACforCipherText()
CipherText
should be used with a Message
Authentication Code (MAC). Generally this makes for a more robust cryptographic
scheme, but there are some minor performance implications. Controlled by
the ESAPI property Encryptor.CipherText.useMAC.
For further details, see the "Advanced Usage" section of "Why Is OWASP Changing ESAPI Encryption?".
true
if a you want a MAC to be used, otherwise false
.@Deprecated boolean overwritePlainText()
PlainText
objects may be overwritten after
they have been encrypted. Generally this is a good idea, especially if
your VM is shared by multiple applications (e.g., multiple applications
running in the same J2EE container) or if there is a possibility that
your VM may leave a core dump (say because it is running non-native
Java code.
Controlled by the property Encryptor.PlainText.overwrite
in
the ESAPI.properties
file.
PlainText
objects
after encrypting, false otherwise.@Deprecated String getIVType()
fixed
for the property
Encryptor.ChooseIVMethod
will now result in a ConfigurationException
being thrown.ConfigurationException
being thrown.List<String> getCombinedCipherModes()
List
of strings of combined cipher modes that support
both confidentiality and authenticity. These would be preferred
cipher modes to use if your JCE provider supports them. If such a
cipher mode is used, no explicit separate MAC is calculated as part of
the CipherText
object upon encryption nor is any attempt made
to verify the same on decryption.
The list is taken from the comma-separated list of cipher modes specified
by the ESAPI property
Encryptor.cipher_modes.combined_modes
.
ESAPI.properties
; otherwise the empty list is
returned.List<String> getAdditionalAllowedCipherModes()
List
of strings of additional cipher modes that are
permitted (i.e., in addition to those returned by
getCombinedCipherModes()
) to be used for encryption and
decryption operations.
The list is taken from the comma-separated list of cipher modes specified
by the ESAPI property
Encryptor.cipher_modes.additional_allowed
.
ESAPI.properties
; otherwise the empty list is
returned.getCombinedCipherModes()
@Deprecated String getHashAlgorithm()
@Deprecated int getHashIterations()
@Deprecated String getKDFPseudoRandomFunction()
@Deprecated String getCharacterEncoding()
@Deprecated boolean getAllowMultipleEncoding()
@Deprecated boolean getAllowMixedEncoding()
List<String> getDefaultCanonicalizationCodecs()
@Deprecated String getDigitalSignatureAlgorithm()
@Deprecated int getDigitalSignatureKeyLength()
@Deprecated String getRandomAlgorithm()
@Deprecated int getAllowedLoginAttempts()
@Deprecated int getMaxOldPasswordHashes()
@Deprecated boolean getDisableIntrusionDetection()
SecurityConfiguration.Threshold getQuota(String eventName)
eventName
- the name of the event whose quota is desiredFile getResourceFile(String filename)
filename
- The file name resource.File
object representing the specified file name or null if not found.@Deprecated boolean getForceHttpOnlySession()
@Deprecated boolean getForceSecureSession()
@Deprecated boolean getForceHttpOnlyCookies()
@Deprecated boolean getForceSecureCookies()
@Deprecated int getMaxHttpHeaderSize()
InputStream getResourceStream(String filename) throws IOException
filename
- A file name in the resource directory.InputStream
to the specified file name in the resource directory.IOException
- If the specified file name cannot be found or opened for reading.void setResourceDirectory(String dir)
dir
- The location of the resource directory.@Deprecated String getResponseContentType()
@Deprecated String getHttpSessionIdName()
long getRememberTokenDuration()
@Deprecated int getSessionIdleTimeoutLength()
@Deprecated int getSessionAbsoluteTimeoutLength()
@Deprecated boolean getLogEncodingRequired()
@Deprecated boolean getLogApplicationName()
@Deprecated boolean getLogServerIP()
File getWorkingDirectory()
Copyright © 2024 The Open Worldwide Application Security Project (OWASP). All rights reserved.