Giter Club home page Giter Club logo

guardianproject / haven Goto Github PK

View Code? Open in Web Editor NEW
6.6K 277.0 729.0 23.82 MB

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors

Home Page: https://guardianproject.github.io/haven/

License: GNU General Public License v3.0

Java 86.68% HTML 0.66% Kotlin 12.24% Shell 0.29% Python 0.14%
sensor device-sensors monitoring-service prototype-android-application android

haven's Introduction

Build Status

About Haven

Haven is for people who need a way to protect their personal areas and possessions without compromising their privacy. It is an Android application that leverages on-device sensors to provide monitoring and protection of physical areas. Haven turns any Android phone into a motion, sound, vibration and light detector, watching for unexpected guests and unwanted intruders. We designed Haven for investigative journalists, human rights defenders and people at risk of forced disappearance to create a new kind of herd immunity. By combining the array of sensors found in any smartphone, with the world's most secure communications technologies, like Signal and Tor, Haven prevents the worst kind of people from silencing citizens without getting caught in the act.

View our full Haven App Overview presentation for more about the origins and goals of the project.

Announcement and Public Beta

We are announcing Haven today, as an open-source project, along with a public beta release of the app. We are looking for contributors who understand that physical security is as important as digital, and who have an understanding and compassion for the kind of threats faced by the users and communities we want to support. We also think it is cool, cutting-edge and making use of encrypted messaging and onion routing in whole new ways. We believe Haven points the way to a more sophisticated approach to securing communication within networks of things and home automation system.

Learn more about the story of this project at the links below:

Project Team

Haven was developed through a collaboration between Freedom of the Press Foundation and Guardian Project. Prototype funding was generously provided by FPF, and donations to support continuing work can be contributed through their site: https://freedom.press/donate-support-haven-open-source-project/

Freedom of the Press Foundation Guardian Project

Safety through Sensors

Haven only records when triggered by sound and motion and stores everything locally on the device. You can position the device's camera to capture visible motion or place your phone somewhere discreet to listen for noises. Receive secure notifications of intrusion events instantly or access logs remotely later.

The following sensors are monitored for a measurable change, and then recorded to an event log on the device:

  • Accelerometer: phone's motion and vibration
  • Camera: motion in the phone's visible surroundings from front or back camera
  • Microphone: noises in the environment
  • Light: change in light from ambient light sensor
  • Power: detect device being unplugged or power loss

Building

The application can be built using Android Studio and Gradle. It relies on a number of third-party dependencies, all of which are free, open-source, and listed at the end of this document.

Install

You can currently get the Haven BETA release in one of three ways:

or add this repository manually in F-Droid's Settings->Repositories: https://guardianproject.github.io/haven-nightly/fdroid/repo/

You can, of course, build the app yourself, from source.

If you are an Android developer, you can learn more about how you can make use of F-Droid in your development workflow, for nightly builds, testing, reproducibility and more here: F-Droid Documentation

Why no iPhone Support?

While we hope to support a version of Haven that runs directly on iOS devices in the future, iPhone users can still benefit from Haven today. You can purchase an inexpensive Android phone for less than $100 and use it as your "Haven Device"; leaving it behind whilst you keep your iPhone on you. If you run Signal on your iPhone you can configure Haven on Android to send encrypted notifications, with photos and audio, directly to you. If you enable the "Tor Onion Service" feature in Haven (requires installation of "Orbot" app as well) you can remotely access all Haven log data from your iPhone using the Onion Browser app.

So, no, iPhone users we didn't forget about you and we hope you will pick up an inexpensive Android burner today!

Usage

Haven is meant to provide a smooth onboarding experience that walks users through configuring the sensors on their device to best detect intrusions into their environment. The current implementation has some of this implemented, but we are looking to improve this user experience dramatically.

Main view

The application's main view allows the user to select which sensors to use along with their corresponding levels of sensitivity. A security code is required to disable monitoring, which must be provided by the user. A phone number can be set, to which a message will be sent if any of the sensors are triggered.

Notifications

When one of the sensors is triggered (reaches the configured sensitivity threshold), notifications are sent through the following channels (if enabled):

  • SMS: a message is sent to the number specified when monitoring started
  • Signal: if configured, can send end-to-end encryption notifications via Signal

Note that it is not necessary to install the Signal app on the device that runs Haven. Doing so may invalidate the app's previous Signal registration and safety numbers. Haven uses normal APIs to communicate via Signal.

Notifications are sent through a service running in the background that is defined in class MonitorService.

Remote Access

