Repository: freedomofpress/securedrop

Issue:
Release SecureDrop 0.12.2
This is a tracking issue for the upcoming release of SecureDrop 0.12.2 - tasks may get added or modified. 

**Feature freeze:** EOD Pacific time, Tuesday, April 16
**String freeze:** EOD Pacific time, Tuesday, April 16
**Pre-release announcement:** N/A - point releases will not have pre-release announcements
**Release date:** EOD Pacific time, Thursday, April 25

**Release manager:** @emkll
**Deputy release manager:** @rmol  
 
_SecureDrop maintainers and testers:_ As you QA 0.12.2, please report back your testing results as comments on this ticket. File GitHub issues for any problems found, tag them "QA: Release", and associate them with the 0.12.2 milestone for tracking (or ask a maintainer to do so). 

Test debian packages will be posted on https://apt-test.freedom.press signed with [the test key](https://gist.githubusercontent.com/conorsch/ec4008b111bc3142fca522693f3cce7e/raw/2968621e8ad92db4505a31fcc5776422d7d26729/apt-test%2520apt%2520pubkey). An Ansible playbook testing the upgrade path is [here](https://gist.github.com/conorsch/e7556624df59b2a0f8b81f7c0c4f9b7d).

# Prepare release candidate (0.12.2~rc1)
- [x] Prepare 0.12.2-rc1 release changelog - @emkll  
- [x] Branch off release/0.12.1 into release/0.12.2 - @emkll 
- [x] Build debs (including new Tor package) and put up `0.12.2~rc1` on test apt server - @rmol   


# Prepare release candidate (0.12.2~rc2)
- [x] Prepare 0.12.2-rc2 release changelog - @emkll  
- [x] Build debs (including new Tor package) and put up `0.12.2~rc1` on test apt server - @rmol   

# [QA Matrix for 0.12.2](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg/edit?usp=sharing)
# [Test Plan for 0.12.2](https://github.com/freedomofpress/securedrop/wiki/0.12.2-Test-Plan)

After each test, please update the QA matrix and post details for Basic Server Testing, Application Acceptance Testing and 0.12.2-specific testing below in comments to this ticket.

# Final release
- [x] Ensure builder in release branch is updated and/or update builder image - @emkll
- [x] Push signed tag - @redshiftzero / @emkll
- [x] Build final Debian packages for 0.12.2 (including Tor packages) - @conorsch 
- [x] Upload Debian packages to apt-qa - @conorsch 
- [x] Pre-Flight: Test install and upgrade (both cron-apt on Trusty, and Ansible on Xenial) of 0.12.2 works w/ prod repo debs - @rmol @kushaldas @zenmonkeykstop @emkll 
- [x] Pre-Flight: Test GUI Updater @zenmonkeykstop @kushaldas @emkll 
- [x] Prepare and distribute release messaging - @eloquence 
- [x] Update GitHub release object - @redshiftzero 

# Post release

