Git Product home page Git Product logo

swordfish's Introduction

NOTE: This repository is no longer supported or updated by GitHub. If you wish to continue to develop this code yourself, we recommend you fork it.

Swordfish Build Status

Swordfish was an experiment in building a group-optimized password management app. It is unmaintained and is likely insecure.

Recommended Reading

Working on Swordfish

Use the bootstrap script to get the environment set up.

script/bootstrap

Now you will need to run the database migrations before you run the server.

bundle exec rake db:create db:migrate

Finally you can start the application.

script/rails s

Running the tests requires PhantomJS. If you're on Mac OS X you can use homebrew to install this for you.

brew install phantomjs

If you hack on Swordfish and end up adding or editing features you will want to run the tests.

bundle exec rake

Want to join the core team?

swordfish's People

Contributors

bkeepers avatar brianstorti avatar btoews avatar danielmorrison avatar danthompson avatar ejfinneran avatar ezkl avatar jbarnette avatar joeyw avatar jonrohan avatar jrsconfitto avatar kelvinst avatar kevinsawicki avatar sethvargo avatar shell avatar siong1987 avatar skalnik avatar soffes avatar spraints avatar themgt avatar tombell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swordfish's Issues

keypair is null in item collection after loading a key

I guess my key wasn't unlocked (just created it), but i added an item, and while it was prompting me to sign in, I saw this:

http://swordfish.dev/?title=Test&data.username=test&data.password=test#

And that of course hits the server, so most of it shows up in the logs:

Started GET "/?title=Test&data.username=test&data.password=[FILTERED]" for 127.0.0.1 at 2012-09-22 18:57:11 -0500 Processing by DashboardController#index as HTML Parameters: {"title"=>"Test", "data.username"=>"test", "data.password"=>"[FILTERED]"} Rendered dashboard/index.html.erb within layouts/application (0.1ms) Completed 200 OK in 42ms (Views: 40.3ms)

Add other types of items

Besides "logins", we should be able to easily store:

  • Accounts: logins to non-web things like servers, databases, desktop apps, etc.
  • Notes: any text
  • Software Licenses
  • Wallet items: credit cards, membership accounts, etc

Evaluate security of browser-based solution

I still think there are a lot of open questions about building a web-based solution. I'd like to create a space to discuss them.

  1. Is JavaScript cryptography secure enough?
  2. Is localStorage secure enough for storing the encrypted private key?
  3. Is there a way to securely store the passphrase or decrypted private key?

To clarify, by "secure enough" I mean: without crossing some boundary, could an attacker gain access to the data? If the server or client is compromised, there can be no expectation of security with any architecture.

Populate username/password field when autosaving

Autosaving currently saves the attributes without modification, so if a form uses something besides "username" and "password", then the details can't be viewed in the web interface.

We should inspect the submitted params and populate swordfish's username/password fields.

Authentication

A password manager isn't much use without user authentication.

Update existing item on change

If a login is already saved for a host, it would be awesome to prompt to update the existing one, or create a new login.

installation and setup?

Hi guys,

the tool seems really useful so I started with getting my ruby setup going on my Debian box,
the standard test application works (the one "rails testapplication" generates), but for some reason,
swordfish does not.

I actually was wondering if anybody got some pointers for me on how to setup this properly so I can start giving this tool a try out.

What I did so far:
I installed libapache2-mod-fcgid and libfcgi-ruby1.8
created an apache vhost
git cloned the repository into a folder and added this into public/.htaccess

# General Apache options
#AddHandler fastcgi-script .fcgi
#AddHandler cgi-script .cgi
AddHandler fcgid-script .fcgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
#   RewriteCond %{REQUEST_URI} ^/notrails.*
#   RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
#   Alias /myrailsapp /path/to/myrailsapp/public
#   RewriteBase /myrailsapp

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
#   ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

Has worked for the standard ruby app as said before, but not for this. Obviously I am missing something :)

Thanks for your help!

Design

I've got some code started (not all pushed at the moment), but step one is getting a workable design. I spent some time today working on a mockup. It's far from perfect, and still more to do (especially in the right pane), but it's a start.

mockup

Run JS specs via guard

I don't know how to write code without guard. I want the JS specs to run when js files or specs are saved.