All event logs and captured media can be remotely accessed through a Tor Onion Service. Haven must be configured as an Onion Service and requires the device to also have Orbot: Tor for Android installed and running.

ATTRIBUTIONS

This project contains source code or library dependencies from the following projects:

haven's People

Contributors

1hiking avatar acherepkov1989 avatar ajimi avatar andrewr8 avatar ao-loclab avatar archie94 avatar btrice avatar christxph avatar eighthave avatar fat-tire avatar freewing-jp avatar isaacyagi avatar lohathe avatar louiswolfers avatar lukeswitz avatar mansil avatar mig5 avatar mziccard avatar n8fr8 avatar nicolabortignon avatar oculushut avatar oliviakumar avatar opticod avatar percy-g2 avatar rockgecko-development avatar samip5 avatar santossi avatar waldist avatar weblate avatar wtuemura 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

haven's Issues

Consider adding authentication to the onion service

If onion service option is enabled, the onion address shows all the triggered events with no authentication. Considering the legacy onion addresses (<v3) are not too hard to find, this might have serious privacy implication on people if the onion address to their phoneypot is found. Now it does slightly help that it's not running on port 80 but implementing #33 is going to change it anyway.

I suggest making use of HidServAuth or adding some basic auth password to the webserver phoneypot is running.

Crash on Nexus 5 running LinageOS

I'm using a Nexus 5 with LineageOS, and Haven 0.0.18.

As soon as I'm done clicking through the onboarding wizard, the app crashes. Here's a screenshot and the logcat logs:

signal-2017-12-18-144150

12-18 15:25:14.173  1782  1913 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback
12-18 15:25:18.820  2294  3471 I ActivityManager: START u0 {cmp=info.guardianproject.phoneypot/.MonitorActivity} from uid 10078 on display 0
12-18 15:25:18.910  8676  8676 I CameraFragment: Sensitivity set to High
12-18 15:25:19.037  1789  2729 I CameraService: CameraService::connect call (PID -1 "info.guardianproject.phoneypot", camera ID 1) for HAL version default and Camera API version 1
12-18 15:25:19.038  1789  2729 I CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=0
12-18 15:25:19.049  1789  8730 D NuPlayerDriver: notifyListener_l(0xb5d2b080), (1, 0, 0), loop setting(0, 0)
12-18 15:25:19.066  1789  8732 D NuPlayerDriver: notifyListener_l(0xb5d2baa0), (1, 0, 0), loop setting(0, 0)
12-18 15:25:19.082  1789  8734 D NuPlayerDriver: notifyListener_l(0xb5d2ba40), (1, 0, 0), loop setting(0, 0)
12-18 15:25:19.082  1789  2729 I Camera2ClientBase: Camera 1: Opened. Client: info.guardianproject.phoneypot (PID 8676, UID 10078)
12-18 15:25:19.085  1789  2729 D mm-camera-intf: mm_camera_open: dev name = /dev/video2, cam_idx = 2
12-18 15:25:19.085  1792  1792 I mm-camera-sensor: module_sensor_start_session:584 session 2
12-18 15:25:19.304  1792  1792 I mm-camera-sensor: module_sensor_init_session:478 ois device is not supported
12-18 15:25:19.304  1792  1792 I mm-camera-sensor: 
12-18 15:25:19.306  1792  1792 I mm-camera: gyro_module_start_session: Enter
12-18 15:25:19.306  1792  1792 I mm-camera: gyro_module_start_session: Init DSPS
12-18 15:25:19.306  1792  1792 E mm-camera: Failed to open sensor1 port
12-18 15:25:19.306  1792  1792 I mm-camera: gyro_module_start_session: dsps_proc_init() failed
12-18 15:25:19.306  1792  1792 I mm-camera: gyro_module_get_port: Exit failure
12-18 15:25:19.306  1792  1792 I mm-camera: cpp_module_start_session:352, info: starting session 2
12-18 15:25:19.327  1792  1792 I mm-camera: cpp_module_start_session:433, info: cpp_thread created.
12-18 15:25:19.328  1792  1792 I mm-camera: cpp_module_start_session:436, info: session 2 started.
12-18 15:25:19.328  1792  1792 I mm-camera: c2d_module_start_session:246, info: starting session 2
12-18 15:25:19.328  1792  8736 I mm-camera: cpp_thread_func:55: cpp_thread entering the polling loop...
12-18 15:25:19.328  1792  8737 I mm-camera: c2d_thread_func:39: c2d_thread entering the polling loop...
12-18 15:25:19.328  1792  1792 I mm-camera: c2d_module_start_session:284, info: c2d_thread created.
12-18 15:25:19.330  1792  1792 I mm-camera: c2d_module_start_session:306, info: session 2 started.
12-18 15:25:19.331  1792  1792 I mm-camera-sensor: module_module_set_session_data:2667 max delay 2 report dSelay 1
12-18 15:25:19.331  1792  1792 D mm-camera: module_faceproc_set_session_data:1987] Per frame control 2 1
12-18 15:25:19.331  1789  2729 D mm-camera-intf: mm_camera_open:  opened, break out while loop
12-18 15:25:19.332  3193  3204 E ANDR-PERF-LOCK: Failed to apply optimization for resource: 4 level: 0
12-18 15:25:19.335  1789  2729 I Camera2-Parameters: Camera 1: Disabling ZSL mode
12-18 15:25:19.335  1789  2729 I Camera2-Parameters: initialize: allowZslMode: 0 slowJpegMode 0
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 1280 height: 960
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 1280 height: 768
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 1280 height: 720
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 1024 height: 768
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 800 height: 600
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 800 height: 480
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 720 height: 480
12-18 15:25:19.341  8676  8676 I SurfaceView: width: 640 height: 480
12-18 15:25:19.341  8676  8676 I SurfaceView: selected width: 640 selected height: 480
12-18 15:25:19.342  1789  1789 E Camera2-Parameters: set: Requested preview FPS range 15 - 30 is not supported
12-18 15:25:19.346  8676  8676 D AndroidRuntime: Shutting down VM
12-18 15:25:19.347  8676  8676 E AndroidRuntime: FATAL EXCEPTION: main
12-18 15:25:19.347  8676  8676 E AndroidRuntime: Process: info.guardianproject.phoneypot, PID: 8676
12-18 15:25:19.347  8676  8676 E AndroidRuntime: java.lang.RuntimeException: setParameters failed
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.hardware.Camera.native_setParameters(Native Method)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.hardware.Camera.setParameters(Camera.java:2015)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at info.guardianproject.phoneypot.sensors.motion.Preview.surfaceCreated(Preview.java:228)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.SurfaceView.updateWindow(SurfaceView.java:618)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:161)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2205)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6344)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:686)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:621)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:751)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6186)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
12-18 15:25:19.347  8676  8676 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
12-18 15:25:19.349  2294  3348 W ActivityManager:   Force finishing activity info.guardianproject.phoneypot/.MonitorActivity

Remove notifications

There shouldn't be any notifications, especially not when the screen is locked and the app is activated. Don't want to tip anyone off about the system running.

Perhaps trigger a "reminder' notification when device is unlocked if the PP app is active

Enable RSS or other feed for Haven to Haven syncing

Allow multiple Haven instances to synchronize/backup data between eachother over HTTP or preferably HTTP-over-Onions. This would enable a hub device to backup data for multiple remote Haven instances in more insecure locations. It would also support a "smart home" type configuration with multiple points of monitoring.

"Haven is active" notification on lock screen

When Haven is activated, it shows this notification on the lock screen.

signal-2017-12-11-094354

There should be at least an option to not show it there. If you're using Haven as a security device, like in a hotel room, and an attacker picks up the phone and looks at the lock screen, in many situations it would be better if they didn't realize their actions were being logged.

UI should automatically fix the number format

When setting up the Signal number in Haven, the process quietly fails if you do not enter the number in international format. It should ideally try to automatically fix it or inform user what's the right format with an example.

Implement a low power mode

Implement a "low power mode"uses camera and other high power sensor more efficiently, by triggering them from low power sensors

sound + light sensor -> trigger camera activate and/or video recording

light, motion -> trigger one minute of active camera motion detection -> trigger one minute video recording

Can't trigger image events anymore, and sound events are repeated

I've been testing out PhoneyPot 0.0.5, and I'm seeing some weird behavior. Inside my app there are currently 14 incidents. The first incident has 3 camera motion events, with 3 different images.

But the rest of the incidents only have sound events, and in fact I can't even get the app to register camera motion events at all. If I activate it and move a bunch in front of the camera, or pick up the phone, it doesn't register new camera motion events (or accelerometer events). It only registers sound events.

In the remaining 13 incidents, all of the sound events are the exact same audio file (the sound of emergency vehicle sirens driving by). It's a 14-second clip, and that same clip is listed for each event. Most of the incidents have only 1 event, but one incident has 4 different events, but those events are all the same 14-second sound clip of sirens.

Also, I can't always reproduce this one, but sometimes when I'm scrolling through the list of incidents, I can't scroll all the way to the bottom of the list, it just stops before the bottom so I can't click on the most recent items. Although that's not happening now. In any case, it would be helpful to reverse the order of the incidents, so that the most recent is at the top instead of at the bottom.

