Code Monkey home page Code Monkey logo

interlock's Introduction

Introduction

INTERLOCK | https://github.com/usbarmory/interlock
Copyright (c) WithSecure Corporation

The INTERLOCK application is a file encryption front-end developed for, but not limited to, usage with the USB armory.

The primary interface consists of a web-based file manager for an encrypted partition running on the device hosting the JSON application server (e.g. USB armory).

The file manager allows uploading/downloading of files to/from the encrypted partition, as well as symmetric/asymmetric cryptographic operations on the individual files.

INTERLOCK screenshot

A command line mode is available to execute selected operations locally, without the web interface.

Authors

Andrea Barisani [email protected]
Daniele Bianco [email protected]

Documentation

The main documentation is included in the present file, additional information can be found on the project wiki.

Binary Releases

Pre-compiled binary releases for ARM targets are available here.

Architecture

The package provides a web application (client-side) and its counterpart JSON application server implementing the protocol specified in the API document.

A command line mode is available to execute selected operations locally, without the web interface. This is primarily intended to aid encryption/decryption operation with key derivation using HSM support on embedded firmwares.

The JSON application server is written in golang. The client HTML/Javascript application is statically served by the application server, implementing the presentation layer.

The interaction between the static HTML/Javascript and the JSON application server is entirely documented in the API document.

The web application authentication is directly tied to Linux Unified Key Setup (LUKS) disk-encryption setup on the server side. A successful login unlocks the specified encrypted volume, while logging out locks it back.

Design goals:

  • Clear separation between presentation and server layer to ease auditability and integration.

  • Minimum amount of external dependencies, currently no code outside of Go standard and supplementary libraries is required for the basic server binary.

  • Authentication process directly tied to LUKS partition locking/unlocking.

  • Support for additional symmetric/asymmetric encryption on individual files/directories.

  • Minimize exposure of sensitive data to the client with support for disposable authentication passwords, server-side operations (key generation, encryption/decryption, archive creation/extraction) and locking of private keys.

  • Minimal footprint (single statically linked binary) to ease integration/execution on the USB armory platform.

Ciphers

Encrypted volumes:

  • LUKS encrypted partitions

Asymmetric ciphers:

  • OpenPGP (using golang.org/x/crypto/openpgp)

Symmetric ciphers:

  • AES-256-OFB w/ PBKDF2 password derivation (SHA256, 4096 rounds) and HMAC (SHA256)

Security tokens:

  • Time-based One-Time Password Algorithm (TOTP), RFC6238 implementation (Google Authenticator)

Hardware Security Modules

The HSM support allows symmetric ciphering using device specific secret keys, allowing to uniquely tie derived keys to the specific hardware unit being used. An HSM specific AES-OFB based symmetric cipher is exposed, with keys derived from the user password as well as device specific secret.

Additionally the LUKS password, for accessing encrypted volumes, can filtered through the HSM to make it device specific.

Finally the TLS certificates can also be stored encrypted for a specific device.

Supported drivers:

  • NXP Security Controller (SCCv2)

  • NXP Cryptographic Acceleration and Assurance Module (CAAM)

  • NXP Data Co-Processor (DCP)

Key Storage

A pre-defined directory, stored on the encrypted filesystem, is assigned to public and private key storage (see the Configuration section for related settings).

The keys can be uploaded using the file manager, imported as free text or generated server-side.

The key storage directory structure is the following:

<key_path>/<cipher_name>/<private|public>/<key_identifier>.<key_format>

Once uploaded in their respective directory, private keys can only be deleted or overwritten, they cannot be downloaded, moved or copied.

The keys for OTP ciphers (e.g. "TOTP" implementing Google Authenticator) generate a valid OTP code, for the current time, when the key information is queried ('Key Info' action on the right click menu).

Requirements & Operation

The use of INTERLOCK is coupled with the presence of at least one LUKS encrypted partition, its initial creation is left to the user.

An example setup using cryptsetup and LVM2 follows. The example uses a microSD partition to illustrate typical USB armory setup, the partition (mmcblk0p2) is assumed to have been previously created with fdisk using the desired size and the Linux LVM type (8e).

