pykeepass icon indicating copy to clipboard operation
pykeepass copied to clipboard

Support for SSH Agent Settings

Open mxcd opened this issue 5 years ago • 1 comments

As of now it is not possible to programmatically edit the SSH Agent settings and e.g. make an attachment a SSH Key

image

mxcd avatar Mar 16 '20 02:03 mxcd

I've not used KeeAgent before, but I did some poking and the information is stored as an attachment on the Entry.

In [49]: e                                                                                                          
Out[49]: Entry: "goobar_entry (None)"

In [50]: settings = etree.fromstring(kp.find_attachments(element=e, filename='KeeAgent.settings', recursive=False, f
    ...: irst=True).data)                                                                                           

In [51]: print(etree.tostring(settings).decode('utf8'))                                                             
<EntrySettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <AllowUseOfSshKey>false</AllowUseOfSshKey>
  <AddAtDatabaseOpen>false</AddAtDatabaseOpen>
  <RemoveAtDatabaseClose>false</RemoveAtDatabaseClose>
  <UseConfirmConstraintWhenAdding>false</UseConfirmConstraintWhenAdding>
  <UseLifetimeConstraintWhenAdding>false</UseLifetimeConstraintWhenAdding>
  <LifetimeConstraintDuration>600</LifetimeConstraintDuration>
  <Location>
    <SelectedType>attachment</SelectedType>
    <AttachmentName>remarkable</AttachmentName>
    <SaveAttachmentToTempFile>false</SaveAttachmentToTempFile>
    <FileName>/home/evan/.ssh/remarkable</FileName>
  </Location>
</EntrySettings>

This isn't part of the KeePass spec, so there needs to be some discussion on how we would break this into api.

Evidlo avatar Apr 26 '20 23:04 Evidlo