Class InMemoryClonedSecureSettings

java.lang.Object
org.elasticsearch.common.settings.InMemoryClonedSecureSettings

public class InMemoryClonedSecureSettings extends Object
  • Constructor Details

    • InMemoryClonedSecureSettings

      public InMemoryClonedSecureSettings()
  • Method Details

    • cloneSecureSettings

      public static SecureSettings cloneSecureSettings(Settings source, List<Setting<?>> settingsToClone) throws GeneralSecurityException
      Creates a cloned (detached) SecureSettings instance by copying selected secure settings from the provided Settings. The returned instance does not require the original SecureSettings to remain open and will always report as loaded.

      Only secure settings of type String are supported (file-based secure settings are not). The returned instance cannot be serialized. Also, attempting to close it will not have any effect.

      The cloned secure settings will remain in memory for the lifetime of the returned object. This bypasses the normal lifecycle of SecureSettings. Great care must be taken when using this method to avoid unintentionally retaining sensitive data in memory.

      Parameters:
      source - the Settings object with open/available SecureSettings
      settingsToClone - the list of secure settings definitions to copy if present
      Returns:
      a cloned SecureSettings containing only the selected settings if present
      Throws:
      GeneralSecurityException - if any secure setting cannot be accessed