Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encypt using pbkdf2 algo #8

Merged
merged 4 commits into from
Jun 19, 2024
Merged

Conversation

sharathrnair87
Copy link
Collaborator

@sharathrnair87 sharathrnair87 commented Jun 1, 2024

██╗   ██╗ █████╗ ██╗   ██╗██╗  ████████╗██╗███████╗██╗   ██╗
██║   ██║██╔══██╗██║   ██║██║  ╚══██╔══╝██║██╔════╝╚██╗ ██╔╝
██║   ██║███████║██║   ██║██║     ██║   ██║█████╗   ╚████╔╝ 
╚██╗ ██╔╝██╔══██║██║   ██║██║     ██║   ██║██╔══╝    ╚██╔╝  
 ╚████╔╝ ██║  ██║╚██████╔╝███████╗██║   ██║██║        ██║   
  ╚═══╝  ╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝   ╚═╝╚═╝        ╚═╝   
                                                            

Description

With this we introduce the ability to encrypt the statefile before pushing it to vault.
The workflow is

  • Encryption
    .tfstate -> compress -> encrypt -> b64 encode

  • Decryption
    b64 decode -> decrypt -> uncompress -> .tfstate

  • Uses pbkdf2 encryption algorithm

  • Requires an environment variable named VAULTIFY_PASSPHRASE containing the passphrase to use for the encryption process


How has this been tested?

  • Publish
    image

  • Retrieve
    image

  • Wrap
    image

    • contents of wrapped file - Base64 encoded (truncated)
      image
      • Salt highlighted
        image

cmd/compare.go Outdated Show resolved Hide resolved
Copy link
Owner

@DFW1N DFW1N left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@DFW1N DFW1N merged commit 7f12cc4 into DFW1N:main Jun 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants