Skip to content

Commit 9319a5e

Browse files
authored
Feat/dfd sec controls view (#21)
* SC: added basic security control view * Linked controls to assuptions * SC: linked the secuirty control view to threats, mitigations and assumptions * SC: preloaded list of CCCM Medium profile security controls
1 parent 1e6c275 commit 9319a5e

File tree

4 files changed

+7109
-27
lines changed

4 files changed

+7109
-27
lines changed

src/configs/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const SINGLE_FIELD_INPUT_SMALL_MAX_LENGTH = 50;
2727
// Threat statement elements, Application name, custom template length
2828
export const SINGLE_FIELD_INPUT_MAX_LENGTH = 200;
2929
// Entity comments, Assumption/Mitigation content
30-
export const FREE_TEXT_INPUT_SMALL_MAX_LENGTH = 1000;
30+
export const FREE_TEXT_INPUT_SMALL_MAX_LENGTH = 10000;
3131
// Application info, Architecture description, Dataflow description
3232
export const FREE_TEXT_INPUT_MAX_LENGTH = 100000;
3333
// Architecture diagram, data flow diagram

src/contexts/WorkspaceContextAggregator/index.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import ExampleContextProvider from '../ExampleContext';
2525
import GlobalSetupContextProvider from '../GlobalSetupContext';
2626
import MitigationLinksContextProvider from '../MitigationLinksContext';
2727
import MitigationsContextProvider from '../MitigationsContext';
28+
import ControlLinksContextProvider from '../ControlLinksContext';
29+
import ControlsContextProvider from '../ControlsContext';
2830
import ThreatsContextProvider from '../ThreatsContext';
2931

3032
export interface WorkspaceContextAggregatorProps extends ViewNavigationEvent {
@@ -51,17 +53,21 @@ const WorkspaceContextInnerAggregator: FC<PropsWithChildren<WorkspaceContextAggr
5153
>
5254
<MitigationsContextProvider workspaceId={workspaceId}>
5355
<AssumptionsContextProvider workspaceId={workspaceId}>
54-
<MitigationLinksContextProvider workspaceId={workspaceId}>
55-
<AssumptionLinksContextProvider workspaceId={workspaceId}>
56-
<ApplicationInfoContextProvider workspaceId={workspaceId}>
57-
<ArchitectureInfoContextProvider workspaceId={workspaceId}>
58-
<DataflowInfoContextProvider workspaceId={workspaceId}>
59-
{children}
60-
</DataflowInfoContextProvider>
61-
</ArchitectureInfoContextProvider>
62-
</ApplicationInfoContextProvider>
63-
</AssumptionLinksContextProvider>
64-
</MitigationLinksContextProvider>
56+
<ControlsContextProvider workspaceId={workspaceId}>
57+
<MitigationLinksContextProvider workspaceId={workspaceId}>
58+
<AssumptionLinksContextProvider workspaceId={workspaceId}>
59+
<ControlLinksContextProvider workspaceId={workspaceId}>
60+
<ApplicationInfoContextProvider workspaceId={workspaceId}>
61+
<ArchitectureInfoContextProvider workspaceId={workspaceId}>
62+
<DataflowInfoContextProvider workspaceId={workspaceId}>
63+
{children}
64+
</DataflowInfoContextProvider>
65+
</ArchitectureInfoContextProvider>
66+
</ApplicationInfoContextProvider>
67+
</ControlLinksContextProvider>
68+
</AssumptionLinksContextProvider>
69+
</MitigationLinksContextProvider>
70+
</ControlsContextProvider>
6571
</AssumptionsContextProvider >
6672
</MitigationsContextProvider>
6773
</ThreatsContextProvider>

src/customTypes/controls.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
import { z } from 'zod';
1818
import { ContentEntityBaseSchema, EntityLinkBaseSchema } from './entities';
1919

20-
export const ControlSchema = ContentEntityBaseSchema.extend({
21-
code: z.string().length(36).min(2).max(36).optional(),
22-
}).strict();
20+
export const ControlSchema = ContentEntityBaseSchema.extend({}).strict();
2321

2422
export type Control = z.infer<typeof ControlSchema>;
2523

0 commit comments

Comments
 (0)