Skip to content

Commit

Permalink
Feat/dfd sec controls view (#21)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
idumitru-cds authored Oct 25, 2023
1 parent 1e6c275 commit 9319a5e
Show file tree
Hide file tree
Showing 4 changed files with 7,109 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/configs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SINGLE_FIELD_INPUT_SMALL_MAX_LENGTH = 50;
// Threat statement elements, Application name, custom template length
export const SINGLE_FIELD_INPUT_MAX_LENGTH = 200;
// Entity comments, Assumption/Mitigation content
export const FREE_TEXT_INPUT_SMALL_MAX_LENGTH = 1000;
export const FREE_TEXT_INPUT_SMALL_MAX_LENGTH = 10000;
// Application info, Architecture description, Dataflow description
export const FREE_TEXT_INPUT_MAX_LENGTH = 100000;
// Architecture diagram, data flow diagram
Expand Down
28 changes: 17 additions & 11 deletions src/contexts/WorkspaceContextAggregator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import ExampleContextProvider from '../ExampleContext';
import GlobalSetupContextProvider from '../GlobalSetupContext';
import MitigationLinksContextProvider from '../MitigationLinksContext';
import MitigationsContextProvider from '../MitigationsContext';
import ControlLinksContextProvider from '../ControlLinksContext';
import ControlsContextProvider from '../ControlsContext';
import ThreatsContextProvider from '../ThreatsContext';

export interface WorkspaceContextAggregatorProps extends ViewNavigationEvent {
Expand All @@ -51,17 +53,21 @@ const WorkspaceContextInnerAggregator: FC<PropsWithChildren<WorkspaceContextAggr
>
<MitigationsContextProvider workspaceId={workspaceId}>
<AssumptionsContextProvider workspaceId={workspaceId}>
<MitigationLinksContextProvider workspaceId={workspaceId}>
<AssumptionLinksContextProvider workspaceId={workspaceId}>
<ApplicationInfoContextProvider workspaceId={workspaceId}>
<ArchitectureInfoContextProvider workspaceId={workspaceId}>
<DataflowInfoContextProvider workspaceId={workspaceId}>
{children}
</DataflowInfoContextProvider>
</ArchitectureInfoContextProvider>
</ApplicationInfoContextProvider>
</AssumptionLinksContextProvider>
</MitigationLinksContextProvider>
<ControlsContextProvider workspaceId={workspaceId}>
<MitigationLinksContextProvider workspaceId={workspaceId}>
<AssumptionLinksContextProvider workspaceId={workspaceId}>
<ControlLinksContextProvider workspaceId={workspaceId}>
<ApplicationInfoContextProvider workspaceId={workspaceId}>
<ArchitectureInfoContextProvider workspaceId={workspaceId}>
<DataflowInfoContextProvider workspaceId={workspaceId}>
{children}
</DataflowInfoContextProvider>
</ArchitectureInfoContextProvider>
</ApplicationInfoContextProvider>
</ControlLinksContextProvider>
</AssumptionLinksContextProvider>
</MitigationLinksContextProvider>
</ControlsContextProvider>
</AssumptionsContextProvider >
</MitigationsContextProvider>
</ThreatsContextProvider>
Expand Down
4 changes: 1 addition & 3 deletions src/customTypes/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
import { z } from 'zod';
import { ContentEntityBaseSchema, EntityLinkBaseSchema } from './entities';

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

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

Expand Down
Loading

0 comments on commit 9319a5e

Please sign in to comment.