The JS specs are currently run via evergreen, which is no longer maintained. I would love to migrate the specs to something that is maintained and better integrates with the Rails asset pipeline.

Can't Sign Out

When I click Sign Out

I see:

Routing Error

No route matches [GET] "/signout"

I'm guessing that this is a result of changes from #30.

Prompt to unlock on autofill

Hitting ⌘/ will autofill if the keypair is unlocked, but silently fails if it is locked. It should prompt to unlock.

Copy to clipboard

I would prefer to replace "reveal" with a "copy to clipboard" feature. Generally, you need a password so you can paste it somewhere else. There is rarely an instance where you want to see the password, and in that case you can just paste it somewhere else where it is readable.

I'm not sure what the current state is of the clipboard api in browsers, but it would be awesome if we could clear the copied password after a timeout, or at least after autolock. I'm guessing the clipboard APIs require some kind of user action (click, keyboard) to modify the clipboard, so worst case scenario, we should be able to copy a blank string to the clipboard on the next user action.

YubiKey Support

When logging into Swordfish having a one time password generated for every login could really help in security. You could take it even further and use it for two factor authentication as well.

For more information on YubiKey: http://www.yubico.com/products/yubikey-hardware/yubikey/

Are there extension points for third party authentication support? Is this something that the Swordfish community would be interested in?

Secure notes

Has there been any thought put towards supporting the storage of secure notes (i.e. freeform/arbitrary text content) in addition to storing authentication details? I’m not sure if we want to go down the line of having swordfish store all kinds of different special data types like some apps do (except credit card details maybe?), but maybe supporting a freeform text item type is worth thinking about?

Error when running rake - No such file or directory - phantomjs

Hi,

I checked out a copy of Swordfish, started up my local mongodb, then tried to run rake.

I got an error about:

