Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/docs/administration/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ You can specify which entities to hide on a platform-wide basis from "Settings >
An overview of hidden entity types is available in the "Hidden entity types" field in "Settings > Parameters."


## Custom display name

This configuration allows you to rename any entity type across the platform. When you set a custom display name, it replaces the default label everywhere in the interface: navigation menus, creation buttons and dialogs, list columns, filter dropdowns, knowledge graphs, and search results.

To set a custom display name:

1. Navigate to "Settings > Customization > Entity types" and click on the desired entity type.
2. In the "Custom display name" section, fill in the **Display name (singular)** and/or **Display name (plural)** fields.
3. The change is applied immediately — press Enter or click outside the field to save.

Leave the fields empty to revert to the default name.

![Custom display name](./assets/custom-display-name.png)

!!! example "Example"

Renaming "Report" to "Intelligence Report" (singular) and "Intelligence Reports" (plural) will update every place in the platform where "Report" or "Reports" was previously displayed.

Note that it is a local change. When you export data in STIX from the platform, it keeps the STIX 2.1 name.


## Automatic references at file upload

This configuration enables an entity to automatically construct an external reference from the uploaded file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useGetCurrentUserAccessRight } from '../utils/authorizedMembers';
import useDraftContext from '../utils/hooks/useDraftContext';
import { ButtonSize } from './common/button/Button.types';
import { useFormatter } from './i18n';
import { useEntityLabelResolver } from '../utils/hooks/useEntityLabel';

