Skip to content

Commit

Permalink
[all] Introduce file storage for export download and new connector ar…
Browse files Browse the repository at this point in the history
…chitecture (#130)

* Starting work around minio

* Introduce File manager component and use it in report

* Adapt file manager UI

* Prepare the export api

* Refactor to move import and export files at stix entity level

* Adapt view and backend to log file actions

* Add file management in thread actors

* Refactor functions to move everything we need at StixDomainEntity level

* Remove unused info and add capacity to delete in progress export after 5 min

* Adapt deletion + fix dependencies errors from yarn control

* Start transformation of the worker. Provide API round queue management

* Introducing Jobs and failure reporting

* Re activate auto refresh

* Add jobs management, massive update

* Fix relayjs query typo

* Introduce global import menu. Adapt the entity import and export

* Fixing tests by replacing the matchAll function

* Handle deletion of global imports

* Remove unused import

* Adapt usage of interface, update of dependencies

* [frontend/api] Introduce key for internal_id and stix_id for avoid race conditions (#217)

* [api] Fix migations if starting fresh (#217)

* [api] Fix migations if starting fresh (#217)

* [api] Fix migations if starting fresh (#217)

* [api] Fix migations if starting fresh (#217)

* Adapt work and jobs to use elastic. Worker changed to report jobs

* Cleanup the grakn schema

* [frontend] Working on diagram!

* Fix comments

* Add delete button in observable enrichment

* [frontend] Working on graph

* Upgrade dependencies

* Refactoring of createdByRef, markingDef and KillChain functions

* Fix duplicate and adapt readtx

* Fix deepScan warning

* Fix deepScan warning

* [frontend] Handle relation to relation in the knowledge graph

* Adapt schema for internal_id_key

* Adapt for internal_key

* [frontend] Handle relation to relation

* [frontend] Graph is now working (#34)

* [frontend] Graph is now working (#34)

* [frontend] Add marking definitions to StixDOmainEntity edition

* [frontend] Add marking definitions to StixDOmainEntity edition

* [frontend] Fix relation actions icons and entities update

* [api/frontend] Enhance display and fix some bugs

* [frontend] Refactor the views of files management
  • Loading branch information
Samuel Hassine committed Oct 22, 2019
1 parent 81c1e28 commit 2fae0e4
Show file tree
Hide file tree
Showing 163 changed files with 7,177 additions and 4,358 deletions.
14 changes: 1 addition & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@ jobs:
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/public/ ./opencti-platform/opencti-graphql/public/
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/dist/ ./opencti-platform/opencti-graphql/dist/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ~/opencti/opencti-worker/src/ ./opencti-worker-import/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ~/opencti/opencti-worker/src/ ./opencti-worker-export/
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/dist/ ./opencti-platform/opencti-graphql/dist/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ./opencti-connectors/ ./opencti-connectors-enabled/
Expand Down Expand Up @@ -147,12 +141,6 @@ jobs:
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/dist/ ./opencti-platform/opencti-graphql/dist/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ~/opencti/opencti-worker/src/ ./opencti-worker-import/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ~/opencti/opencti-worker/src/ ./opencti-worker-export/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ./opencti-connectors/ ./opencti-connectors-enabled/
Expand Down
13 changes: 13 additions & 0 deletions opencti-platform/opencti-front/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* config-overrides.js */

module.exports = function override(config) {
config.module.rules.push(
{
test: /\.mjs$/,
include: /node_modules\/react-relay-network-modern/,
type: 'javascript/auto',
},
);
config.resolve.extensions.push('.mjs');
return config;
};
50 changes: 30 additions & 20 deletions opencti-platform/opencti-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Luatix",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@date-io/moment": "^1.3.6",
"@date-io/moment": "^1.3.11",
"@material-ui/core": "^4.5.1",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.29",
Expand All @@ -15,6 +15,7 @@
"classnames": "^2.2.6",
"countdown": "^2.6.0",
"dagre": "^0.8.4",
"extract-files": "^5.0.1",
"formik": "^1.5.8",
"formik-material-ui": "^0.0.22",
"graphql": "^14.5.8",
Expand All @@ -23,30 +24,29 @@
"js-file-download": "^0.4.8",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.15",
"mdi-material-ui": "^6.7.0",
"mdi-material-ui": "^6.8.0",
"moment": "^2.24.0",
"moment-timezone": "^0.5.26",
"object-hash": "^1.3.1",
"moment-timezone": "^0.5.27",
"object-hash": "^2.0.0",
"prop-types": "^15.7.2",
"ramda": "^0.26.1",
"react": "^16.10.1",
"react": "^16.10.2",
"react-color": "^2.17.3",
"react-csv": "^1.1.1",
"react-document-title": "^2.0.3",
"react-dom": "^16.10.1",
"react-dom": "^16.10.2",
"react-grid-layout": "^0.16.6",
"react-intl": "^2.9.0",
"react-markdown": "^4.2.2",
"react-particles-js": "^2.7.0",
"react-relay": "^6.0.0",
"react-relay-network-modern": "^4.1.0",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.1.2",
"react-select": "^3.0.8",
"react-swipeable-views": "^0.13.3",
"react-virtualized": "^9.21.1",
"react-window-dimensions": "^1.0.2",
"recharts": "^1.7.1",
"recharts": "^1.8.3",
"relay-compiler": "^6.0.0",
"relay-runtime": "^6.0.0",
"rxjs": "^6.5.3",
Expand All @@ -57,35 +57,45 @@
"yup": "^0.27.0"
},
"devDependencies": {
"@storybook/addon-actions": "^5.2.1",
"@storybook/addon-links": "^5.2.1",
"@storybook/addons": "^5.2.1",
"@storybook/react": "^5.2.1",
"@storybook/addon-actions": "^5.2.4",
"@storybook/addon-links": "^5.2.4",
"@storybook/addons": "^5.2.4",
"@storybook/react": "^5.2.4",
"babel-core": "^6.26.3",
"babel-runtime": "^6.26.0",
"cross-env": "^6.0.0",
"core-js": "^2.6.10",
"cross-env": "^6.0.3",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.3.0",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.15.0",
"eslint-plugin-react": "^7.16.0",
"fs-extra": "^8.1.0",
"prettier": "^1.18.2",
"relay-devtools": "^1.4.0"
"relay-compiler": "^6.0.0",
"react-app-rewired": "^2.1.3",
"relay-devtools": "^1.4.0",
"react-scripts": "^3.2.0"
},
"babelMacros": {
"relay": {}
},
"resolutions": {
"**/lodash": "4.17.15"
},
"engines": {
"node": ">= 10.*"
},
"scripts": {
"start": "yarn relay && react-scripts start",
"generate": "cross-env GENERATE_SOURCEMAP=false PUBLIC_URL=%BASE_PATH% react-scripts build",
"start": "yarn relay && react-app-rewired start",
"generate": "cross-env GENERATE_SOURCEMAP=false PUBLIC_URL=%BASE_PATH% react-app-rewired build",
"build": "yarn relay && yarn generate && node src/setupBuild.js",
"lint": "eslint .",
"test": "react-scripts test",
"eject": "react-scripts eject",
"test": "react-app-rewired test",
"storybook": "start-storybook -p 9009 -s public",
"build-storybook": "build-storybook -s public",
"control": "yarn audit --groups dependencies --summary",
"relay": "relay-compiler --watchman false --src ./src --schema ../opencti-graphql/config/schema/opencti.graphql --extensions js jsx"
},
"eslintConfig": {
Expand Down
22 changes: 21 additions & 1 deletion opencti-platform/opencti-front/src/components/ItemIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
Fire,
CityVariant,
Tag,
ProgressWrench,
HexagonOutline,
VectorRadius,
} from 'mdi-material-ui';

const iconSelector = (type, variant, fontSize, color) => {
Expand Down Expand Up @@ -63,6 +66,8 @@ const iconSelector = (type, variant, fontSize, color) => {
return <AccountBalance style={style} fontSize={fontSize} />;
case 'attack-pattern':
return <LockPattern style={style} fontSize={fontSize} />;
case 'course-of-action':
return <ProgressWrench style={style} fontSize={fontSize} />;
case 'malware':
return <Biohazard style={style} fontSize={fontSize} />;
case 'tool':
Expand All @@ -71,6 +76,8 @@ const iconSelector = (type, variant, fontSize, color) => {
return <BugReport style={style} fontSize={fontSize} />;
case 'report':
return <Description style={style} fontSize={fontSize} />;
case 'tag':
return <Tag style={style} fontSize={fontSize} />;
case 'domain':
case 'ipv4-addr':
case 'ipv6-addr':
Expand All @@ -81,7 +88,20 @@ const iconSelector = (type, variant, fontSize, color) => {
case 'file-md5':
case 'file-sha1':
case 'file-sha256':
return <Tag style={style} fontSize={fontSize} />;
return <HexagonOutline style={style} fontSize={fontSize} />;
case 'targets':
case 'uses':
case 'related-to':
case 'mitigates':
case 'impersonates':
case 'indicates':
case 'comes-after':
case 'attributed-to':
case 'variant-of':
case 'localization':
case 'gathering':
case 'drops':
return <VectorRadius style={style} fontSize={fontSize} />;
default:
return <Help style={style} fontSize={fontSize} />;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { NodeModel } from 'storm-react-diagrams';
import EntityPortModel from './EntityPortModel';
import GlobalPortModel from './GlobalPortModel';

export default class EntityNodeModel extends NodeModel {
constructor(data) {
super('entity');
this.addPort(new EntityPortModel('main'));
this.addPort(new GlobalPortModel('main'));
this.extras = data;
this.expandable = false;
}

setSelected(selected, expand = false) {
setSelectedCustom(selected, edit = false, remove = false) {
this.selected = selected;
this.iterateListeners((listener, event) => {
if (listener.selectionChanged) {
listener.selectionChanged({ ...event, expand, isSelected: selected });
listener.selectionChanged({
...event,
edit,
remove,
isSelected: selected,
});
}
});
}

getPosition() {
return { x: this.x, y: this.y };
}

setExpandable(expandable) {
this.expandable = expandable;
setExtras(data) {
this.extras = data;
}

getExpandable() {
return this.expandable;
getPosition() {
return { x: this.x, y: this.y };
}
}
Loading

0 comments on commit 2fae0e4

Please sign in to comment.