keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.83k stars 1.44k forks source link

Import bitwarden json format #8367

Closed dnet890 closed 6 months ago

dnet890 commented 2 years ago

Summary

I use Bitwarden. But, when I export the csv and import it to keepassXC. the results are not good.

Examples

The current workaround is use Keepass2 and use it to export it to kdbx. But, it is not really straightforward

Context

it will be better if KeepassXC can import and export .json file natively. So, we don't need any kind of workaround like this.

droidmonkey commented 2 years ago

https://bitwarden.com/help/condition-bitwarden-import/#condition-a-json

FreeMinded commented 1 year ago

:+1: Would be great if it would support the Bitwarden encrypted json as well

fooness commented 1 year ago

Is this already being worked on?

Thank you very much for your efforts.

droidmonkey commented 1 year ago

Not yet but it's in my queue

woutable commented 1 year ago

+1 for this feature

Collabeta commented 1 year ago

Being able to confirm and possess a working backup, would give me more peace of mind than just an encrypted blob

FreeMinded commented 1 year ago

@Collabeta you can always choose to export an unencrypted json from Bitwarden. This feature request is about being able to import a json export (encrypted or not) into KeePassXC

Collabeta commented 1 year ago

@Collabeta you can always choose to export an unencrypted json from Bitwarden. This feature request is about being able to import a json export (encrypted or not) into KeePassXC

Thanks. Being able to import into KeePassXC is actually what I meant by having a working backup.

rLry commented 1 year ago

+1 for this feature

dumptyd commented 1 year ago

Bitwarden has started blocking access to vaults based on IP addresses to "mitigate DDOS attacks" and their systems seem to be flagging most IPs behind CG-NAT (that's millions [and millions] of IPs).

Without getting into how ridiculous that is, I think many people will be looking for an alternative in the coming days and weeks. That's what brought me here.

Would love to see this implemented. Thank you for all the work you guys do on this. :)


Few examples of what I'm talking about - https://old.reddit.com/r/Bitwarden/comments/11leqkw/blocked_from_accessing_my_passwords_because_of/ - https://old.reddit.com/r/Bitwarden/comments/10hvljb/error_7_unusual_traffic/ - https://old.reddit.com/r/Bitwarden/comments/11nddxc/locked_out_of_my_vault_traffic_from_your_network/ - https://old.reddit.com/r/Bitwarden/comments/10411yc/bitwarden_blocking_webvault_from_iphone_using/ - https://old.reddit.com/r/Bitwarden/comments/12au2u8/new_bitwarden_user_cant_login_traffic_from_your/ - https://old.reddit.com/r/Bitwarden/comments/117fxb5/traffic_from_your_network_looks_unusual_connect/ - https://old.reddit.com/r/Bitwarden/comments/110gpkt/traffic_from_your_network_looks_unusual_connect/ - https://old.reddit.com/r/Bitwarden/comments/119znv6/multiple_enterprise_users_traffic_from_your/ - https://old.reddit.com/r/Bitwarden/comments/12ft3b9/error_code_7/ - https://old.reddit.com/r/Bitwarden/comments/11jccna/i_am_unable_to_access_my_vault/ - https://old.reddit.com/r/Bitwarden/comments/125qnzo/help_what_is_error_7_and_how_do_i_resolve_this/ - https://old.reddit.com/r/Bitwarden/comments/126e6l1/bitwarden_login_fail/ - https://old.reddit.com/r/Bitwarden/comments/1209tbw/why_is_this_error_keeps_on_coming_while_i_am/ - https://old.reddit.com/r/Bitwarden/comments/11vplwv/network_error_on_web_login/ - https://old.reddit.com/r/Bitwarden/comments/zm3zo0/suddenly_getting_the_error_7_message_any_ideas/ - https://old.reddit.com/r/Bitwarden/comments/yd2dye/locked_out_due_to_ip_blocking_poor_security/ - https://old.reddit.com/r/Bitwarden/comments/ypemaj/what_happened_bit_i_got_error_code_6/ - https://old.reddit.com/r/Bitwarden/comments/y9f18f/locked_out_due_to_clumsy_ip_blocking_at_bitwarden/
droidmonkey commented 1 year ago

