Skip to content

Commit

Permalink
[backend/frontend] [Playbook] Modify severity field with playbooks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahBocognano authored Jan 7, 2025
1 parent b05eb13 commit f2e7d91
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import MenuItem from '@mui/material/MenuItem';
import Tooltip from '@mui/material/Tooltip';
import Box from '@mui/material/Box';
import Alert from '@mui/material/Alert';
import OpenVocabField from '../../common/form/OpenVocabField';
import ObjectParticipantField from '../../common/form/ObjectParticipantField';
import ObjectAssigneeField from '../../common/form/ObjectAssigneeField';
import Drawer from '../../common/drawer/Drawer';
Expand Down Expand Up @@ -198,6 +199,8 @@ const PlaybookAddComponentsContent = ({
{ label: t_i18n('Score'), value: 'x_opencti_score', isMultiple: false },
{ label: t_i18n('Assignees'), value: 'objectAssignee', isMultiple: true },
{ label: t_i18n('Participants'), value: 'objectParticipant', isMultiple: true },
{ label: t_i18n('Severity'), value: 'severity', isMultiple: false },
{ label: t_i18n('Priority'), value: 'priority', isMultiple: false },
{
label: t_i18n('Detection'),
value: 'x_opencti_detection',
Expand Down Expand Up @@ -358,6 +361,28 @@ const PlaybookAddComponentsContent = ({
])}
/>
);
case 'severity':
return (
<OpenVocabField
name={`actions-${i}-value`}
type={'case_severity_ov'}
containerStyle={fieldSpacingContainerStyle}
onChange={(_, value) => handleChangeActionInput(i, 'value', [
{ label: value, value, patch_value: value },
])}
/>
);
case 'priority':
return (
<OpenVocabField
name={`actions-${i}-value`}
type={'case_priority_ov'}
containerStyle={fieldSpacingContainerStyle}
onChange={(_, value) => handleChangeActionInput(i, 'value', [
{ label: value, value, patch_value: value },
])}
/>
);
default:
return (
<Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { ENTITY_TYPE_MARKING_DEFINITION } from '../../schema/stixMetaObject';
import { schemaTypesDefinition } from '../../schema/schema-types';
import { ENTITY_TYPE_CONTAINER_GROUPING } from '../grouping/grouping-types';
import { generateCreateMessage } from '../../database/generate-message';
import { ENTITY_TYPE_CONTAINER_CASE } from '../case/case-types';

const extractBundleBaseElement = (instanceId: string, bundle: StixBundle): StixObject => {
const baseData = bundle.objects.find((o) => o.id === instanceId);
Expand Down Expand Up @@ -596,7 +597,13 @@ const attributePathMapping: any = {
[ABSTRACT_STIX_DOMAIN_OBJECT]: `/extensions/${STIX_EXT_OCTI}/workflow_id`,
[ABSTRACT_STIX_CYBER_OBSERVABLE]: `/extensions/${STIX_EXT_OCTI}/workflow_id`,
[ABSTRACT_STIX_RELATIONSHIP]: `/extensions/${STIX_EXT_OCTI}/workflow_id`,
}
},
severity: {
[ENTITY_TYPE_CONTAINER_CASE]: '/severity',
},
priority: {
[ENTITY_TYPE_CONTAINER_CASE]: '/priority',
},
};
interface UpdateValueConfiguration {
label: string
Expand Down

0 comments on commit f2e7d91

Please sign in to comment.