interface CreateEntityControlledDialProps extends DrawerControlledDialProps {
entityType: string;
Expand All @@ -20,7 +21,8 @@ const CreateEntityControlledDial: FunctionComponent<CreateEntityControlledDialPr
variant = 'primary',
}) => {
const { t_i18n } = useFormatter();
const valueString = entityType ? t_i18n(`entity_${entityType}`) : t_i18n('Entity');
const entityLabel = useEntityLabelResolver();
const valueString = entityType ? entityLabel(entityType) : t_i18n('Entity');
const buttonValue = t_i18n('', {
id: 'Create ...',
values: { entity_type: valueString },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { itemColor } from '../utils/Colors';
import Tag from './common/tag/Tag';
import { useFormatter } from './i18n';
import ItemIcon from './ItemIcon';
import { useEntityLabelResolver } from '../utils/hooks/useEntityLabel';

interface ItemEntityTypeProps {
entityType: string;
Expand All @@ -18,6 +19,7 @@ const ItemEntityType: FunctionComponent<ItemEntityTypeProps> = ({
maxWidth,
}) => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();

const isRelationship = t_i18n(`relationship_${entityType}`) !== `relationship_${entityType}`;

Expand All @@ -35,7 +37,8 @@ const ItemEntityType: FunctionComponent<ItemEntityTypeProps> = ({

const getLabel = () => {
if (isRestricted) return t_i18n('Restricted');
return t_i18n(isRelationship ? `relationship_${entityType}` : `entity_${entityType}`);
if (isRelationship) return t_i18n(`relationship_${entityType}`);
return entityLabel(entityType);
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import React, { useState } from 'react';
import GraphToolbarOptionsList from './GraphToolbarOptionsList';
import GraphToolbarItem from './GraphToolbarItem';
import { useFormatter } from '../../i18n';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';
import { useGraphContext } from '../GraphContext';
import useGraphInteractions from '../utils/useGraphInteractions';
import { minutesBetweenDates } from '../../../utils/Time';

const GraphToolbarFilterTools = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const [filterByTypeAnchor, setFilterByTypeAnchor] = useState<Element>();
const [filterByMarkingAnchor, setFilterByMarkingAnchor] = useState<Element>();
const [filterByCreatorAnchor, setFilterByCreatorAnchor] = useState<Element>();
Expand Down Expand Up @@ -78,7 +80,7 @@ const GraphToolbarFilterTools = () => {
onClose={() => setFilterByTypeAnchor(undefined)}
options={stixCoreObjectTypes}
getOptionKey={(type) => type}
getOptionText={(type) => t_i18n(`entity_${type}`)}
getOptionText={(type) => entityLabel(type)}
isOptionSelected={(type) => !disabledEntityTypes.includes(type)}
onSelect={toggleEntityType}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import React, { useState } from 'react';
import GraphToolbarOptionsList from './GraphToolbarOptionsList';
import GraphToolbarItem from './GraphToolbarItem';
import { useFormatter } from '../../i18n';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';
import { useGraphContext } from '../GraphContext';
import useGraphInteractions from '../utils/useGraphInteractions';

const GraphToolbarSelectTools = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const [selectByTypeAnchor, setSelectByTypeAnchor] = useState<Element>();

const {
Expand Down Expand Up @@ -73,7 +75,7 @@ const GraphToolbarSelectTools = () => {
onClose={() => setSelectByTypeAnchor(undefined)}
options={stixCoreObjectTypes}
getOptionKey={(type) => type}
getOptionText={(type) => t_i18n(`entity_${type}`)}
getOptionText={(type) => entityLabel(type)}
onSelect={(type) => {
selectByEntityType(type);
setSelectByTypeAnchor(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocum
import DataTable from '../../../components/dataGrid/DataTable';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const LOCAL_STORAGE_KEY = 'externalReferences';

Expand Down Expand Up @@ -102,6 +103,7 @@ const externalReferencesLinesFragment = graphql`

const ExternalReferences: FunctionComponent<ExternalReferencesProps> = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('External References | Analyses'));
const {
Expand Down Expand Up @@ -151,7 +153,7 @@ const ExternalReferences: FunctionComponent<ExternalReferencesProps> = () => {
} as UsePreloadedPaginationFragment<ExternalReferencesLinesPaginationQuery>;
return (
<div data-testid="external-reference-page">
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('External references'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('External-Reference', t_i18n('External references')), current: true }]} />
{queryRef && (
<DataTable
dataColumns={dataColumns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import DataTable from '../../../components/dataGrid/DataTable';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import { KNOWLEDGE_KNUPDATE, KNOWLEDGE_KNASKIMPORT } from '../../../utils/hooks/useGranted';
import Security from '../../../utils/Security';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const LOCAL_STORAGE_KEY = 'groupings';

Expand Down Expand Up @@ -143,6 +144,7 @@ const groupingsLineFragment = graphql`

const Groupings: FunctionComponent<GroupingsProps> = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Groupings | Analyses'));
const { platformModuleHelpers: { isRuntimeFieldEnable } } = useAuth();
Expand Down Expand Up @@ -202,7 +204,7 @@ const Groupings: FunctionComponent<GroupingsProps> = () => {

return (
<span data-testid="groupings-page">
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('Groupings'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('Grouping', t_i18n('Groupings')), current: true }]} />
{queryRef && (
<DataTable
dataColumns={dataColumns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DataTable from '../../../components/dataGrid/DataTable';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const LOCAL_STORAGE_KEY = 'malwareAnalyses';

Expand Down Expand Up @@ -118,6 +119,7 @@ const malwareAnalysesLinesFragment = graphql`

const MalwareAnalyses: FunctionComponent = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Malware Analyses | Analyses'));
const initialValues = {
Expand Down Expand Up @@ -166,7 +168,7 @@ const MalwareAnalyses: FunctionComponent = () => {

return (
<ExportContextProvider>
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('Malware analyses'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('Malware-Analysis', t_i18n('Malware analyses')), current: true }]} />
{queryRef && (
<div data-testid="malware-analyses-page">
<DataTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DataTable from '../../../components/dataGrid/DataTable';
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const LOCAL_STORAGE_KEY = 'notes';

Expand Down Expand Up @@ -141,6 +142,7 @@ const notesLinesFragment = graphql`

const Notes: FunctionComponent = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Notes | Analyses'));
const {
Expand Down Expand Up @@ -202,7 +204,7 @@ const Notes: FunctionComponent = () => {

return (
<span data-testid="notes-page">
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('Notes'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('Note', t_i18n('Notes')), current: true }]} />
{queryRef && (
<DataTable
dataColumns={dataColumns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloade
import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import Breadcrumbs from '../../../components/Breadcrumbs';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const reportLineFragment = graphql`
fragment ReportsLine_node on Report {
Expand Down Expand Up @@ -141,6 +142,7 @@ const LOCAL_STORAGE_KEY = 'reports';

const Reports: FunctionComponent = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
setTitle(t_i18n('Reports | Analyses'));
const { platformModuleHelpers: { isRuntimeFieldEnable } } = useAuth();
Expand Down Expand Up @@ -205,7 +207,7 @@ const Reports: FunctionComponent = () => {
};
return (
<span data-testid="report-page">
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('Reports'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('Report', t_i18n('Reports')), current: true }]} />
{queryRef && (
<DataTable
dataColumns={dataColumns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DataTableProps } from '../../../components/dataGrid/dataTableTypes';
import { UsePreloadedPaginationFragment } from '../../../utils/hooks/usePreloadedPaginationFragment';
import useConnectedDocumentModifier from '../../../utils/hooks/useConnectedDocumentModifier';
import useAuth from '../../../utils/hooks/useAuth';
import { useEntityLabelResolver } from '../../../utils/hooks/useEntityLabel';

const LOCAL_STORAGE_KEY = 'securityCoverages';

Expand Down Expand Up @@ -133,6 +134,7 @@ const securityCoveragesLinesFragment = graphql`

const SecurityCoverages: FunctionComponent = () => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const { setTitle } = useConnectedDocumentModifier();
const { platformModuleHelpers: { isRuntimeFieldEnable } } = useAuth();
setTitle(t_i18n('Security coverages'));
Expand Down Expand Up @@ -190,7 +192,7 @@ const SecurityCoverages: FunctionComponent = () => {

return (
<ExportContextProvider>
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: t_i18n('Security coverages'), current: true }]} />
<Breadcrumbs elements={[{ label: t_i18n('Analyses') }, { label: entityLabel('Security-Coverage', t_i18n('Security coverages')), current: true }]} />
{queryRef && (
<div data-testid="security-coverages-page">
<DataTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ListItemText from '@mui/material/ListItemText';
import { Add } from '@mui/icons-material';
import Skeleton from '@mui/material/Skeleton';
import { useFormatter } from '../../../../components/i18n';
import { useEntityLabelResolver } from '../../../../utils/hooks/useEntityLabel';
import Drawer from '../../common/drawer/Drawer';
import SearchInput from '../../../../components/SearchInput';
import { QueryRenderer } from '../../../../relay/environment';
Expand All @@ -18,6 +19,7 @@ const AddExternalReferences = ({
stixCoreObjectOrStixCoreRelationshipReferences,
}) => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const [open, setOpen] = useState(false);
const [dialogOpen, setDialogOpen] = useState(false);
const [search, setSearch] = useState('');
Expand Down Expand Up @@ -61,7 +63,7 @@ const AddExternalReferences = ({
onClick={() => setDialogOpen(true)}
key="rightButton"
>
{t_i18n('Create')} {t_i18n('entity_External-Reference')}
{t_i18n('Create')} {entityLabel('External-Reference')}
</Button>
)],
left: [(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import TextField from '../../../../components/TextField';
import FormButtonContainer from '../../../../components/common/form/FormButtonContainer';
import MarkdownField from '../../../../components/fields/MarkdownField';
import { useFormatter } from '../../../../components/i18n';
import { useEntityLabelResolver } from '../../../../utils/hooks/useEntityLabel';
import { handleErrorInForm } from '../../../../relay/environment';
import { insertNode } from '../../../../utils/store';
import CustomFileUploader from '../../common/files/CustomFileUploader';
Expand Down Expand Up @@ -88,6 +89,7 @@ const ExternalReferenceCreation: FunctionComponent<ExternalReferenceCreationProp
dryrun,
}) => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();

const [open, setOpen] = useState(false);

Expand All @@ -98,7 +100,7 @@ const ExternalReferenceCreation: FunctionComponent<ExternalReferenceCreationProp
const [commit] = useApiMutation<ExternalReferenceCreationMutation>(
externalReferenceCreationMutation,
undefined,
{ successMessage: `${t_i18n('entity_External-Reference')} ${t_i18n('successfully created')}` },
{ successMessage: `${entityLabel('External-Reference')} ${t_i18n('successfully created')}` },
);
const onSubmit: FormikConfig<ExternalReferenceAddInput>['onSubmit'] = (
values,
Expand Down Expand Up @@ -196,7 +198,7 @@ const ExternalReferenceCreation: FunctionComponent<ExternalReferenceCreationProp
const renderClassic = () => {
return (
<Drawer
title={t_i18n('Create an external reference')}
title={t_i18n('', { id: 'Create ...', values: { entity_type: entityLabel('External-Reference') } })}
controlledDial={CreateExternalReferenceControlledDial}
>
{({ onClose }) => (
Expand Down Expand Up @@ -285,7 +287,7 @@ const ExternalReferenceCreation: FunctionComponent<ExternalReferenceCreationProp
slotProps={{ paper: { elevation: 1 } }}
open={handleCloseContextual ? openContextual : open}
onClose={handleCloseContextual || handleClose}
title={t_i18n('Create an external reference')}
title={t_i18n('', { id: 'Create ...', values: { entity_type: entityLabel('External-Reference') } })}
>
<Formik<ExternalReferenceAddInput>
enableReinitialize={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { FunctionComponent } from 'react';
import { graphql } from 'react-relay';
import { useNavigate } from 'react-router-dom';
import { useFormatter } from '../../../../components/i18n';
import { useEntityLabelResolver } from '../../../../utils/hooks/useEntityLabel';
import { deleteNodeFromId } from '../../../../utils/store';
import useApiMutation from '../../../../utils/hooks/useApiMutation';
import useDeletion from '../../../../utils/hooks/useDeletion';
Expand All @@ -28,10 +29,11 @@ const ExternalReferenceDeletion: FunctionComponent<
ExternalReferenceDeletionProps
> = ({ id, objectId, isOpen, handleClose, handleRemove, isExternalReferenceAttachment }) => {
const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
const navigate = useNavigate();
const deleteSuccessMessage = t_i18n('', {
id: '... successfully deleted',
values: { entity_type: t_i18n('entity_External-Reference') },
values: { entity_type: entityLabel('External-Reference') },
});
const [commit] = useApiMutation(
externalReferenceDeletionDeleteMutation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
import { useParams } from 'react-router-dom';
import { graphql, useSubscription } from 'react-relay';
import { useFormatter } from '../../../../components/i18n';
import { useEntityLabelResolver } from '../../../../utils/hooks/useEntityLabel';
import { QueryRenderer } from '../../../../relay/environment';
import ExternalReference from './ExternalReference';
import Loader from '../../../../components/Loader';
Expand Down Expand Up @@ -39,6 +40,7 @@ const RootExternalReference = () => {
);

const { t_i18n } = useFormatter();
const entityLabel = useEntityLabelResolver();
useSubscription(subConfig);

return (
Expand All @@ -53,7 +55,7 @@ const RootExternalReference = () => {
<>
<Breadcrumbs elements={[
{ label: t_i18n('Analyses') },
{ label: t_i18n('External references'), link: '/dashboard/analyses/external_references' },
{ label: entityLabel('External-Reference', t_i18n('External references')), link: '/dashboard/analyses/external_references' },
]}
/>
<ExternalReference
Expand Down
Loading