Class EncryptedSecretConfig

java.lang.Object
com.scivicslab.actoriac.EncryptedSecretConfig

public class EncryptedSecretConfig extends Object
Parser for encrypted secret configuration files.

This class reads an encrypted INI-format file containing secrets (SSH keys, passphrases, sudo passwords), decrypts it, and provides access to the secrets with host/group/global priority.

File Format (before encryption)

[secrets:all]
ssh_key=-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNz...
ssh_passphrase=MyPassphrase123
sudo_password=MySudoPassword

[secrets:webservers]
sudo_password=WebServerSudoPassword

[secrets:host:web1.example.com]
ssh_key=...different key...

Usage Example

InputStream encryptedInput = new FileInputStream("secrets.enc");
String key = System.getenv("ACTOR_IAC_SECRET_KEY");
EncryptedSecretConfig config = EncryptedSecretConfig.parse(encryptedInput, key);

Map<String, String> secrets = config.getSecretsForHost("web1.example.com", "webservers");
String sshKey = secrets.get("ssh_key");
String passphrase = secrets.get("ssh_passphrase");
Author:
devteam@scivics-lab.com