Menu

Can I automatically save an attachment at unlock / delete it at lock

Help
pryrt
2021-11-26
2021-11-27
  • pryrt

    pryrt - 2021-11-26

    When I unlock my database, I'd like to be able to save an attached file from a particular KeePass entry to a particular location on my local drive... then delete that file when the database is locked or closed so that it's not available when my database is locked (some tools need secrets in files, but I only want that available when I've got my database unlocked).

    I thought I remembered something like that in the past, but after a few days of searching documentation, I cannot find a way to do it (or remember the situation/search that allowed me to think it existed in the past).

    I had hoped there was a Trigger with action setup: I can see a Trigger for opened database, but none for closed; and I cannot see an action that saves attachments.

    Or, if not that, is there an existing plugin that does that? (Or can such a thing be done in the KPScript scripting plugin? if so, any hints as to which commands I should start researching?)

    (originally asked on superuser before I found this help forum)

     
  • wellread1

    wellread1 - 2021-11-26

    Attachments can't be selectively extracted automatically from KeePass using a trigger or, to my knowledge a KeePass plugin. However, an entry containing an attachment can be tagged to facilitate selection using the Show entries by tag: trigger action or the Find>tag menu item. KPEnhancedEntryView plugin can drag and drop attachments, otherwise attachments can be saved using Entry>Save Attached File(s) To... menu item or the Edit Entry dialog.

    A trigger based on one of the closing database file... events can delete a file using Execute command line/URL action.

    See the KeePass Trigger documentation for information about trigger events, conditions and actions. KPS Script files can do everything that KeePass can do on condition that "You need to have heavy experience in C# programming and the KeePass 2.x internals."

     
  • Paul

    Paul - 2021-11-27

    If you keep the attachment in a separate encrypted self extracting file via 7zip, you can get KeePass to supply the password to decrypt with a trigger.

    cheers, Paul

     
  • pryrt

    pryrt - 2021-11-27

    Great idea. I was so focused on my idea of storing the file in KeePass that I wasn't trying to find other implementations.. That will accomplish my actual goal.

    Thanks

     

Log in to post a comment.