pvcreate /dev/mmcblk0p2                   # initialize physical volume
vgcreate lvmvolume /dev/mmcblk0p2         # create volume group
lvcreate -L 20G -n encryptedfs lvmvolume  # create logical volume of 20 GB

cryptsetup -y --cipher aes-xts-plain64  \ # set-up encrypted partition
  --key-size 256 --hash sha1 luksFormat \ # with default cryptsetup
  /dev/lvmvolume/encryptedfs              # settings

cryptsetup luksOpen /dev/lvmvolume/encryptedfs interlockfs
mkfs.ext4 /dev/mapper/interlockfs         # create ext4 filesystem
cryptsetup luksClose interlockfs

The login procedure of INTERLOCK prompts for an encrypted volume name (e.g. encryptedfs in the previous example) and one valid password for luksOpen.

A successful login unlocks the encrypted partition, a successful logout locks it back.

Once logged in users can change, add, remove LUKS passwords within INTERLOCK. Any login password can be disposed of using a dedicated flag during login, this deletes the password from its LUKS key slot right after encrypted partition unlocking.

WARNING: removing the last remaining password makes the LUKS encrypted container permanently inaccessible. This is a feature, not a bug.

The following sudo configuration (meant to be included in /etc/sudoers) illustrates the permission requirements for the user running the INTERLOCK server. The example assumes username interlock with home directory /home/interlock and volume_group set to its default (lvmvolume).

interlock ALL=(root) NOPASSWD:							\
	/bin/date -s @*,							\
	/sbin/poweroff,								\
	/bin/mount /dev/mapper/interlockfs /home/interlock/.interlock-mnt,	\
	/bin/umount /home/interlock/.interlock-mnt,				\
	/bin/chown interlock /home/interlock/.interlock-mnt,			\
	/sbin/cryptsetup luksOpen /dev/lvmvolume/* interlockfs,			\
	!/sbin/cryptsetup luksOpen /dev/lvmvolume/*.* *,			\
	/sbin/cryptsetup luksClose /dev/mapper/interlockfs,			\
	!/sbin/cryptsetup luksClose /dev/mapper/*.*,				\
	/sbin/cryptsetup luksChangeKey /dev/lvmvolume/*,			\
	!/sbin/cryptsetup luksChangeKey /dev/lvmvolume/*.*,			\
	/sbin/cryptsetup luksRemoveKey /dev/lvmvolume/*,			\
	!/sbin/cryptsetup luksRemoveKey /dev/lvmvolume/*.*,			\
	/sbin/cryptsetup luksAddKey /dev/lvmvolume/*,				\
	!/sbin/cryptsetup luksAddKey /dev/lvmvolume/*.*

Compiling

The INTERLOCK app requires a working Go (>= 1.4.2) environment to be compiled, or cross-compiled, under Linux (it is not supported by or designed for other OSes at this time).

git clone https://github.com/usbarmory/interlock
cd interlock
make

This compiles the interlock binary that can be executed with options illustrated in the next section.

Alternatively you can automatically download, compile and install the package, under your GOPATH, as follows:

go install github.com/usbarmory/interlock@latest

Options

  -h                   options help
  -b="0.0.0.0:4430"    binding address:port pair
  -c="interlock.conf"  configuration file path
  -o=""                operation ((unlock:<volume>)|lock|derive(:<data>)?)
  -d=false:            debug mode
  -t=false:            test mode (WARNING: disables authentication)

The operation flag allows selected actions to be performed locally, without a web interface. The following operations are supported:

  • unlock:<volume>: unlock LUKS volume to mapping "interlockfs", prompts password once. Uses HSM key derivation when configured.

  • lock: lock the LUKS volume mapped to "interlockfs".

  • derive:<data>: HSM key derivation from data (e.g. diversifier) specified in hex format (e.g. derive:12ef).

  • derive: HSM key derivation from password, prompted twice interactively.

Configuration

  • debug: enable debugging logs.

  • set_time: use the client browser time to set server time at login, useful on non-routed USB armory devices (unable to set the clock on their own).

  • bind_address: IP address, port pair.

  • tls:

    • on: use tls_cert and tls_key paths as HTTPS TLS keypair;

    • gen: generate a new TLS keypair and save it to tls_cert and tls_key paths when pointing to non existent files (otherwise behaves like "on"), useful for testing and TOFU (Trust On First Use) schemes;

    • off: disable HTTPS.

  •  `tls_cert`: HTTPS server TLS certificate.
    
  •   `tls_key`: HTTPS server TLS key.
    
  • tls_client_ca: optional CA for HTTPS client authentication, client certificate requires TLS Web Client Authentication X509v3 Extended Key Usage extension to be correctly validated.

  • hsm:

    • <model>:<options>: enable HSM support with , multiple options can be combined in a comma separated list (e.g. "mxc-scc2:luks,tls,cipher");

    • off: disable HSM support.

    Available modules:

    • mxc-scc2: NXP Security Controller (SCCv2). Requires kernel driver mxc-scc2.

    • caam-keyblob: NXP Cryptographic Acceleration and Assurance Module (CAAM). NOTE: stores encrypted derived keys in ~/.luks_kb/, which must be accompanied to the LUKS partition itself when creating data backups. Requires kernel driver caam-keyblob.

    • mxs-dcp: NXP Data Co-Processor (DCP). Requires kernel driver mxs-dcp.

    Available options:

    • luks: use HSM secret key to AES encrypt LUKS passwords and make them device specific before use; LUKS login and password operations (add, change, remove) fallback, in case of failure, to plain ones in order to allow change of credentials on pre-HSM deployments;

    • tls: use HSM secret key to AES-256-OFB encrypt the HTTPS server TLS key (tls_key), automatically convert existing plaintext keys;

    • cipher: expose AES-256-OFB derived symmetric cipher with password key derivation through HSM encryption to make it device specific.

  • key_path: path for public/private key storage on the encrypted filesystem.

  • volume_group: volume group name.

  • ciphers: array of cipher names to enable, supported values are ["OpenPGP", "AES-256-OFB", "TOTP"].

The following example illustrates the configuration file format (plain JSON) and its default values.

{
        "debug": false,
        "set_time": false,
        "bind_address": "0.0.0.0:4430",
        "tls": "on",
        "tls_cert": "certs/cert.pem",
        "tls_key": "certs/key.pem",
        "tls_client_ca": "",
        "hsm": "off",
        "key_path": "keys",
        "volume_group": "lvmvolume"
        "ciphers": [
                "OpenPGP",
                "AES-256-OFB",
                "TOTP"
        ]
}

At startup the interlock server dumps the applied configuration in its file format.

Logging

The application generates debug, audit, notification and error logs.

Debugging logs are only generated when "debug" is set to true in the configuration file (or command line switch). In debug mode all logs are printed on standard output and never saved.

Audit and error logs are shown live in a dedicated area on the web client ('Application logs') and saved on the root directory of the encrypted partition in the .interlock.log file.

Notifications are shown live in a dedicated area on the web client ('Current activity'), they are only kept in memory in a circular buffer and never stored on disk.

Any non-debug log generated outside an unauthenticated session is issued through standard syslog facility.

License

INTERLOCK | https://github.com/usbarmory/interlock
Copyright (c) WithSecure Corporation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See accompanying LICENSE file for full details.

interlock's People

Contributors

abarisani avatar blenessy avatar cicadamikoto avatar danbia avatar dependabot[bot] avatar jrruethe avatar rgarza avatar usmansaleem 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

interlock's Issues

Image Viewer?

If it's not too much trouble, could you add an image viewer and/or some kind of raw mode, so that I can keep images and pdfs in encrypted storage and view the contents in my browser without downloading to the host?

File Fingerprinting [Feature Request]

It would be nice to have fingerprinting functionality to ensure file integrity.

With a collection of common fingerprinting hash functions:

  • MD5
  • SHA*
  • Etc.

Ability to decrypt and download file without creating decrypted file on disk

Hi,

At the moment, the decrypt operation creates a decrypted file alongside encrypted file. This results in following issues:

  • It takes about 200ms to file to actually gets decrypted (the decrypt api call returns immediately). Till that time, the decrypted file size remains 0 bytes.
  • If incorrect credentials are specified, the file size remains 0. The decrypt API call should have returned error in this case.
  • The decrypt call fails if decrypted file already exists.

Suggestion

Decrypt and download in one call without creating the file contents on disk. The decrypt call should return error if it is unable to decrypt the contents instead of returning 0 bytes file.

Improve JSON validation

The incoming JSON requests are currently only validated in terms of presence for mandatory attributes. Verify eventual dangerous behaviour in case of invalid data being fed and improve validation where required.

Suggestion for TextSecure usability improvement.

Hi,

I wish to thank you for all you've done ! I would humbly like to suggest an improvement of TextSecure UI.

I wish to create small chat box for notifying of new messages and then engaged in conversation.

Can you give some tips on how to build this functionality in a modular manner ?

Regards.

Cannot compile code

Cannot compile the program, getting this error on syscall module.

~/github/interlock$ make

cd server && go build -ldflags "-X main.InterlockBuild "@mac.local on "" -o ../interlock

_/Users/123/github/interlock/server

./status.go:118: undefined: syscall.Sysinfo_t
./status.go:119: undefined: syscall.Sysinfo
make: *** [build] Error 2

Have read that syscall package moved to sys.unix, but cannot successefully import this package. Using MacOS Yosemite.

Could not login after cookie expiration

By default, the generated cookie has a max-age value of 8 hours (as defined in auth.go).

After it expires, if you interact with the UI, you are thrown back to the main login page. If you try to login, you have an "existing session" error message. If you restart the interlock daemon and try to login again, you have a "Device VOLUMENAME already exists". So, in the end, you are unable to login unless you reboot the entire system or manually do the umount.

As a solution, you could either:

  • Increment the cookie max-age value to 16 hours for example.
  • Properly close opened sessions when interlock stops.
  • Automatically close sessions when no activity is performed for cookie max-age time.
  • Renew the cookie when max-age/2 time already elapsed.

Sanity check before performing luksRemoveKey

Currently the "Remove password" feature allows to remove the only available password, effectively locking out the user from the encrypted partition. Consider implementing a sanity check that warns the user when the last password is about to be deleted.

Support directory download

Currently directory cannot be downloaded, implement the feature by archiving the directory (zip ?) for download.

cannot connect to my usbarmory

i used the binary files for interlock (interlock-usbarmory-v2018.01.09.tar.xz) and configured a bootable microSD using the raw file
when i connect the usbarmory to my PC (running windows 10) it creates an Ethernet adapter and gives me an ip address (10.0.0.2).
i can ping 10.0.0.1 which i think is the usbarmory but i cant login via SSH (using usbarmory as user and pass) or connect to https://10.0.0.1
any ideas?

How to decrypt a file?

i encrypt file with aes-256-ofb and passphrase via webui
when i try to decrypt it via

usbarmory@usbarmory:~/.interlock-mnt$ openssl enc -d -aes-256-ofb -in file.txt.aes256ofb -out file.txt.aes256ofb.txt
bufsize=8192
enter aes-256-ofb decryption password:
bad magic number

i tried on my local machine and result is the same
decryption in webui works

interlock.conf

{
  "debug": true,
  "static_path": "static",
  "set_time": false,
  "bind_address": "0.0.0.0:4430",
  "tls": "gen",
  "tls_cert": "certs/cert.pem",
  "tls_key": "certs/key.pem",
  "tls_client_ca": "",
  "hsm": "off",
  "key_path": "keys",
  "volume_group": "usbarmory-sd",
  "ciphers": [
          "OpenPGP",
          "AES-256-OFB",
          "TOTP"
  ]
}

Create volumes from UI

I am working in adding the ability to create volumes from the ui screen, is this you are interested in?, i was thinking in create them from the login screen, but maybe we should allow to create once you are logged in? what are your opinions on this?

Thank you

Bitcoin/keybase support

Hi,
I am here to suggest who some things:

  • adding a web based bitcoin wallet.
  • adding keybase chat support which was released very recently (but you already implement signal).
    For the bitcoin part I can work on the server side code but I won't be able to work on the web UI (I am a terrible web developer ๐Ÿ˜).
    Please tell me what you think about that.

Support OpenPGP signing.

Currently OpenPGP encryption mechanism lacks support for signing and signature verification. Implement its support per API specifications.

Build failure on 32bit x86 Linux

Running latest version of go (PIE, 1.12.7), this is what I get when running make with signal support:

# github.com/inversepath/interlock/internal
internal/dcp.go:247:31: undefined: syscall.SYS_SETSOCKOPT
internal/dcp.go:259:30: undefined: unix.SYS_ACCEPT
make: *** [Makefile:15: build] Error 2

Indeed, those calls do not exist on 32 bits Linux:
https://golang.org/src/syscall/zsysnum_linux_386.go
https://github.com/golang/sys/blob/6ec70d6a5542cba804c6d16ebe8392601a0b7b60/unix/zsysnum_linux_386.go

Current not implemented on linux/arm

Hello,

I've installed Golang on a Linux VM

sudo GOOS=linux GOARCH=arm ./make.bash --no-clean

Cross-complied with this command:

make -j8 GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLE=1

And then, after following the tutoriel for encryptedfs creation:

2015/06/21 19:09:01 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksOpen /dev/lvmvolume/encryptedfs interlockfs]
2015/06/21 19:09:03 status.go:52: mounting encrypted volume to /home/usbarmory/.interlock-mnt
2015/06/21 19:09:03 cmd.go:42: executing system command, sudo: true, cmd: /bin/mount, args: [/dev/mapper/interlockfs /home/usbarmory/.interlock-mnt]
2015/06/21 19:09:04 status.go:52: unmounting encrypted volume on /home/usbarmory/.interlock-mnt
2015/06/21 19:09:05 api.go:23: 10.0.0.2:50849 POST /api/auth/login
2015/06/21 19:09:05 status.go:52: unlocking encrypted volume encryptedfs
2015/06/21 19:09:05 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksOpen /dev/lvmvolume/encryptedfs interlockfs]
2015/06/21 19:09:07 status.go:52: unmounting encrypted volume on /home/usbarmory/.interlock-mnt
2015/06/21 19:09:15 cmd.go:42: executing system command, sudo: true, cmd: /bin/umount, args: [/home/usbarmory/.interlock-mnt]
2015/06/21 19:09:15 cmd.go:42: executing system command, sudo: true, cmd: /bin/umount, args: [/home/usbarmory/.interlock-mnt]
2015/06/21 19:09:16 status.go:52: locking encrypted volume
2015/06/21 19:09:16 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksClose /dev/mapper/interlockfs]
2015/06/21 19:09:17 status.go:52: locking encrypted volume
2015/06/21 19:09:17 cmd.go:42: executing system command, sudo: true, cmd: /sbin/cryptsetup, args: [luksClose /dev/mapper/interlockfs]
2015/06/21 19:09:17 status.go:62: Device interlockfs already exists.
2015/06/21 19:09:17 api.go:156: {"response":["Device interlockfs already exists.\n"],"status":"INVALID_SESSION"}
2015/06/21 19:09:17 status.go:62: user: Current not implemented on linux/arm
2015/06/21 19:09:17 api.go:156: {"response":["user: Current not implemented on linux/arm"],"status":"INVALID_SESSION"}

Encryption keys are extractable

This code is using very weird security concept. It assumes that device supports hardware encryption, but it's used just to construct encryption key and uses it later in software layer. unix.ALG_OP_DECRYPT mode is not even used in the code (just unix.ALG_OP_ENCRYPT). The security features of required hardware are underutilized and whole encryption key is as good as I would use serial number of a device without hardware encryption.

Content Security Policy: allow unsafe-inline into script-src

Hello,

When using your app, it looks like my browser is throwing me CSP errors in my console due to a lack of 'unsafe-inline' value missing in the script-src rule.
You can add this in internal/api.go.

It does not seem to affect global usage much, but both of your templates are having some inline javascript.

And while you're there, it's likely you may want to add others such as Strict-Transport-Security, Feature-Policy, Referrer-Policy, X-Content-Type-Options, X-Frame-Options, X-Permitted-Cross-Domain-Policies, X-Robots-Tag, X-XSS-Protection, X-Download-Options, etc. Those are just the one I usually add when I setup a web server.

Thanks for the awesome app!

Change Default Interlock Port

How do I get to the file to change

"bind_address": "0.0.0.0:4430",

SSH? If so whats the default login?

If not do I just put the card in my computer and can see the conf file?

Is this the correct conf file /etc/interlock/interlock.conf ?

Error When Building Interlock

Makefile:15: recipe for target 'build' failed
make: *** [build] Error 2

I get this after following all the steps and then issue make as the last step of the compiling section

Cannot select file or directory in firefox.

Hello,

I have tested interlock on both Chromium and Firefox, and everything behaves as expected in chromium.
But with Firefox (Linux, running version 67.0.2 currently), it is another story: I cannot select anything, and thus I cannot move in any directory (without doing some hackery stuffs).
I've tested with a clean browser profile on a second machine (same Linux distribution), and the problem persists.
It used to work in the past, so something likely got changed in Firefox and broke something here.

What I am observing is that the click event in file_manager.js line 378 is never triggered, even if I confirm that the addClass statement right before is correctly executed. I can see that click events do work since the one in line 71 and line 344 seem to be called.

In the HTML code, this gets expressed as elements never get in a ui-selected state. It does not get beyond a ui-selecting state. I can observe that Interlock.UI.doubleClick is always false even if I try to set a huge Interlock.UI.doubleClickDelay value.

Currently, the ways I was able to force a chdir was to either edit the sessionStore by hand and refresh the page, force ui-selected in the HTML and double click again on the item, or, well, use chromium instead.

Failed mounting interlockfs: invalid argument

I get the following error when I try to log into INTERLOCK:
"[Interlock.Session.loginCallback] mount: mounting /dev/mapper/interlockfs on /home/interlock/.interlock-mnt failed: Invalid argument"

I compiled my own INTERLOCK img for the USB Armory.
I followed the steps on the https://github.com/inversepath/usbarmory/blob/master/software/buildroot/README-INTERLOCK.md with a few changes.

First, after checking the dependencies and cloning the usbarmory and buildroot git repos:

  1. I checked out the '2017.11' branch for the buildroot repo
  2. I did not install Signal dependency for INTERLOCK because I do not intend on using it.

Now that usbarmory and buildroot git repos were downloaded, I applied the following changes:

  1. I removed mxcscc2 and interlock signal option in the extra features from buildroot menuconfig.
  2. I removed the .ssh symlink in the home/interlock from the buildroot overlay.
  3. I mkdir'ed .interlock-mnt in the home/interlock from the buildroot overlay.
  4. I removed Signal encryption option in the interlock.conf from the buildroot overlay.
  5. I added ( "hsm": "off" ) and ( "volume_group": "lvmvolume" ) in the interlock.conf from the buildroot overlay.
  6. I commented out the mscscc2 kernel module operations in the init.d/S98interlock from the buildroot overlay
  7. On the buildroot 2017.11 branch, when I opened menuconfig, the host mke2img utility became a legacy feature, so I turned it off.

After this step, I partitioned my SD card and made an ext2 file system as directed in the original installation guide.
Following these steps, I am able to compile and flash the image and bring up the interlock login website.
Unfortunately, when I enter the default "armory:usbarmory" credentials, I get the error I mentioned on the top.

Error On Newly Compiled Interlock

I get the following when trying to start interlock using a conf file

invalid path for static files

I get no info on what files it is talking about other then

2017/01/25 04:34:10 main.go:123: invalid path for static files: stat static: no such file or directory

Armory External Storage

Is it possible to add additional external storage to the armory for example a large 4 TB hard drive to use as a secure encryption/decryption system similar to encrypted SSD drives but all completely open source?

Warning messages: missing attribute sha256

Issue

When compiling the current code according to the README.md Compiling section, the interlock application brings lots of missing attribute warnings:

2018/09/16 11:15:59 status.go:59: missing attribute sha256
2018/09/16 11:15:59 api.go:192: {"response":["missing attribute sha256"],"status":"KO"}

System information

Go version:

go version go1.7.4 linux/arm

Linux system: Fresh install of Raspbian Stretch Lite (2018-06-27-raspbian-stretch-lite.img)

Linux raspberrypi 4.14.69+ #1141 Mon Sep 10 15:13:50 BST 2018 armv6l GNU/Linux

Workaround (possible unsafe)

The following patch will get rid of the attribute warnings but I think the introduced checksums are supposed to be there and the fix is to be found somewhere else.

diff --git a/src/file.go b/src/file.go
index 13d1d05..f40c62b 100644
--- a/src/file.go
+++ b/src/file.go
@@ -366,7 +366,7 @@ func fileList(r *http.Request) (res jsonObject) {
                return errorResponse(err, "")
        }

-       err = validateRequest(req, []string{"path:s", "sha256:b"})
+       err = validateRequest(req, []string{"path:s"})

        if err != nil {
                return errorResponse(err, "")

Signal Support - Manual Build

Is this the error you mentioned would happen when building with signal support?

./signal.go:146: undefined: strings.Compare

Is there anyway to fix this so I can build interlock with signal support?

Attempting to use a path deeper than one level results in error

Steps to Reproduce

  1. Import a TOTP key
  2. Click to enter the 'keys' directory
  3. Click to enter the 'totp' directory
  4. Receive error "INTERLOCK error - path traversal detected"

OR

  1. Create directory 'a'
  2. Enter 'a'
  3. Attempt to create directory 'b'
  4. Receive error "path traversal detected"

Build info
Prebuilt binary, interlock-arm-v2017.08.03.

Config

{
  "debug": true,
  "static_path": "static",
  "set_time": true,
  "bind_address": "0.0.0.0:80",
  "tls": "off",
  "tls_cert": "certs/cert.pem",
  "tls_key": "certs/key.pem",
  "tls_client_ca": "",
  "hsm": "off",
  "key_path": "keys",
  "volume_group": "lvmvolume",
  "ciphers": [
          "OpenPGP",
          "AES-256-OFB",
          "TOTP"
  ]
}

Add file editing feature.

Now that INTERLOCK allows creation of new files, by editing their contents, it seems useful to add the possibility of editing existing files (maybe locking it down just to text files?).

changing root password

can not change root password - on serial debug console.

passwd

Changing password for root
New password:
Retype password:
double free or corruption (out)
Aborted

Signal registration crashes interlock (release 2017.03.07)

the registration at Signal crashes INTERLOCK and even a restart does not help as it somehow seem to try to register again.

During the first registration a dialog with "request failed, invalid backend response" pops up.

the debug log is:

2017/05/23 05:17:38 api.go:49: 10.0.0.2:43878 POST /api/Signal/register
2017/05/23 05:17:38 json.go:33: {"contact":"+1234567890123","code":"xxx-yyy"}
2017/05/23 05:17:38 api.go:192: {"response":null,"status":"OK"}
2017/05/23 05:17:38 status.go:50: received Signal registration verification code for +1234567890123
DEBU[2017/05/23 05:17:38] PUT /v1/accounts/code/xxxyyy 204
DEBU[2017/05/23 05:17:39] PUT /v2/keys/ 204
                           
2017/05/23 05:17:39 status.go:50: registration complete for +1234567890123
2017/05/23 05:17:39 status.go:50: starting Signal message listener for +1234567890123
panic: runtime error: slice bounds out of range

goroutine 220 [running]:
github.com/janimo/textsecure.handleReceivedMessage(0x0, 0x0, 0x0, 0x555888, 0x10b45d80)
        /home/lcars/go/src/github.com/janimo/textsecure/textsecure.go:462 +0xa2c
github.com/janimo/textsecure.StartListening(0x590c70, 0x5)
        /home/lcars/go/src/github.com/janimo/textsecure/websocket.go:204 +0x1e0
main.(*Signal).start(0x108743c0)
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:544 +0x84
main.(*Signal).registrationDone(0x108743c0)
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:539 +0xac
main.(*Signal).(main.registrationDone)-fm()
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:481 +0x1c
github.com/janimo/textsecure.registerDevice(0x10a92c80, 0x10ac6740)
        /home/lcars/go/src/github.com/janimo/textsecure/textsecure.go:354 +0x124
github.com/janimo/textsecure.Setup(0x10a5fad0, 0x555a88, 0x10a80dd0)
        /home/lcars/go/src/github.com/janimo/textsecure/textsecure.go:303 +0x36c

and unmounting, closing the interlockfs and restarting interlock:

2017/05/23 05:27:32 session.go:66: new session for volume test
2017/05/23 05:27:32 api.go:192: {"response":{"XSRFToken":"base64-token","volume":"test"},"status":"OK"}
2017/05/23 05:27:32 status.go:50: starting Signal message listener for +1234567890123
2017/05/23 05:27:32 api.go:49: 10.0.0.2:43928 POST /api/config/time
2017/05/23 05:27:32 json.go:33: {"epoch":1495517252}
2017/05/23 05:27:32 cmd.go:42: executing system command, sudo: true, cmd: /bin/date, args: [-s @1495517252]
2017/05/23 05:27:32 api.go:49: 10.0.0.2:43928 GET /api/crypto/ciphers
2017/05/23 05:27:32 api.go:192: {"response":[{"name":"TOTP","info":"Time-Based One-Time Password Algorithm (RFC6238, a.k.a. Google Authenticator)","key_format":"base32","enc":false,"dec":false,"sig":false,"otp":true,"msg":false,"ext":"totp"},{"name":"Signal","info":"Signal (TextSecure) protocol V2","key_format":"binary","enc":false,"dec":false,"sig":false,"otp":false,"msg":true,"ext":"signal"},{"name":"OpenPGP","info":"OpenPGP (golang.org/x/crypto/openpgp)","key_format":"armor","enc":true,"dec":true,"sig":true,"otp":false,"msg":false,"ext":"pgp"},{"name":"AES-256-OFB","info":"AES OFB w/ 256 bit key derived using PBKDF2","key_format":"password","enc":true,"dec":true,"sig":false,"otp":false,"msg":false,"ext":"aes256ofb"}],"status":"OK"}
2017/05/23 05:27:32 api.go:49: 10.0.0.2:43928 POST /api/status/running
2017/05/23 05:27:32 api.go:192: {"response":{"freeram":492994560,"load_1":37184,"load_15":6272,"load_5":11712,"log":[{"epoch":1495517252,"code":5,"msg":"starting Signal message listener for +1234567890123"},{"epoch":1495517251,"code":5,"msg":"setting mount point permissions for user interlock"},{"epoch":1495517251,"code":5,"msg":"mounting encrypted volume to /home/interlock/.interlock-mnt"},{"epoch":1495517201,"code":5,"msg":"unlocking encrypted volume test"}],"notification":null,"uptime":1051},"status":"OK"}
2017/05/23 05:27:32 api.go:49: 10.0.0.2:43928 GET /api/status/version
2017/05/23 05:27:32 api.go:192: {"response":{"build":"interlock@inversepath on 2017-03-07 10:53:26 signal","key_path":"keys","revision":"043b84a"},"status":"OK"}
2017/05/23 05:27:32 api.go:49: 10.0.0.2:43928 POST /api/file/list
2017/05/23 05:27:32 json.go:33: {"path":"/.ssh"}
2017/05/23 05:27:32 api.go:192: {"response":{"free_space":12586774528,"inodes":[{"name":"authorized_keys","dir":false,"size":391,"mtime":1495516459,"key_path":false,"private":false,"key":null}],"total_space":21001486336},"status":"OK"}
2017/05/23 05:27:32 status.go:50: adjusted device time to 05:27:32
2017/05/23 05:27:32 api.go:192: {"response":null,"status":"OK"}
panic: runtime error: slice bounds out of range


goroutine 156 [running]:
github.com/janimo/textsecure.handleReceivedMessage(0x0, 0x0, 0x0, 0x555888, 0x10ab0b80)
        /home/lcars/go/src/github.com/janimo/textsecure/textsecure.go:462 +0xa2c
github.com/janimo/textsecure.StartListening(0x590c70, 0x5)
        /home/lcars/go/src/github.com/janimo/textsecure/websocket.go:204 +0x1e0
main.(*Signal).start(0x10872320)
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:544 +0x84
main.(*Signal).Activate.func1(0x10872320)
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:97 +0x1c
created by main.(*Signal).Activate
        /home/lcars/lab/buildroot/output/build/interlock-043b84a7650ed4d78881eac7e0e5788e16ab531f/src/signal.go:98 +0x70

to be able to use interlock again the /keys/signal directory has to be removed.

Create volumes from UI

I am working in adding the ability to create volumes from the ui screen, is this you are interested in?, i was thinking in create them from the login screen, but maybe we should allow to create once you are logged in? what are your opinions on this?

Thank you

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.