/Users/victorhooi/.rbenv/versions/1.9.3-p194/bin/cucumber: No such file or directory - phantomjs --version
      undefined method `chomp' for nil:NilClass (NoMethodError)
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/client.rb:64:in `check_phantomjs_version'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/client.rb:26:in `start'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/client.rb:9:in `start'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/driver.rb:34:in `client'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/driver.rb:22:in `browser'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/poltergeist-0.7.0/lib/capybara/poltergeist/driver.rb:115:in `reset!'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/capybara-1.1.2/lib/capybara/session.rb:70:in `reset!'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `block in reset_sessions!'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `each'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `reset_sessions!'
      /Users/victorhooi/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/capybara-1.1.2/lib/capybara/cucumber.rb:10:in `After'

Failing Scenarios:
cucumber features/items.feature:3 # Scenario: creating and editing an item
cucumber features/key_generation.feature:3 # Scenario: Sign up and create new key
cucumber features/key_generation.feature:16 # Scenario: Successfully Unlocking key
cucumber features/key_generation.feature:24 # Scenario: Uploading key to sign in
cucumber features/key_generation.feature:33 # Scenario: Failing to unlock key
cucumber features/signout.feature:3 # Scenario: Sign out and lock key

6 scenarios (6 failed)
66 steps (6 failed, 60 skipped)
0m1.022s
rake aborted!
Command failed with status (1): [/Users/victorhooi/.rbenv/versions/1.9.3-p1...]

Tasks: TOP => default => cucumber => cucumber:ok
(See full trace by running task with --trace)

I've put the full trace in a Gist here:

https://gist.github.com/3843330

By the way - is there any way we could put quickstart or installation instructions somewhere in the Readme? It can be a bit confusing how to properly use this app, particularly those of us who aren't from the Ruby/Rails world? =)

Cheers,
Victor

Search

User can search for items across all vaults.

browser extensions

The true value of a good password management app is good browser integration. It should be able to automatically store new passwords and autofill existing passwords.

Is this project still active?

Hi,

Just checking - is this project still active?

It looked pretty awesome in the initial stages, it'd be a shame for Github to just let it die?

Cheers,
Victor

Autolock after timeout

Vault should autolock after a configured timeout.

Should the timeout be configured per vault or per user? I can see each user wanting that control, but for certain shared vaults the vault owner might want to determine that.

Autofill login details

When on a site that has a saved password, autofill the details with a keyboard shortcut or by clicking on the extension icon.

Look for synergies with Web Cryptography API

Realizing that Swordfish is playing in this domain, it seemed worth raising an issue to see if there's any future architectural planning that could come from having read this Web Cryptography API draft.

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Key storage is provided for both temporary and permanent keys. Access to keying material is contingent on the same origin policy. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

Upgrade to Rails 3.2.x

We were on 3.1.x due to incompatibilities with ToyStore, but now that we're on ActiveRecord, there's no reason we can't and shouldn't upgrade.

Toolbar icon

For the chrome extension we'll need a toolbar icon, which will be placed to the right of the address bar. It needs to look good on both dark and light backgrounds since users can (and often do) customize the theme.

See Chrome extension docs for more info.

Exception after loading a different key

If you already have a key set in localStorage, but go to #/key/load to load a different one, then stuff blows up:

Uncaught TypeError: Cannot call method 'decrypt' of undefined keypair.js:40
Keypair.Keypair.decrypt keypair.js:40
Item.Item.key item.js:30
Item.Item.data item.js:34
Item.Views.Show.Show.serialize show.js:31

Need to come up with a better way of passing the key around (or better yet, not passing it around and fetching it from a "global" whenever it's needed).

PKI

A shared per-vault password will work ok for minimal security, but ideally we should support some sort of PKI. Sharing a vault with another user would be a simple matter of storing the vault key encrypted with their public key.

Key escrow

It should be easier to use the app from multiple devices. To do that, we need an easy way to get the key on those devices. A few ideas:

  1. Implement a separate key store service that will save private keys. This should be completely separate from the central data store and ridiculously secure.
  2. Save the key to dropbox. This could even be as an HTML file, which has a big link to the app with the key as part of the hash, which could then be copied into localStorage
  3. Google Authenticator or something like it. I think this requires that the server has the key, so this probably isn't a great option if we want to keep the keys off the server.

Password generator

Implement a password generator that allows specifying some constraints, such as length, number of digits, and number of symbols, and shows the strength of the password.

invalid_credentials on github oauth login

It always gives invalid_credentials error when trying to login with github oauth login.

2012-08-28T05:22:58+00:00 app[web.1]: Started GET "/auth/failure?message=invalid_credentials&origin=https%3A%2F%2Fswordfish-v.herokuapp.com%2Fsignin&strategy=github" for 24.6.118.132 at 2012-08-28 05:22:58 +0000
2012-08-28T05:22:58+00:00 app[web.1]:   Processing by SessionsController#failure as HTML
2012-08-28T05:22:58+00:00 app[web.1]:   Parameters: {"message"=>"invalid_credentials", "origin"=>"https://swordfish-v.herokuapp.com/signin", "strategy"=>"github"}
2012-08-28T05:22:58+00:00 app[web.1]: Redirected to https://swordfish-v.herokuapp.com/signin

Show form fields in web interface

Autosave in the extension saves the value for all fields. They don't need to be viewable by default, but the web view for an item should have a way of viewing these, maybe in the edit view.

Why Mongo over *SQL? (Not trying to start a flame war)

This may sound trite, but I am curious why you chose to go with MongoDB as the store and not say, MySQL or PostgreSQL? I would think this would present a couple of issues:

  1. MongoDB, ignoring it's reputation, isn't exactly an easy database to maintain. Configuration, at least used to be, somewhat of a pain to get right in order to keep MongoDB from freaking out and losing it's data. Admittedly I have relatively little experience using it or maintaining it compared to *SQL but the little interaction I did have and from what I've learned from others using it, it can be finicky.
  2. The SQL's are well known, easy to manage and overall very stable. They represent less overhead for Ops (in general) due to their familiarity.
  3. MongoDB has a pretty terrible reputation, even if it is wrong (I don't have enough experience to say), it could affect adoption.

I was just surprised when I saw you were using MongoDB, I am curious to hear what your point of view is here if you have a minute. Definitely not critical.

Key Rollover

Would be great if the user interface surfaced "You need to change this password!" per a key rollover policy based on when the password information was added or last updated.

e.g. That would let you say for a Vault that passwords need to be changed annually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.