- [x] Merge changelog back to `develop` - @rmol #4389  
- [ ] Update upgrade testing boxes - @emkll (might be blocked on https://github.com/freedomofpress/securedrop/issues/4329) 
- [x] Update roadmap wiki page - @eloquence 
Upgrade scenario fails on develop
## Description

Running upgrade scenario on `develop` returns the following error:
```
    TASK [app-test : Install pip dependencies for running the unit and functional tests.] ***
    fatal: [app-staging]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'securedrop_code' is undefined\n\nThe error appears to have been in '/tmp/molecule/securedrop/upgrade/sd-orig/install_files/ansible-base/roles/app-test/tasks/dev_setup_xvfb_for_functional_tests.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Install pip dependencies for running the unit and functional tests.\n  ^ here\n"}
    
    NO MORE HOSTS LEFT *************************************************************
    
    NO MORE HOSTS LEFT *************************************************************
    
    PLAY RECAP *********************************************************************
    app-staging                : ok=4    changed=2    unreachable=0    failed=1   
    mon-staging                : ok=2    changed=1    unreachable=0    failed=0
    
    
ERROR: 
Makefile:175: recipe for target 'upgrade-test-local' failed
```

## Steps to Reproduce

1. git checkout develop
2. make build-debs
3. make upgrade-start
4. make upgrade-test-local

## Expected Behavior

Upgrade scenario should complete without error.

## Actual Behavior

Upgrade scenario returns error (see above)

## Comments

It appears that reverting 102afb57bcf4798cd466001b9aaeec1bf1a58577 resolves the issue for me locally.



Discussion:
### Environment

- Install target: 14.04 VMs
- Tails version: 0.13.1
- Test scenarios:
1. Installation of 0.12.1 on Trusty, cron-apt simulated upgrade to 0.12.2 again on Trusty
2. Upgrade in-place to Xenial
- Server locale setting: en_US
- SSH over Tor: no
- Release candidate: 0.12.2~rc1
- General notes:

### Basic Server Testing

- [x] I can access both the source and journalist interfaces
- [x] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [x] 0 processes are running unconfined
- [x] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [x] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [x] OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html
- [x] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2
- [x] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent.

### Application Acceptance Testing

#### Source Interface

##### Landing page base cases
- [x] JS warning bar does not appear when using Security Slider high
- [x] JS warning bar does appear when using Security Slider Low

##### First submission base cases
- [x] On generate page, refreshing codename produces a new 7-word codename
- [x] On submit page, empty submissions produce flashed message
- [x] On submit page, short message submitted successfully
- [x] On submit page, file greater than 500 MB produces "The connection was reset" in Tor Browser _quickly_ before the entire file is uploaded
- [x] On submit page, file less than 500 MB submitted successfully

##### Returning source base cases

- [x] Nonexistent codename cannot log in
- [x] Empty codename cannot log in
- [x] Legitimate codename can log in
- [x] Returning user can view journalist replies - need to log into journalist interface to test

#### Journalist Interface

##### Login base cases
- [x] Can log in with 2FA tokens
- [x] incorrect password cannot log in
- [x] invalid 2fa token cannot log in
- [x] 2fa immediate reuse cannot log in

##### Index base cases
- [x] Filter by codename works
- [x] Starring and unstarring works
- [x] Click select all selects all submissions
- [x] Selecting all and clicking "Download" works

##### Individual source page
- [x] You can submit a reply and a flashed message and new row appears
- [x] You cannot submit an empty reply
- [x] Clicking "Delete Source And Submissions" and the source and docs are deleted
- [x] You can click on a document and successfully decrypt using application private key

### Basic Tails Testing

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [ ] The Updater GUI appears on boot 

### 0.12.2-specific changes

- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/__init.__py:L111`.
- [ ] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [x] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`.
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface
- [x] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing)
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

# QA plan
- NUCs
- Mac Minis
- 1U servers in SF

## 0.12.2 QA Checklist

For both upgrades and fresh installs, here is a list of functionality that requires testing. You can use this for copy/pasting into your QA report. Feel free to edit this message to update the plan as appropriate.

If you have submitted a QA report already for a 0.12.1 release candidate with successful basic server testing and application acceptance testing sections, then you can skip these sections in subsequent reports, unless otherwise indicated by the Release Manager. This is to ensure that you focus your QA effort on the 0.12.1-specific changes as well as changes since the previous release candidate.

### Environment