Yikes, no good. I wonder if ChatGPT can conjur up a quick python script to convert the JSON to CSV to at least get close.

dumptyd commented 1 year ago

According to their site,

this is the JSON format they use.

{
  "folders": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": "My Folder"
    }
  ],
  "items": [
    {
      "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa",
      "organizationId": null,
      "folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "type": 2,
      "name": "My Secure Note",
      "notes": "1st line of secure note\n2nd line of secure note\n3rd line of secure note",
      "favorite": false,
      "fields": [
        {
          "name": "Text Field",
          "value": "text-field-value",
          "type": 0
        },
        {
          "name": "Hidden Field",
          "value": "hidden-field-value",
          "type": 1
        },
        {
          "name": "Boolean Field",
          "value": "false",
          "type": 2
        }
      ],
      "secureNote": {
        "type": 0
      },
      "collectionIds": [
        null
      ]
    },
    {
      "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
      "organizationId": null,
      "folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "type": 3,
      "name": "Card Name",
      "notes": "1st line of note text\n2nd line of note text",
      "favorite": false,
      "fields": [
        {
          "name": "Text Field",
          "value": "text-field-value",
          "type": 0
        },
        {
          "name": "Hidden Field",
          "value": "hidden-field-value",
          "type": 1
        },
        {
          "name": "Boolean Field",
          "value": "false",
          "type": 2
        }
      ],
      "card": {
        "cardholderName": "Jane Doe",
        "brand": "Visa",
        "number": "1234567891011121",
        "expMonth": "10",
        "expYear": "2021",
        "code": "123"
      },
      "collectionIds": [
        null
      ]
    },
    {
      "id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
      "organizationId": null,
      "folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "type": 4,
      "name": "My Identity",
      "notes": "1st line of a note\n2nd line of a note",
      "favorite": false,
      "fields": [
        {
          "name": "Text Field",
          "value": "text-field-value",
          "type": 0
        },
        {
          "name": "Hidden Field",
          "value": "hidden-field-value",
          "type": 1
        },
        {
          "name": "Boolean Field",
          "value": "true",
          "type": 2
        }
      ],
      "identity": {
        "title": "Mrs",
        "firstName": "Jane",
        "middleName": "A",
        "lastName": "Doe",
        "address1": " 1 North Calle Cesar Chavez ",
        "address2": null,
        "address3": null,
        "city": "Santa Barbara",
        "state": "CA",
        "postalCode": "93103",
        "country": "United States ",
        "company": "My Employer",
        "email": "myemail@gmail.com",
        "phone": "123-123-1234",
        "ssn": "123-12-1234",
        "username": "myusername",
        "passportNumber": "123456789",
        "licenseNumber": "123456789"
      },
      "collectionIds": [
        null
      ]
    },
    {
      "id": "dddddddd-dddd-dddd-dddd-dddddddddddd",
      "organizationId": null,
      "folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "type": 1,
      "name": "Login Name",
      "notes": "1st line of note text\n2nd Line of note text",
      "favorite": false,
      "fields": [
        {
          "name": "Text Field",
          "value": "text-field-valie",
          "type": 0
        },
        {
          "name": "Hidden Field",
          "value": "hidden-field-value",
          "type": 1
        },
        {
          "name": "Boolean Field",
          "value": "true",
          "type": 2
        }
      ],
      "login": {
        "uris": [
          {
            "match": null,
            "uri": "https://mail.google.com"
          }
        ],
        "username": "myusername@gmail.com",
        "password": "mypassword",
        "totp": "otpauth://totp/my-secret-key"
      },
      "collectionIds": [
        null
      ]
    }
  ]
}

I think the hardest part is figuring out the corresponding concepts/keys in keepassxc. Writing the translator itself should be pretty easy.

droidmonkey commented 1 year ago

Check it out, you can use this for now: https://github.com/mfonner/json2csv

thelazyoxymoron commented 1 year ago

The json2csv script shared by mfonner didn't work for me, exported fields were not parsed correctly.

You can use this: https://github.com/thelazyoxymoron/bitwarden-to-keepassxc-converter

It parses logins, secure notes as well as card details from the bitwarden export.