Commit graph

28626 commits

Author SHA1 Message Date
Lukas Reschke
4971015544 Add code integrity check
This PR implements the base foundation of the code signing and integrity check. In this PR implemented is the signing and verification logic, as well as commands to sign single apps or the core repository.

Furthermore, there is a basic implementation to display problems with the code integrity on the update screen.

Code signing basically happens the following way:

- There is a ownCloud Root Certificate authority stored `resources/codesigning/root.crt` (in this PR I also ship the private key which we obviously need to change before a release 😉). This certificate is not intended to be used for signing directly and only is used to sign new certificates.
- Using the `integrity:sign-core` and `integrity:sign-app` commands developers can sign either the core release or a single app. The core release needs to be signed with a certificate that has a CN of `core`,  apps need to be signed with a certificate that either has a CN of `core` (shipped apps!)  or the AppID.
- The command generates a signature.json file of the following format:
```json
{
    "hashes": {
        "/filename.php": "2401fed2eea6f2c1027c482a633e8e25cd46701f811e2d2c10dc213fd95fa60e350bccbbebdccc73a042b1a2799f673fbabadc783284cc288e4f1a1eacb74e3d",
        "/lib/base.php": "55548cc16b457cd74241990cc9d3b72b6335f2e5f45eee95171da024087d114fcbc2effc3d5818a6d5d55f2ae960ab39fd0414d0c542b72a3b9e08eb21206dd9"
    },
    "certificate": "-----BEGIN CERTIFICATE-----MIIBvTCCASagAwIBAgIUPvawyqJwCwYazcv7iz16TWxfeUMwDQYJKoZIhvcNAQEF\nBQAwIzEhMB8GA1UECgwYb3duQ2xvdWQgQ29kZSBTaWduaW5nIENBMB4XDTE1MTAx\nNDEzMTcxMFoXDTE2MTAxNDEzMTcxMFowEzERMA8GA1UEAwwIY29udGFjdHMwgZ8w\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANoQesGdCW0L2L+a2xITYipixkScrIpB\nkX5Snu3fs45MscDb61xByjBSlFgR4QI6McoCipPw4SUr28EaExVvgPSvqUjYLGps\nfiv0Cvgquzbx/X3mUcdk9LcFo1uWGtrTfkuXSKX41PnJGTr6RQWGIBd1V52q1qbC\nJKkfzyeMeuQfAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvF/KIhRMQ3tYTmgHWsiM\nwDMgIDb7iaHF0fS+/Nvo4PzoTO/trev6tMyjLbJ7hgdCpz/1sNzE11Cibf6V6dsz\njCE9invP368Xv0bTRObRqeSNsGogGl5ceAvR0c9BG+NRIKHcly3At3gLkS2791bC\niG+UxI/MNcWV0uJg9S63LF8=\n-----END CERTIFICATE-----",
    "signature": "U29tZVNpZ25lZERhdGFFeGFtcGxl"
}
```
`hashes` is an array of all files in the folder with their corresponding SHA512 hashes (this is actually quite cheap to calculate), the `certificate` is the  certificate used for signing. It has to be issued by the ownCloud Root Authority and it's CN needs to be permitted to perform the required action. The `signature` is then a signature of the `hashes` which can be verified using the `certificate`.

Steps to do in other PRs, this is already a quite huge one:
- Add nag screen in case the code check fails to ensure that administrators are aware of this.
- Add code verification also to OCC upgrade and unify display code more.
- Add enforced code verification to apps shipped from the appstore with a level of "official"
- Add enfocrced code verification to apps shipped from the appstore that were already signed in a previous release
- Add some developer documentation on how devs can request their own certificate
- Check when installing ownCloud
- Add support for CRLs to allow revoking certificates

**Note:** The upgrade checks are only run when the instance has a defined release channel of `stable` (defined in `version.php`). If you want to test this, you need to change the channel thus and then generate the core signature:

```
➜  master git:(add-integrity-checker) ✗ ./occ integrity:sign-core --privateKey=resources/codesigning/core.key --certificate=resources/codesigning/core.crt
Successfully signed "core"
```

Then increase the version and you should see something like the following:

![2015-11-04_12-02-57](https://cloud.githubusercontent.com/assets/878997/10936336/6adb1d14-82ec-11e5-8f06-9a74801c9abf.png)

As you can see a failed code check will not prevent the further update. It will instead just be a notice to the admin. In a next step we will add some nag screen.

For packaging stable releases this requires the following additional steps as a last action before zipping:
1. Run `./occ integrity:sign-core` once
2. Run `./occ integrity:sign-app` _for each_ app. However, this can be simply automated using a simple foreach on the apps folder.
2015-12-01 11:55:20 +01:00
Thomas Müller
36660734a6 Merge pull request #20855 from owncloud/output-log-integration-tests
tail the server log and exit with the exit code of behat
2015-12-01 10:21:25 +01:00
Thomas Müller
f48ea593eb Merge pull request #20850 from owncloud/use-text-instead-of-html
Use .text instead of .html
2015-12-01 10:18:29 +01:00
Thomas Müller
f1bbc9a962 Merge pull request #20853 from owncloud/php-parser-1.4.1
[3rdparty] Bump php-parser
2015-12-01 10:17:17 +01:00
Thomas Müller
21e063a9e7 tail the server log and exit with the exit code of behat 2015-12-01 10:16:46 +01:00
Thomas Müller
634859e6ed Merge pull request #20825 from owncloud/scrutinizer-patch-1
Scrutinizer Auto-Fixes
2015-12-01 09:26:22 +01:00
Roeland Jago Douma
c024ff3dff [3rdparty] Bump php-parser 2015-12-01 09:22:55 +01:00
Thomas Müller
8a1e6c0ad9 Merge pull request #20851 from owncloud/tests-for-kill-rebuild-parser
[3rdparty] Remove some unrequired files
2015-12-01 09:07:32 +01:00
Lukas Reschke
f664405621 Remove some unrequired files 2015-12-01 08:11:42 +01:00
Jenkins for ownCloud
8421a43df1 [tx-robot] updated from transifex 2015-12-01 01:55:07 -05:00
Lukas Reschke
3ea654d2d4 Use .text instead of .html
Makes some static source code analyzers happier.
2015-11-30 23:49:27 +01:00
Thomas Müller
b0491bf930 Merge pull request #20828 from owncloud/sharing_integration_test_20645_morris
Sharing integration test 20645, added sabre dav and propfind check.
2015-11-30 23:06:25 +01:00
Thomas Müller
d6da0396d0 Adjust patches 2015-11-30 23:00:51 +01:00
Scrutinizer Auto-Fixer
dcbd603514 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-11-30 22:50:09 +01:00
Thomas Müller
802f226d8a Merge pull request #20842 from owncloud/fix-date-time-column
Fix column width of mtime column
2015-11-30 22:47:36 +01:00
Thomas Müller
e01f4be4d1 Merge pull request #20784 from owncloud/jeremeamia_superclosure_2.1.0
[3rdparty] bump jeremeamia/superclosure to 2.1.0
2015-11-30 22:45:29 +01:00
Thomas Müller
9e8c9ed9a5 Merge pull request #20829 from owncloud/dav-define-phpunit
Fix already defined warning from dav test bootstrap
2015-11-30 22:45:01 +01:00
Thomas Müller
54f0dec319 Merge pull request #20845 from owncloud/allow-di-in-apps
Allow DI the system tag stuff without Application class
2015-11-30 22:43:30 +01:00
Thomas Müller
060673a8b3 Merge pull request #20487 from owncloud/activity-oracle-sql-error-for-favorites
Activity oracle sql error for favorites
2015-11-30 22:43:06 +01:00
Thomas Müller
c57d0985dc Merge pull request #20832 from owncloud/update-js-dependencies
Update some JS dependencies
2015-11-30 22:42:23 +01:00
Thomas Müller
63a87c631b Merge pull request #20843 from owncloud/fix-share-with-input
Fix the width of the share with input
2015-11-30 17:38:27 +01:00
Thomas Müller
b6cc9f9d19 Merge pull request #20841 from owncloud/generate-response-using-xml-writer
Use XMLWriter to generate response
2015-11-30 17:32:32 +01:00
Joas Schilling
23046ca5b7 Inject the database connection 2015-11-30 17:14:47 +01:00
Joas Schilling
e9094b8a41 Only require the interface 2015-11-30 17:14:47 +01:00
Joas Schilling
6e0596432c Add a unit test that executes the query 2015-11-30 17:14:47 +01:00
Joas Schilling
2cdec74e8a Correctly escape the paths so we only display favorites instead of wildcards 2015-11-30 17:12:48 +01:00
Joas Schilling
623d34972d Oracle can not return statements but only values
So evaluate the condition directly and return 1 or 0
2015-11-30 17:12:48 +01:00
Joas Schilling
3c5a6b829e Allow DI the system tag stuff without Application class 2015-11-30 17:08:29 +01:00
Thomas Müller
b9faba8857 Merge pull request #20837 from owncloud/fix-mountoptions-dropdown
Fix ext storage mount options dropdown
2015-11-30 16:53:26 +01:00
Morris Jobke
00fcb95d86 Fix the width of the share with input
* the ID of this has changed to #shareWith-viewNUMBER and shouldn't
  be used in CSS
* now uses the proper classes
2015-11-30 16:46:51 +01:00
Morris Jobke
11d2d7a1bb Fix column width of mtime column
* in some translations (e.g. german) the header of this column otherwise
  got truncated
  "Zeitpunkt der Freigabe" vs "Zeitpunkt der Freig"
2015-11-30 16:29:15 +01:00
Sergio Bertolin
2c6e0da8f5 Change from with of 2015-11-30 14:49:35 +00:00
Lukas Reschke
574f9b1e3f Use XMLWriter to generate response
Gets rid of manual XML generation.
2015-11-30 15:40:10 +01:00
Thomas Müller
08248f66ba Merge pull request #20650 from owncloud/systemtags-core
Implement systemtag managers and mapper
2015-11-30 15:38:43 +01:00
Thomas Müller
fd79511d68 Merge pull request #20688 from owncloud/publiclink-getdownloadurl-webdav
Fix public link getDownloadUrl to return Webdav public link
2015-11-30 15:07:36 +01:00
Sergio Bertolin
69ca3a70d6 Added webdav test to check range downloads 2015-11-30 14:07:02 +00:00
Vincent Petry
dc962a1203 Fix ext storage mount options dropdown 2015-11-30 14:59:06 +01:00
Thomas Müller
364dbe611d Merge pull request #20834 from owncloud/aspdye-master
Update README.md
2015-11-30 14:37:01 +01:00
aspdye
e306aa6c72 Update README.md 2015-11-30 14:32:37 +01:00
Thomas Müller
995ceeb8d9 Merge pull request #20815 from owncloud/avatar-cache-size
cache resized avatars
2015-11-30 14:27:05 +01:00
Thomas Müller
fc21aa6c41 Merge pull request #20248 from owncloud/use-phpunit-groups-to-run-database-code-in-isolation
Use phpunit groups to run database code in isolation
2015-11-30 14:25:35 +01:00
Morris Jobke
42272de3a6 update bootstrap from 3.3.5 to 3.3.6 2015-11-30 14:12:57 +01:00
Morris Jobke
d8aa44d458 update backbone.js from 1.2.1 to 1.2.3 2015-11-30 14:12:48 +01:00
Robin Appelman
60d6582991 Fix already defined warning from dav test bootstrap 2015-11-30 13:58:39 +01:00
Joas Schilling
b8b0ae0944 Fix phpstorm complains in tests 2015-11-30 13:36:22 +01:00
Sergio Bertolin
52f6592991 Making propfinds, having depth in mind and checking it in gherkin description 2015-11-30 12:20:05 +00:00
Thomas Müller
b94aadc440 Cleanup imports and type hinting 2015-11-30 12:45:30 +01:00
Thomas Müller
a94819f4a4 Merge pull request #20809 from owncloud/dont-trust-update-server-message
Don't trust update server
2015-11-30 11:20:30 +01:00
Thomas Müller
dddfa6de78 Don't break app on travis 2015-11-30 10:55:13 +01:00
Thomas Müller
318e5e2864 More group DB 2015-11-30 10:55:13 +01:00