All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.helidon.security.tools.config.ConfigProperties Maven / Gradle / Ivy

Go to download

Configuration filter checking property values and decrypting them if needed. Also provides tools to encrypt values to store them in config files.

There is a newer version: 0.10.6
Show newest version
/*
 * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
 *
 * Licensed 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.
 */

package io.helidon.security.tools.config;

/**
 * Properties and their default values.
 */
public final class ConfigProperties {

    /**
     * Environment variable to set master password ({@value}).
     */
    public static final String MASTER_PASSWORD_ENV_VARIABLE = "SECURE_CONFIG_AES_MASTER_PWD";

    /**
     * Configuration property key to set master password ({@value}).
     */
    public static final String MASTER_PASSWORD_CONFIG_KEY = "security.config.aes.insecure-passphrase";

    /**
     * Environment variable to set location of private key ({@value}) keystore.
     * Absolute path or path relative to working directory.
     */
    public static final String PRIVATE_KEYSTORE_PATH_ENV_VARIABLE = "SECURE_CONFIG_RSA_PRIVATE_KEY";

    /**
     * Environment variable to set location of private key ({@value}) PEM file.
     */
    public static final String PRIVATE_KEY_PEM_PATH_ENV_VARIABLE = "SECURE_CONFIG_RSA_PEM_KEY";

    /**
     * Environment variable to set whether to require encryption of secrets or not ({@value}).
     * If set to true, an exception will be thrown in the following cases:
     * 
    *
  • Password is stored in clear text
  • *
  • Master password is stored in configuration
  • *
*/ public static final String REQUIRE_ENCRYPTION_ENV_VARIABLE = "SECURE_CONFIG_REQUIRE_ENCRYPTION"; /** * Environment variable to set key type to use. * Allowed values: *
    *
  • RSA - default value, unix-like non-encrypted private key
  • *
  • PKCS12 - keystore, password protected store and/or private key
  • *
*/ public static final String PRIVATE_KEYSTORE_TYPE_ENV_VARIABLE = "SECURE_CONFIG_PRIVATE_KEY_TYPE"; /** * Environment variable to set private key alias within a keystore. */ public static final String PRIVATE_KEY_ALIAS_ENV_VARIABLE = "SECURE_CONFIG_PRIVATE_KEY_ALIAS"; /** * Environment variable to set pass phrase for keystore. */ public static final String PRIVATE_KEYSTORE_PASS_ENV_VARIABLE = "SECURE_CONFIG_PRIVATE_KEYSTORE_PASSPHRASE"; /** * Environment variable to set pass phrase for private key. */ public static final String PRIVATE_KEY_PASS_ENV_VARIABLE = "SECURE_CONFIG_PRIVATE_KEY_PASSPHRASE"; /** * Configuration key to set * whether to require encryption of secrets or not ({@value}). * If set to true, an exception will be thrown in the following cases: *
    *
  • Password is stored in clear text
  • *
  • Master password is stored in configuration
  • *
*/ public static final String REQUIRE_ENCRYPTION_CONFIG_KEY = "security.config.require-encryption"; private ConfigProperties() { throw new IllegalStateException("Utility class"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy