Giter VIP home page Giter VIP logo

freedomofpress / securedrop Goto Github PK

View Code? Open in Web Editor NEW
3.6K 147.0 678.0 105.01 MB

GitHub repository for the SecureDrop whistleblower platform. Do not submit tips here!

Home Page: https://securedrop.org/

License: Other

Shell 4.80% Python 79.22% HTML 3.43% JavaScript 2.83% Makefile 1.22% Mako 0.02% Dockerfile 0.31% Jinja 1.85% CSS 5.37% Rust 0.94%
python securedrop journalism flask-application hacktoberfest

securedrop's Introduction

SecureDrop

There are many ways to contribute to SecureDrop, and we welcome your help! By contributing to this project, you agree to abide by our Code of Conduct.

CircleCI branch codecov Translation status Gitter

SecureDrop is an open-source whistleblower submission system that media organizations can use to securely accept documents from, and communicate with anonymous sources. It was originally created by the late Aaron Swartz and is currently managed by the Freedom of the Press Foundation.

Documentation

SecureDrop's end user documentation is hosted at https://docs.securedrop.org. It is maintained in a standalone repository: https://github.com/freedomofpress/securedrop-docs.

By default, the documentation describes the most recent SecureDrop release. This is known as the stable version and is recommended for end users (Sources, Journalists, or Administrators). The latest documentation is automatically built from the most recent commit to the SecureDrop documentation repository. It is most useful for developers and contributors to the project. You can switch between versions of the documentation by using the toolbar in the bottom left corner of the Read the Docs screen.

Developer documentation can be found at https://developers.securedrop.org/, maintained in https://github.com/freedomofpress/securedrop-dev-docs/.

Found an issue?

If you're here because you want to report an issue in SecureDrop, please observe the following protocol to do so responsibly:

How to Install SecureDrop

See the Installation Guide.

How to Use SecureDrop

How to Contribute to SecureDrop

See our contribution page.

Developer Quickstart

Ensure you have Docker installed and:

make dev

This will start the source interface on 127.0.0.1:8080 and the journalist interface on 127.0.0.1:8081. The credentials to login are printed in the Terminal. To login to the journalist interface, you must also generate a two-factor code.

License

SecureDrop is open source and released under the GNU Affero General Public License v3.

Wordlists

The wordlist we use to generate source passphrases come from various sources:

Acknowledgments

A huge thank you to all SecureDrop contributors! You can see just code and documentation contributors in the "Contributors" tab on GitHub, and you can see code, documentation and translation contributors together here. Thanks to our friends at PyUp for sponsoring a subscription to their Python security database.

securedrop's People

Contributors

aaronsw avatar ageis avatar cfm avatar conorsch avatar david415 avatar diracdeltas avatar dolanjs avatar drgfreeman avatar eaon avatar eloquence avatar emkll avatar garrettr avatar hainish avatar heartsucker avatar jacksingleton avatar kushaldas avatar legoktm avatar micahflee avatar msheiny avatar nabla-c0d3 avatar nathandyer avatar pierwill avatar prateekj117 avatar redshiftzero avatar rmol avatar rocodes avatar runasand avatar tmc avatar weblate avatar zenmonkeykstop 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  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

securedrop's Issues

Prevent automated submissions (CAPTCHA)

Changed name due to debate over whether CAPTCHA is right method to use. Consensus is on developing a responsive approach that combines several methods, including CAPTCHAs.

Add Unit and Integration Tests

If you want to contribute this would be a good place to start. Lots of people are suggesting pretty substantial changes to the codebase and tests would make sure those changes don't unintentionally break things.

When submitting documents there's a gnupg error

[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 239, in process
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     return self.handle()
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 230, in handle
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     return self._delegate(fn, self.fvars, args)
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 462, in _delegate
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     return handle_class(cls)
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 438, in handle_class
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     return tocall(*args)
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/source.py", line 57, in POST
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     crypto.encrypt(config.JOURNALIST_KEY, i.msg, loc1)
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/crypto.py", line 107, in encrypt
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1]     raise CryptoException(out.stderr)
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1] CryptoException: gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1] gpg: Sorry, no terminal at all requested - can't get input
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1] 
[Fri Oct 11 23:29:37 2013] [error] [client 127.0.0.1] 
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 239, in process
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     return self.handle()
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 230, in handle
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     return self._delegate(fn, self.fvars, args)
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 462, in _delegate
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     return handle_class(cls)
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/web/application.py", line 438, in handle_class
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     return tocall(*args)
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/source.py", line 57, in POST
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     crypto.encrypt(config.JOURNALIST_KEY, i.msg, loc1)
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]   File "/var/www/deaddrop/crypto.py", line 107, in encrypt
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1]     raise CryptoException(out.stderr)
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1] CryptoException: gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1] gpg: Sorry, no terminal at all requested - can't get input
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1] 
[Fri Oct 11 23:36:04 2013] [error] [client 127.0.0.1] 

Preserve git history

I was just having a look at some of the history of crypto.py trying to figure out the intentions of some changes when I noticed that the history only goes back a few days & the git logs for deaddrop have not been preserved. I was looking at a file called 'crypto.py' to understand some changes, when I noticed the log only goes back a few days. There is an old log message entitled "fix various security issues identified by security team" - aaronsw (76af29c)

It makes it easier for future devs to easily understand intentions of past contributors. This is especially important when the file is called 'crypto.py'

Use ECC rather than RSA?

NIST does not endorse RSA in new systems. They now favor ECC. GnuPG is not my first choice as a crypto primative but if it will be used, I think using a 521 bit ECC key pair is currently a reasonable idea.

Consider using scrypt instead of bcrypt

scrypt is another adaptive key stretching algorithm in the vein of bcrypt. Unlike bcrypt, however, it was specifically designed to thwart attacks by powerful adversaries capable of building large clusters of custom hardware for password cracking. Given securedrop's threat model, scrypt might a better choice than bcrypt; however, scrypt is significantly newer and comparatively less tested.

Add internet host to HSTS before serving up .onion

Any host that has a public name with HTTPS should be pinned or at the very least send HSTS headers. If possible, I'd suggest sending a request to the Chrome team to ship such a cert in a few browsers.

This should be done for the New Yorker site but also it should be a best practice.

OSSEC alerts reley on an organization's smtp server

OSSEC uses the email alerts to notify the journalist of file changes and other security alerts. The securedrop environment does not currently have an smtp server, so the organization that is implementing securedrop will need to provide access to smtp relay. This is a security weakness. An attacker could compromise the external email server to ensure that the journalist is not aware of un-authorized changes in the environment. Either an smtp server should be deployed in the securedrop environment or the ossec web ui http://www.ossec.net/wiki/index.php/OSSECWUI:Install could possibly be leveraged.

Collection links in journalist interface 404

Steps to reproduce:

  1. Set up according to instructions in HACKING.md
  2. As source, visit the site. "Submit Documents", "Continue". Enter a test message and "Submit".
  3. Visit the journalist site. Click the link of the new submission.

Expected behavior: Page contains a link to download the new submission

Actual behavior: 404, blank page with the text "not found"

Do not link or reference any external URLs in templates

In the source and journalist base templates, the footer contains a "Powered by DeadDrop" logo linking to http://deaddrop.github.com/. This will leak the source/journalist IP address in server logs by the HTTP request made to deaddrop.github.com (now deaddrop.github.io). We cannot trust GitHub to keep referer and access_logs private.

https://github.com/deaddrop/deaddrop/blob/master/source_templates/base.html#L27
https://github.com/deaddrop/deaddrop/blob/master/journalist_templates/base.html#L27

Design source interface to be branded with SecureDrop

When you first install SecureDrop, this is what the source Tor hidden service looks like. It shouldn't say Tip Box or DeadDrop anywhere, it should say SecureDrop.

source_server

Also, while we're at it, lets give it a white background with dark text, to make it seem friendly and less spycrafty.

Encryption of GnuPG messages should omit certain keying information

I'm skeptical of using GnuPG but if you're going to use it, I suggest you blind the messages such that the key ID is not embedded - this should at least ensure that a specific key may not be demanded by cryptographic identifier :

       --hidden-recipient name

       -R     Encrypt for user ID name, but hide the key  ID  of  this  user's
              key.  This  option helps to hide the receiver of the message and
              is a limited countermeasure against traffic  analysis.  If  this
              option  or --recipient is not specified, GnuPG asks for the user
              ID unless --default-recipient is given.

There are other reasons but the above seems sufficient to me.

Don't use a VPN

In the New Yorker diagram, it is suggested that the journalists will use a VPN - I suggest that you use a Tor hidden service, specifically, a stealth hidden service with authentication. This ensures that all required systems only touch the network with Tor - no need for other third party code and no need for higher privileges (eg: pppd, etc) when that code touches the network.

Add HACKING file

The current INSTALL file https://github.com/deaddrop/DeadDropDocs is heavy on crucial security steps for what to do if you plan on deploying deaddrop in production , light on details that can quickly get devs up and running and test improvements.

Looking at crypto.py, in order to generate a wordlist, crypto.py wants to import a module named config which contains a number of settings. Originally I thought this was python's config library, but now I think it seems likely there was a file called config.py at one stage. It's easy enough to get around but little hang-ups like this are what should be clarified in the HACKING file so time is saved.

Journalist interface should give sources better codenames

Right now journalists identify each source as a hash. It would be better if the source had a name. It would be fun to write a Python script that turns hashes into human-meaningful names (and keeps a store of names used already in order to avoid collisions).

Deploy HTTPS for all of New Yorker website

An attacker may MITM the original connection to the New Yorker website. As a result, the attacker may change the .onion URL in transit. An attacker is able to see that the submitter isn't reading the New Yorker and if they download the Tor Browser as their next action, I suspect the attacker may simply choose to break connections to the Tor website. This will stop a potential submission and it also presents the attacker with an opportunity to insert malware (at download time) to discover the documents under consideration for submission.

Do not use accurate time for file names

There is a vulnerability where the encrypted file is identified by time in the file name. This timing information is sensitive and if a journalist wishes to have such metadata, I suggest it should be encoded inside of the GnuPG message. However, I strongly caution that such accurate timing information is best to simply not collect and if it is required for some reason, discarding it is prudent.

The code in question is here:
https://github.com/deaddrop/deaddrop/blob/master/source.py#L62

Critical Security Concerns, System Vulnerabilities

A critical concern for the claims made for the deaddrop tool, is the central master server arrangement of the TOR system. TOR's main listing of available TOR entry nodes is provided from only one central entity and source. This central entity is tapped by most institutions, its routing is MIM and tampered by nation-state perimeters, even large cities and ISPs falsify the entry point listing for the TOR system.

As a result, any new client is forced to communicate first with the compromised and high-risk central listing of tor-nodes, meaning that the potential client is murdered before succeeding at getting the horrible interface clients installed or working correctly.

This has been a thoroughly documented and deadly situation for a decade, the system is designed to identify and isolate any initial contacts with the master system, resulting in the full compromise of the potential client with deadly potential.

As there is no guarantee of the integrity of any component of the TOR system, and more importantly that there is absolutely no trust in the communications between the client and the central master server, it brings further concern that all communications with the TOR master server or publicly listed NODE entry points are immediate wiretap orders.

In most cases, the AUTOMATIC wiretap order from (american) ISPs activate within about 4 seconds, meaning all traffic, including initial key shares, are trapped by the aggressor entity PRIOR the transfer of any "protected" data.

Yes, this prevents services providers like the new NYT project from having any coherent awareness of the source of content, but it provides a major deadly liability for the victim sources.

AT THE INSTANT ANY CLIENT ATTEMPTS TO COMMUNICATE WITH TORPROJECT, THEY ARE IMMEDIATELY BOUND TO A FISA AND OTHER INTERNATIONAL WIRETAPS.

The result of which, is a deadly serious violation of the public interest and human rights, and a very deadly resulting situation. Any client of the system is immediately victimize simply due to their initial contact with a central system, regardless of their intent.

This includes browser plugin repositories, all of the other TORProject tool sources.

It must be made clear that in no way does the deaddrop nor TOR system PROTECT the victim. It must be made clear that TOR is an explicit vulnerability in the transfer of public interest information. It must be made clear that to contact TORProject results in an IMMEDIATE intelligence-gathering wiretap, regardless of intent or content transferred. And it must be made clear that the entire TORProject publicly accessible system is provided by entities who know how to MIM and molest the data and content in the middle. If the TorProject code was fully valid in intent, it still is compromised of and by parties who emulate and exploit its perceived function.

Connecting to TORProject in many regions creates a deadly situation.

cc: US Department of State, Naval Research, other sponsors of TOR.

Keep source and journalist interfaces entirely separate

It seems that the general architecture is overly dangerous - I might be mistaken about how the New Yorker has deployed DeadDrop, so forgive me if I'm just totally missing a major part of the documentation...

Specifically, it seems that source.py and journalist.py should run on entirely different systems. There is no reason to run them on the same system. As an example, one could have two systems - both with a stealth hidden service - and with something like rsync, one side (source) could encrypt data, push it into a directory and then the remote (journalist) side pull it down. This would create two different kinds of compartmentalization: one is cryptographic (eg: source's file is encrypted), and the other is using the natural boundaries of the entire system, even though the web app is more constrained. This allows for bidirectional sharing of data in a privacy by design manner.

If you have such a design, it also ensures that when the source interface is compromised - it will not expose the journalists beyond the ability to mount better attacks on GnuPG. Such a compromise will of course allow the attacker to compromise sources in the future...

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.