diff options
-rw-r--r-- | .dependabot/config.yml | 7 | ||||
-rw-r--r-- | .travis.yml | 16 | ||||
-rw-r--r-- | appinfo/info.xml | 17 | ||||
-rw-r--r-- | lib/Monitor.php | 9 | ||||
-rw-r--r-- | package.json | 222 |
5 files changed, 148 insertions, 123 deletions
diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 0000000..56423d0 --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,7 @@ +version: 1
+update_configs:
+ # Keep package.json (& lockfiles) secure and up-to-date,
+ # batching pull requests daily
+ - package_manager: "javascript"
+ directory: "/"
+ update_schedule: "daily"
\ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 94d7634..06e2cd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: php env: global: - - CORE_BRANCH=stable19 + - CORE_BRANCH=stable20 - APP_NAME=ransomware_detection - KRANKERL_VERSION=0.12.3 @@ -26,42 +26,42 @@ jobs: - env: "CHECKSTYLE=2" include: - stage: test - php: 7.2 + php: 7.3 env: - DB=mysql script: - cd apps/$APP_NAME/ - phpunit --configuration phpunit.xml - stage: test - php: 7.2 + php: 7.3 env: - DB=pgsql script: - cd apps/$APP_NAME/ - phpunit --configuration phpunit.xml - stage: test - php: 7.2 + php: 7.3 env: - DB=mysql script: - cd apps/$APP_NAME/ - phpunit --configuration phpunit.xml - stage: test - php: 7.2 + php: 7.3 env: - DB=mysql - CHECKSTYLE=1 script: - ./occ app:check-code $APP_NAME -c private -c strong-comparison - stage: test - php: 7.2 + php: 7.3 env: - DB=mysql - CHECKSTYLE=2 script: - ./occ app:check-code $APP_NAME -c deprecation - stage: report - php: 7.2 + php: 7.3 env: - DB=sqlite script: @@ -69,7 +69,7 @@ jobs: - wget https://codecov.io/bash -O codecov.sh - bash codecov.sh - stage: release - php: 7.2 + php: 7.3 env: - DB=sqlite script: diff --git a/appinfo/info.xml b/appinfo/info.xml index 9ed70cd..0c40b02 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -3,8 +3,21 @@ xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd"> <id>ransomware_detection</id> <name>Ransomware recovery</name> - <summary><![CDATA[This app offers synchronization monitoring and a file storage scanner for a guided user-controlled one-step ransomare recovery.]]></summary> - <description><![CDATA[This app monitors file operations during the synchronization to detect ransomware attacks and also offers a post infection file storage scanner, which works even if it happend that you didn't have this app installed during an attack. This is done by using generic indicators for a guided user-controlled one-step recovery utilizing the integrated file versioning methods. Sponsored by the German Federal Ministry of Education and Research, and Prototype Fund.]]></description> + <summary><![CDATA[Ransomware detection with a guided user-controlled one-step recovery.]]></summary> + <description><![CDATA[This app monitors file operations during the synchronization to detect ransomware attacks. This is done by using generic indicators for a guided user-controlled one-step recovery utilizing the integrated file versioning methods. + + ## Frequently Asked Questions + + * *Can the Ransomware Recovery app used together with the Nextcloud official Ransomware Protection app?* + Yes, it can be used together with the Nextloud official Ransomware Protection app. + + * *What's the difference between the Ransomware Recovery app and the Nextcloud official Ransomware Protection app?* + The difference between this apps is pretty simple: The Nextcloud official Ransomware Protection app uses white- and blacklisting of file extensions to protect you against ransomware files, this only works for already known ransomware families. + In contrast, the Ransomware Recovery app utilises the ransomware behaviour to mark possible ransomware attacks with an user-controlled recovery to give an easy-to-use mechanism to recover from unknown ransomware families. + + ## Acknowledgements + + Sponsored by the German Federal Ministry of Education and Research, and Prototype Fund.]]></description> <version>0.9.0</version> <licence>agpl</licence> <author mail="matthias.held@uni-konstanz.de">Matthias Held</author> diff --git a/lib/Monitor.php b/lib/Monitor.php index b1dad47..66cb750 100644 --- a/lib/Monitor.php +++ b/lib/Monitor.php @@ -136,6 +136,11 @@ class Monitor public function analyze($paths, $mode) { $path = $paths[0]; + + if ($path === '') { + $this->logger->debug("Path is empty."); + return; + } $storage = $this->rootFolder->getUserFolder($this->userId)->get(dirname($path))->getStorage(); if ($this->userId === null || $this->nestingLevel !== 0 || /*!$this->isUploadedFile($storage, $path) ||*/ $this->isCreatingSkeletonFiles()) { @@ -216,7 +221,7 @@ class Monitor return; case self::DELETE: - $this->logger->debug("Delete", ['app' => Application::APP_ID]); + $this->logger->debug("Delete ".$path, ['app' => Application::APP_ID]); // reset PROPFIND_COUNT $this->resetProfindCount(); @@ -242,7 +247,7 @@ class Monitor return; case self::CREATE: - $this->logger->debug("Create", ['app' => Application::APP_ID]); + $this->logger->debug("Create ".$path, ['app' => Application::APP_ID]); // reset PROPFIND_COUNT $this->resetProfindCount(); diff --git a/package.json b/package.json index 4f7b9b9..b8e2173 100644 --- a/package.json +++ b/package.json @@ -1,113 +1,113 @@ { - "name": "ransomware_detection", - "version": "0.1.0", - "description": "[![Build Status](https://travis-ci.com/undo-ransomware/ransomware_detection.svg?branch=master)](https://travis-ci.com/undo-ransomware/ransomware_detection)\r [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/undo-ransomware/ransomware_detection/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/undo-ransomware/ransomware_detection/?branch=master)\r [![codecov](https://codecov.io/gh/undo-ransomware/ransomware_detection/branch/master/graph/badge.svg)](https://codecov.io/gh/undo-ransomware/ransomware_detection)", - "main": "main.js", - "directories": { - "lib": "lib", - "test": "tests" - }, - "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config webpack.dev.js", - "watch": "cross-env NODE_ENV=development webpack --progress --watch --config webpack.dev.js", - "build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js", - "lint": "eslint --ext .js,.vue src", - "lint:fix": "eslint --ext .js,.vue src --fix", - "test": "jest", - "test:coverage": "jest --coverage" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/undo-ransomware/ransomware_detection.git" - }, - "author": "Matthias Held", - "license": "AGPL-3.0-or-later", - "bugs": { - "url": "https://github.com/undo-ransomware/ransomware_detection/issues" - }, - "homepage": "https://github.com/undo-ransomware/ransomware_detection#readme", - "engines": { - "node": ">=10.0.0" - }, - "dependencies": { - "@polymer/iron-icon": "^3.0.1", - "@polymer/iron-icons": "^3.0.1", - "@polymer/iron-pages": "^3.0.1", - "@polymer/paper-button": "^3.0.1", - "@polymer/paper-card": "^3.0.1", - "@polymer/paper-spinner": "^3.0.2", - "core-js": "^3.0.1", - "moment": "^2.24.0", - "nextcloud-axios": "^0.2.0", - "nextcloud-server": "^0.15.9", - "nextcloud-vue": "^0.11.4", - "time-elements": "^2.0.2", - "vue": "^2.6.10", - "vue-async-computed": "^3.7.0", - "vue-moment": "^4.0.0", - "vue-router": "^3.0.6", - "vuetify": "^2.3.10", - "vuetify-loader": "^1.6.0", - "vuex-router-sync": "^5.0.0" - }, - "devDependencies": { - "@babel/core": "^7.4.5", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.4.4", - "@babel/preset-env": "^7.4.5", - "@babel/runtime": "^7.4.5", - "@vue/test-utils": "^1.0.0-beta.29", - "acorn": "^6.1.1", - "babel-eslint": "^10.0.1", - "babel-jest": "^24.8.0", - "babel-loader": "^8.0.6", - "cross-env": "^5.2.0", - "css-loader": "^2.1.1", - "deepmerge": "^4.2.2", - "eslint": "^5.16.0", - "eslint-config-standard": "^12.0.0", - "eslint-friendly-formatter": "^4.0.1", - "eslint-loader": "^2.1.1", - "eslint-plugin-import": "^2.17.3", - "eslint-plugin-node": "^8.0.1", - "eslint-plugin-promise": "^4.1.1", - "eslint-plugin-standard": "^4.0.0", - "eslint-plugin-vue": "^5.2.2", - "fibers": "^5.0.0", - "file-loader": "^3.0.1", - "jest": "^24.8.0", - "jest-serializer-vue": "^2.0.2", - "node-sass": "^4.12.0", - "prettier-eslint": "^8.8.2", - "raw-loader": "^2.0.0", - "sass": "^1.26.11", - "sass-loader": "^7.3.1", - "style-loader": "^0.23.1", - "stylelint": "^8.4.0", - "stylelint-config-recommended-scss": "^3.3.0", - "stylelint-webpack-plugin": "^0.10.5", - "vue-jest": "^3.0.4", - "vue-loader": "^15.7.0", - "vue-style-loader": "^4.1.1", - "vue-template-compiler": "^2.6.10", - "webpack": "^4.32.2", - "webpack-cli": "^3.3.2", - "webpack-merge": "^4.2.1" - }, - "jest": { - "moduleFileExtensions": [ - "js", - "vue" - ], - "moduleNameMapper": { - "^@/(.*)$": "<rootDir>/src/$1" - }, - "transform": { - "^.+\\.js$": "<rootDir>/node_modules/babel-jest", - ".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" - }, - "snapshotSerializers": [ - "<rootDir>/node_modules/jest-serializer-vue" - ] - } + "name": "ransomware_detection", + "version": "0.1.0", + "description": "[![Build Status](https://travis-ci.com/undo-ransomware/ransomware_detection.svg?branch=master)](https://travis-ci.com/undo-ransomware/ransomware_detection)\r [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/undo-ransomware/ransomware_detection/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/undo-ransomware/ransomware_detection/?branch=master)\r [![codecov](https://codecov.io/gh/undo-ransomware/ransomware_detection/branch/master/graph/badge.svg)](https://codecov.io/gh/undo-ransomware/ransomware_detection)", + "main": "main.js", + "directories": { + "lib": "lib", + "test": "tests" + }, + "scripts": { + "dev": "cross-env NODE_ENV=development webpack --config webpack.dev.js", + "watch": "cross-env NODE_ENV=development webpack --progress --watch --config webpack.dev.js", + "build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js", + "lint": "eslint --ext .js,.vue src", + "lint:fix": "eslint --ext .js,.vue src --fix", + "test": "jest", + "test:coverage": "jest --coverage" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/undo-ransomware/ransomware_detection.git" + }, + "author": "Matthias Held", + "license": "AGPL-3.0-or-later", + "bugs": { + "url": "https://github.com/undo-ransomware/ransomware_detection/issues" + }, + "homepage": "https://github.com/undo-ransomware/ransomware_detection#readme", + "engines": { + "node": ">=10.0.0" + }, + "dependencies": { + "@polymer/iron-icon": "^3.0.1", + "@polymer/iron-icons": "^3.0.1", + "@polymer/iron-pages": "^3.0.1", + "@polymer/paper-button": "^3.0.1", + "@polymer/paper-card": "^3.0.1", + "@polymer/paper-spinner": "^3.0.2", + "core-js": "^3.0.1", + "moment": "^2.24.0", + "nextcloud-axios": "^0.2.0", + "nextcloud-server": "^0.15.9", + "nextcloud-vue": "^0.11.4", + "time-elements": "^2.0.2", + "vue": "^2.6.10", + "vue-async-computed": "^3.7.0", + "vue-moment": "^4.0.0", + "vue-router": "^3.0.6", + "vuetify": "^2.3.10", + "vuetify-loader": "^1.6.0", + "vuex-router-sync": "^5.0.0" + }, + "devDependencies": { + "@babel/core": "^7.4.5", + "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@babel/plugin-transform-runtime": "^7.4.4", + "@babel/preset-env": "^7.4.5", + "@babel/runtime": "^7.4.5", + "@vue/test-utils": "^1.0.0-beta.29", + "acorn": "^6.1.1", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.8.0", + "babel-loader": "^8.0.6", + "cross-env": "^5.2.0", + "css-loader": "^2.1.1", + "deepmerge": "^4.2.2", + "eslint": "^5.16.0", + "eslint-config-standard": "^12.0.0", + "eslint-friendly-formatter": "^4.0.1", + "eslint-loader": "^2.1.1", + "eslint-plugin-import": "^2.17.3", + "eslint-plugin-node": "^8.0.1", + "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-standard": "^4.0.0", + "eslint-plugin-vue": "^5.2.2", + "fibers": "^5.0.0", + "file-loader": "^3.0.1", + "jest": "^24.8.0", + "jest-serializer-vue": "^2.0.2", + "node-sass": "^4.12.0", + "prettier-eslint": "^8.8.2", + "raw-loader": "^2.0.0", + "sass": "^1.26.11", + "sass-loader": "^7.3.1", + "style-loader": "^0.23.1", + "stylelint": "^8.4.0", + "stylelint-config-recommended-scss": "^3.3.0", + "stylelint-webpack-plugin": "^0.10.5", + "vue-jest": "^3.0.4", + "vue-loader": "^15.7.0", + "vue-style-loader": "^4.1.1", + "vue-template-compiler": "^2.6.10", + "webpack": "^4.32.2", + "webpack-cli": "^3.3.2", + "webpack-merge": "^4.2.1" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "vue" + ], + "moduleNameMapper": { + "^@/(.*)$": "<rootDir>/src/$1" + }, + "transform": { + "^.+\\.js$": "<rootDir>/node_modules/babel-jest", + ".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" + }, + "snapshotSerializers": [ + "<rootDir>/node_modules/jest-serializer-vue" + ] + } } |