My test phone is a Nexus 5 running the latest version of LineageOS, without root. I'm happy to try to help debug by extracting data from my phone.

Support external camera

I can think of multiple situations where one might want to make use of an external camera (like this and this) or mic for their phoneypot. Especially that some of these cameras already do have LED lights. I haven't tested this myself but are they supported out of the box, if they're compatible with android? Or do you need to add support for that?

Give hints while phoneypot countdown is activating

When you activate and it's counting down, maybe it should specifically say, "Lock your face and place it face up [or face down]", depending on which camera you're using. Also I think good to tell the user to lock their phone.

Onion service should have a random prefix

Until next gen onion services are live, the actual onion addresses aren't private from HSDir nodes. So it's possible that Haven onion services could get discovered by an attacker, giving them access to all of the evidence logs.

The easiest way to thwart this is to generate a random string and prefix all the URLs with it. So instead of starting with just http://blahblahblah.onion:8080/, the URLs should start with http://blahblahblah.onion:8080/randomstring/. This way, if an attacker discovered the onion service, they won't be able to view the logs without guessing the value of randomstring -- which is essentially a random password. This is how OnionShare URLs works.

Support Signal as linked device, instead of needing new phone number

link

Link to an existing device, instead of registering a new number. This shows a "tsdevice:/…" URI. If you want to connect to another signal-cli instance, you can just use this URI. If you want to link to an Android/iOS device, create a QR code with the URI (e.g. with qrencode) and scan that in the Signal app.

-n NAME, --name NAME
Optionally specify a name to describe this new device. By default "cli" will be used.

Onion service should listen on port 80 instead of 8888

I'm having trouble connecting to the PhoneyPot onion service from OnionBrowser in iOS. When I load http://[myaddress].onion:8888/ I get the error message:

Cannot Open Page
An error occured: The requested URL was not found on this server. (Error "NSURLErrorDomain: -1100")

I think that this is due to an OnionBrowser bug where it's parsing the URL incorrectly, and isn't actually trying to connect to port 8888. I should open an OnionBrowser bug to address this.

However, there's no need to listen on a port other than 80 anyway. PhoneyPot can still listen on 127.0.0.1:8888 on the device, and the onion service can just forward port 80 to port 8888. (This is how OnionShare works as well, the actual web service is on some high port, but the onion service forwards port 80.) It's just a matter of configuring the hidden service.

media/data are not being captured/saved on trigger events

currently there are the last 10 photos stored, but nothing related to specific incidents.

here are some thoughts:

  • how many photos, audio or length of time should we capture?
  • should this be stored in encrypted IOCipher file system?
  • what is the user interface for displaying these, etc?
  • how do we allow users to export/share incident reports and media?

UX Ideas

Hey @n8fr8! You may want to move this to the wiki, but I'm posting it in an issue for now because it's what I have access to. I put together a storyboard with my thoughts about how to tell the story of phoneypot and get people set up when they first use it. This is a start. If you like the direction, I think we should put it in front of some people to get their impressions.

Everything in black is what would be shown on the screen. In green are notes about the interactions.

img_0372

Activated and deactivated events

It would be useful to add an event when Haven is manually activated, and another event when Haven is manually deactivated. Also, I'm not sure if this is currently implemented, but it would be useful for there to be an event when the phone shuts down due to low battery, and an event when the app closed (because someone is powering off the phone for example) but not deactivated or because of low battery.

I think having these extra events will make users more sure of themselves. And if you come back to find Haven not activated, you'll have evidence that it's because you just forgot to activate it rather than because someone tampered with the phone while you were away.

Hard to find config page with no events

if you've got no events in your event library, I think users can get a little lost trying to go back to the "configuration" page once you've finished on-boarding. It's nice and easy from the Haven Log page, but when you're on the arming ("Tap to change countdown") page, the options of just Start Now / "Start Later" aren't as obvious. "Start later" takes you to the log (where you need to be), but the giant "click the go button down here, dummy" arrow leads the user away from the triple-dot in the upper right they're actually seeking. Maybe just add the triple-dot to the arming screen as well.

View images in better detail

It would be nice to be able to tap on an image that PhoneyPot takes in order to see it full screen, and pinch and squeeze to zoom in and out and look around.

Unable to build on Android Studio 3

I'm trying to build the apk for some testing but can't get it to work. I get 5 errors of Gradle saying it wasn't able to resolve resolve project :external:signal-cli. Is there something obvious I'm missing? Do I need to be using a specific version of Gradle or Android Studio?

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.