- Install target: SF 1U servers
- Tails version: 3.13.1
- Test scenario: cron-apt update from 0.12.1 (Xenial)
- Server locale setting: (choose non-English to test #4219)
- SSH over Tor: enabled
- Release candidate: 0.12.2~rc1
- General notes:

### Basic Server Testing

- [x] I can access both the source and journalist interfaces
- [x] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [x] 0 processes are running unconfined
- [x] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [x] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [ ] OSSEC emails are decrypted to correct key and I am able to decrypt them - **untested, no access to current email/key**
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html
- [x] If doing upgrade testing, make a backup on 0.12.0 and restore this backup on 0.12.1
- [ ] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent. **can't verify, no access to email/key**

### Application Acceptance Testing

#### Source Interface

##### Landing page base cases
- [x] JS warning bar does not appear when using Security Slider high
- [x] JS warning bar does appear when using Security Slider Low

##### First submission base cases
- [x] On generate page, refreshing codename produces a new 7-word codename
- [x] On submit page, empty submissions produce flashed message
- [x] On submit page, short message submitted successfully
- [x] On submit page, file greater than 500 MB produces "The connection was reset" in Tor Browser _quickly_ before the entire file is uploaded
- [x] On submit page, file less than 500 MB submitted successfully

##### Returning source base cases

- [x] Nonexistent codename cannot log in
- [x] Empty codename cannot log in
- [x] Legitimate codename can log in
- [x] Returning user can view journalist replies - need to log into journalist interface to test

#### Journalist Interface

##### Login base cases
- [x] Can log in with 2FA tokens
- [x] incorrect password cannot log in
- [x] invalid 2fa token cannot log in
- [x] 2fa immediate reuse cannot log in

##### Index base cases
- [x] Filter by codename works
- [x] Starring and unstarring works
- [x] Click select all selects all submissions
- [x] Selecting all and clicking "Download" works

##### Individual source page
- [x] You can submit a reply and a flashed message and new row appears
- [x] You cannot submit an empty reply
- [x] Clicking "Delete Source And Submissions" and the source and docs are deleted
- [ ] You can click on a document and successfully decrypt using application private key **not tested, don't have private key**

### Basic Tails Testing

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [x] The Updater GUI appears on boot 

### 0.12.2-specific changes

- [ ] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/__init.__py:L111`. **not tested, updated from Xenial to Xenial**`
- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [x] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`. **passed, but server under test has 48GB physical memory, so inconclusive*
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface
- [ ] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing) **not tested, no access to email/key**
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

### Preflight 

- [ ] Ensure the builder image is up-to-date on release day

These tests should be performed the day of release prior to live debian packages on apt.freedom.press

#### Basic testing

- [ ] Install or upgrade occurs without error
- [ ] Source interface is available and version string indicates it is 0.12.1
- [ ] A message can be successfully submitted 

#### Tails

- [ ] The updater GUI appears on boot
- [ ] The update successfully occurs to 0.12.1
- [ ] After reboot, updater GUI no longer appears

### Environment

- Install target: NUC5PYH
- Tails version: 0.13.1
- Test scenarios:

1. Installation of 0.12.1 on Trusty, cron-apt simulated upgrade to 0.12.2 again on Trusty
2. Installation of 0.12.1 on Trusty, backup, install 0.12.2 via cron-apt, upgrade in place to Xenial, restore from Trusty backup
- Server locale setting: en_US
- SSH over Tor: Yes
- Release candidate: 0.12.2~rc1
- General notes:

### Basic Server Testing

- [x] I can access both the source and journalist interfaces
- [x] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [x] 0 processes are running unconfined
- [x] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [x] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [x] OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html
- [x] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2
- [x] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent.

### Application Acceptance Testing
<TBD>

### Basic Tails Testing

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [x] The Updater GUI appears on boot 

### 0.12.2-specific changes

- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/__init.__py:L111`.
- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [x] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`.
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface
- [x] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing)
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

Environment
* Install target: Mac Mini
* Tails version: 0.13.1
* Test scenarios:

1. Installation of 0.12.1 on Trusty, cron-apt simulated upgrade to 0.12.2~rc2 again on Trusty

* Server locale setting: en_US
* SSH over Tor: Yes
* Release candidate: 0.12.2~rc2

# Basic Server Testing
- [x]  I can access both the source and journalist interfaces
- [x]  I can SSH into both machines over Tor
- [x]  AppArmor is loaded on app
- [x]      0 processes are running unconfined
- [x]  AppArmor is loaded on mon
- [x]      0 processes are running unconfined
- [x]  Both servers are running grsec kernels
- [x]  iptables rules loaded
- [x]  OSSEC emails begin to flow after install
- [x]  OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] QA Matrix checks pass (:warning: except those that require CPU microcode updates, see QA matrix)

# Command Line User Generation
- [x] Can successfully add admin user and login

# Administration
- [ ] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html - DID NOT TEST
- [ ] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2 - DID NOT TEST
- [ ] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent. - DID NOT TEST

## Basic Tails Testing
### Updater GUI
After updating to this release candidate and running securedrop-admin tailsconfig
- [x] The Updater GUI appears on boot 

# 0.12.2-specific changes
- [x] (#4325): On 14.04 Trusty, the source interface disabled page appears when TRUSTY_DISABLE_DATE is set to a date in the past in /var/www/securedrop/source_app/__init.__py:L111.
- [ ] (#4325): On 16.04, after following the instructions above, the source interface is still working. - DID NOT TEST
- [ ] (#4326): Create a large file in /var/lib/securedrop/store (>1GB), backup should not fail with MemoryError. - DID NOT TEST
- [x] (#4319): NoScript XSS no longer appears on source interface
- [ ] (#4340: Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing) - DID NOT TEST
- [x] (#4305: uname -r returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in /var/log/syslog

### Environment

- Install target: NUC5PYH
- Tails version: 0.13.1
- Test scenario:
1. Installation of 0.12.1 on Trusty, cron-apt simulated upgrade to 0.12.2~rc2 again on Trusty, 
2. Installation of 0.12.1 on Trusty, backup, install 0.12.2 via cron-apt, upgrade in place to Xenial, restore from Trusty backup
- Server locale setting: en_US
- SSH over Tor: No
- Release candidate: 0.12.2~rc2
- General notes:

### Basic Server Testing

- [X] I can access both the source and journalist interfaces
- [X] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [X] 0 processes are running unconfined
- [X] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [X] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [x] OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html 
- [x] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2
- [x] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent.

### Application Acceptance Testing (DID NOT TEST)

#### Source Interface

##### Landing page base cases
- [ ] JS warning bar does not appear when using Security Slider high
- [ ] JS warning bar does appear when using Security Slider Low

##### First submission base cases
- [ ] On generate page, refreshing codename produces a new 7-word codename
- [ ] On submit page, empty submissions produce flashed message
- [ ] On submit page, short message submitted successfully
- [ ] On submit page, file greater than 500 MB produces "The connection was reset" in Tor Browser _quickly_ before the entire file is uploaded
- [ ] On submit page, file less than 500 MB submitted successfully

##### Returning source base cases

- [ ] Nonexistent codename cannot log in
- [ ] Empty codename cannot log in
- [ ] Legitimate codename can log in
- [ ] Returning user can view journalist replies - need to log into journalist interface to test

#### Journalist Interface

##### Login base cases
- [ ] Can log in with 2FA tokens
- [ ] incorrect password cannot log in
- [ ] invalid 2fa token cannot log in
- [ ] 2fa immediate reuse cannot log in

##### Index base cases
- [ ] Filter by codename works
- [ ] Starring and unstarring works
- [ ] Click select all selects all submissions
- [ ] Selecting all and clicking "Download" works

##### Individual source page
- [ ] You can submit a reply and a flashed message and new row appears
- [ ] You cannot submit an empty reply
- [ ] Clicking "Delete Source And Submissions" and the source and docs are deleted
- [ ] You can click on a document and successfully decrypt using application private key

### Basic Tails Testing (DID NOT TEST)

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [ ] The Updater GUI appears on boot 

### 0.12.2-specific changes

- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/disable.py`.
- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [ ] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`. DID NOT TEST
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface 
- [x] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing)
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

### 0.12.2-rc2-specific changes
- When deleting a source:
- [x] There are no errors in /var/log/apache2/journalist-error.log
- [x] There are no AppArmor violations in /var/log/syslog
- [x] `gpg --homedir /var/lib/securedrop/keys/pubring.gpg` as www-data user no longer contains the deleted source public key
- [x] /var/lib/securedrop/keys/private-keys-v1.d does not contain the deleted source's private key

### Environment

- Install target: 16.04 VMs
- Tails version: 0.13.1
- Server locale setting: en_US
- SSH over Tor: no
- Release candidate: 0.12.2~rc2
- General notes:

### Basic Server Testing

- [x] I can access both the source and journalist interfaces
- [x] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [x] 0 processes are running unconfined
- [x] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [x] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [x] OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html
- [x] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2
- [x] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent.

### Application Acceptance Testing

#### Source Interface

##### Landing page base cases
- [x] JS warning bar does not appear when using Security Slider high
- [x] JS warning bar does appear when using Security Slider Low

##### First submission base cases
- [x] On generate page, refreshing codename produces a new 7-word codename
- [x] On submit page, empty submissions produce flashed message
- [x] On submit page, short message submitted successfully
- [x] On submit page, file greater than 500 MB produces "The connection was reset" in Tor Browser _quickly_ before the entire file is uploaded
- [x] On submit page, file less than 500 MB submitted successfully

##### Returning source base cases

- [x] Nonexistent codename cannot log in
- [x] Empty codename cannot log in
- [x] Legitimate codename can log in
- [x] Returning user can view journalist replies - need to log into journalist interface to test

#### Journalist Interface

##### Login base cases
- [x] Can log in with 2FA tokens
- [x] incorrect password cannot log in
- [x] invalid 2fa token cannot log in
- [x] 2fa immediate reuse cannot log in

##### Index base cases
- [x] Filter by codename works
- [x] Starring and unstarring works
- [x] Click select all selects all submissions
- [x] Selecting all and clicking "Download" works

##### Individual source page
- [x] You can submit a reply and a flashed message and new row appears
- [x] You cannot submit an empty reply
- [x] Clicking "Delete Source And Submissions" and the source and docs are deleted
- [x] You can click on a document and successfully decrypt using application private key

### Basic Tails Testing

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [ ] The Updater GUI appears on boot 

### 0.12.2-specific changes

- [ ] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/__init.__py:L111`. (DID NOT TEST)
- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [x] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`.
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface
- [x] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing)
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

### Environment

- Install target: NUC 7i5BNH
- Tails version: 3.13.1
- Test scenario: Installation of 0.12.2 on Xenial
- Server locale setting: en_US
- SSH over Tor: only as needed for specific tests
- Release candidate: 0.12.2~rc2
- General notes:

### Basic Server Testing

- [x] I can access both the source and journalist interfaces
- [x] I can SSH into both machines over Tor
- [x] AppArmor is loaded on app
    - [x] 0 processes are running unconfined
- [x] AppArmor is loaded on mon
    - [x] 0 processes are running unconfined
- [x] Both servers are running grsec kernels
- [x] iptables rules loaded
- [x] OSSEC emails begin to flow after install
- [x] OSSEC emails are decrypted to correct key and I am able to decrypt them
- [x] [QA Matrix](https://docs.google.com/spreadsheets/d/1Ha6qKm2hYjoQQ2HTFvLmZ8tknm2jv76oBslpzOfT4Wg) checks pass

#### Command Line User Generation

- [x] Can successfully add admin user and login

#### Administration

- [x] I have backed up and successfully restored the app server following the documentation here: https://docs.securedrop.org/en/latest/backup_and_restore.html
- [ ] If doing upgrade testing, make a backup on 0.12.1 and restore this backup on 0.12.2
- [x] "Send Test OSSEC Alert" button in the journalist triggers an OSSEC alert and an email is sent.

### Application Acceptance Testing

#### Source Interface

##### Landing page base cases
- [x] JS warning bar does not appear when using Security Slider high
- [x] JS warning bar does appear when using Security Slider Low

##### First submission base cases
- [x] On generate page, refreshing codename produces a new 7-word codename
- [x] On submit page, empty submissions produce flashed message
- [x] On submit page, short message submitted successfully
- [x] On submit page, file greater than 500 MB produces "The connection was reset" in Tor Browser _quickly_ before the entire file is uploaded
- [x] On submit page, file less than 500 MB submitted successfully

##### Returning source base cases

- [x] Nonexistent codename cannot log in
- [x] Empty codename cannot log in
- [x] Legitimate codename can log in
- [x] Returning user can view journalist replies - need to log into journalist interface to test

#### Journalist Interface

##### Login base cases
- [x] Can log in with 2FA tokens
- [x] incorrect password cannot log in
- [x] invalid 2fa token cannot log in
- [x] 2fa immediate reuse cannot log in

##### Index base cases
- [x] Filter by codename works
- [x] Starring and unstarring works
- [x] Click select all selects all submissions
- [x] Selecting all and clicking "Download" works

##### Individual source page
- [x] You can submit a reply and a flashed message and new row appears
- [x] You cannot submit an empty reply
- [x] Clicking "Delete Source And Submissions" and the source and docs are deleted
- [x] You can click on a document and successfully decrypt using application private key

### Basic Tails Testing

#### Updater GUI

After updating to this release candidate and running `securedrop-admin tailsconfig`

- [x] The Updater GUI appears on boot

### 0.12.2-specific changes

- [ ] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 14.04 Trusty, the source interface disabled page appears when `TRUSTY_DISABLE_DATE` is set to a date in the past in `/var/www/securedrop/source_app/disable.py`.
- [x] ([#4325](https://github.com/freedomofpress/securedrop/pull/4325)): On 16.04, after following the instructions above, the source interface is still working.
- [x] ([#4326](https://github.com/freedomofpress/securedrop/pull/4326)): Create a large file in `/var/lib/securedrop/store` (>1GB), backup should not fail with `MemoryError`.
- [x] ([#4319](https://github.com/freedomofpress/securedrop/pull/4319)): NoScript XSS no longer appears on source interface
- [x] ([#4340](https://github.com/freedomofpress/securedrop/pull/4340): Go to Journalist Interface, click on Admin, navigate to Instance Config and click on "Send Test OSSEC Alert" button. An email is received. (note that this has now been added to basic server testing)
- [x] ([#4305](https://github.com/freedomofpress/securedrop/pull/4308): `uname -r` returns 4.4.177-grsec. The kernel boots, the application is functional and there are no errors in `/var/log/syslog`

### 0.12.2-rc2-specific changes
- When deleting a source:
- [x] There are no errors in /var/log/apache2/journalist-error.log
- [x] There are no AppArmor violations in /var/log/syslog
- [x] `gpg --homedir /var/lib/securedrop/keys/pubring.gpg` no longer contains the deleted source public key
- [x] /var/lib/securedrop/keys/private-keys-v1.d does not contain the deleted source's private key



Resolving patch:
diff --git a/molecule/vagrant-packager/package.py b/molecule/vagrant-packager/package.py
--- a/molecule/vagrant-packager/package.py
+++ b/molecule/vagrant-packager/package.py
@@ -233,7 +233,7 @@ def update_box_metadata(server_name, box_file, platform, version):
     with open(json_file, "r") as f:
         metadata_config = json.loads(f.read())
 
-    base_url = "https://s3.amazonaws.com/securedrop-vagrant"
+    base_url = "https://dev-bin.ops.securedrop.org/vagrant"
     box_name = os.path.basename(box_file)
     box_url = "{}/{}".format(base_url, box_name)
     box_checksum = sha256_checksum(box_file)
diff --git a/molecule/vagrant-packager/scripts/list_bucket.py b/molecule/vagrant-packager/scripts/list_bucket.py
new file mode 100755
--- /dev/null
+++ b/molecule/vagrant-packager/scripts/list_bucket.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+#
+#
+#
+#
+# Generate index.html of vagrant box files in our s3 bucket
+# and upload said file.
+
+import boto3
+import os
+
+
+class S3_Bucket_IndexCreator(object):
+    """ Class to initialize s3 bucket connection, grab contents, publish index """
+
+    def __init__(self, bucket, path):
+        self.s3 = boto3.resource('s3')
+        self.vagrant_bucket = self.s3.Bucket(name=bucket)
+        self.bucket = bucket
+        self.path = path
+
+    def bucket_get_list(self):
+        """ Get bucket file listings and return python list """
+
+        return [obj.key.split('/')[-1] for obj in
+                self.vagrant_bucket.objects.filter(Prefix=self.path) if
+                "index.html" not in obj.key]
+
+    def generate_html_index(self):
+        """Build a simple HTML index string from bucket listings"""
+
+        str_files = ["""<a href="{file}">{file}</a>""".format(file=f) for f in
+                     self.bucket_get_list()]
+
+        index_string = """
+            <html><head><title>Index of /{path}/</title></head><body bgcolor="white">
+            <h1>Index of /{path}/</h1><hr><pre>{files}</pre><hr></body></html>""".format(
+                path=self.path,
+                files="<br>".join(str_files)
+            )
+
+        return index_string
+
+    def upload_string_as_file(self,
+                              contents,
+                              filename="index.html",
+                              content_type="text/html"):
+
+        """ Take contents of a file as input and dump that to a file """
+        object = self.s3.Object(self.bucket, '{}/{}'.format(self.path, filename))
+        object.put(Body=contents,
+                   ContentType=content_type)
+
+
+if __name__ == "__main__":
+    BUCKET = os.environ.get('BUCKET', 'dev-bin.ops.securedrop.org')
+    BUCKET_PATH = os.environ.get('BUCKET_PATH', 'vagrant/')
+
+    bucket_index_creation = S3_Bucket_IndexCreator(BUCKET, BUCKET_PATH)
+    index = bucket_index_creation.generate_html_index()
+    bucket_index_creation.upload_string_as_file(index)


Test patch: