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

Add Keepass Export #5

Closed
speatzle opened this issue Feb 2, 2022 · 2 comments
Closed

Add Keepass Export #5

speatzle opened this issue Feb 2, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@speatzle
Copy link
Collaborator

speatzle commented Feb 2, 2022

Add a sub-command to export Passwords to a Keepass file.

This is useful for automatic Passbolt backups of a selfhosted instance which might go offline but may contain passwords needed to fix the instance.

Potential Library: https://github.com/tobischo/gokeepasslib

@speatzle speatzle added the enhancement New feature or request label Feb 2, 2022
@speatzle speatzle self-assigned this Feb 2, 2022
@Cisien
Copy link

Cisien commented Dec 30, 2022

The current experimental implementation works well. Below is a short shell script to perform a backup and persist it as an Azure KeyVault secret if any of the secrets have been modified in the past day.

#!/bin/bash

if (( $(date -d "yesterday" +%s) < $(date -d $( passbolt list resource -c ModifiedTimestamp | sort | tail -2 | head -1) +%s ) ))
then
    echo "The last modified date is within the past day, running backup"
    az login --service-principal -u $APP_ID \
        -p ~/.azure/auth-cert.pem --tenant $TENANT --allow-no-subscriptions \
        -o none --only-show-errors

    rm ~/.passbolt/keepass-backup.kdbx 2&> /dev/null
    passbolt export keepass --file ~/.passbolt/keepass-backup.kdbx --password $PASS

    az keyvault secret set --vault $VAULT \
        --name $SECRET_NAME --encoding base64 \
        --file ~/.passbolt/keepass-backup.kdbx \
        -o none --only-show-errors
    rm ~/.passbolt/keepass-backup.kdbx 2&> /dev/null
fi

@speatzle
Copy link
Collaborator Author

The current Implementation Works Well enough and has had TOTP Support and Better Error Handling/Skipping Added in #43.

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants