Skip to content

Commit

Permalink
Feat/sec ctrl selection engine (#33)
Browse files Browse the repository at this point in the history
* Parametrized Security Category selection accross the app

* Refined Security Control selection engine

* Fix: application info default now to CCCS Medium
  • Loading branch information
idumitru-cds authored Dec 7, 2023
1 parent ac6f564 commit d878077
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Binary file added src/assets/file-uploader-feature-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/application/ApplicationInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ApplicationInfo: FC<EditableComponentBaseProps> = ({
const [editMode, setEditMode] = useState(!applicationInfo.name && !applicationInfo.description );
const [content, setContent] = useState('');
const [name, setName] = useState('');
const [securityCategory, setSecurityCategory] = useState('CCS Medium');
const [securityCategory, setSecurityCategory] = useState('CCCS Medium');
const [checkedIaaS, setCheckedIaaS] = useState(false);
const [checkedPaaS, setCheckedPaaS] = useState(false);
const [checkedSaaS, setCheckedSaaS] = useState(false);
Expand Down
1 change: 1 addition & 0 deletions src/components/controls/ControlCreationCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const ControlCreationCard: FC<ControlCreationCardProps> = ({
const [showAlert, setShowAlert] = useState(false);

const controlList = useMemo(() => {
// use the preselected security profile and show only the controls that were not selected yet
let profiles = (controlProfiles.securityProfiles as unknown as ControlProfile[]);
let cccs_profile = profiles?.filter(cp => cp.schema === applicationInfo.securityCategory)[0];
return cccs_profile.controls as Control[];
Expand Down
3 changes: 2 additions & 1 deletion src/components/controls/ControlList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { OPTIONS as STRIDEOptions } from '../../generic/STRIDESelector';
import { LEVEL_NOT_SET } from '../../../configs';
import ControlCard from '../ControlCard';
import ControlCreationCard from '../ControlCreationCard';
import { Multiselect } from '@cloudscape-design/components';
import { Link, Multiselect } from '@cloudscape-design/components';
import controlProfiles from '../../../data/controlProfiles.json';

const ControlList: FC = () => {
Expand Down Expand Up @@ -227,6 +227,7 @@ const ControlList: FC = () => {
<Container header={
<Header
counter={`(${filteredList.length})`}
info={<Link variant="info">Info</Link>}
>Control List</Header>
}>
<SpaceBetween direction='vertical' size='s'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { getArchitectureContent } from '../../utils/getArchitecture';
import { getAssetsContent } from '../../utils/getAssets';
import { getAssumptionsContent } from '../../utils/getAssumptions';
import { getControlsContent } from '../../utils/getControls';
import { getDataflowContent } from '../../utils/getDataFlow';
//import { getDataflowContent } from '../../utils/getDataFlow';
import { getMitigationsContent } from '../../utils/getMitigations';
import { getThreatsContent } from '../../utils/getThreats';

Expand Down Expand Up @@ -85,7 +85,7 @@ const ThreatModelView: FC<ThreatModelViewProps> = ({
(!hasContentDetails || hasContentDetails.applicationName) && await getApplicationName(sanitizedData),
(!hasContentDetails || hasContentDetails.applicationInfo) && await getApplicationInfoContent(sanitizedData),
(!hasContentDetails || hasContentDetails.architecture) && await getArchitectureContent(sanitizedData),
(!hasContentDetails || hasContentDetails.dataflow) && await getDataflowContent(sanitizedData),
//(!hasContentDetails || hasContentDetails.dataflow) && await getDataflowContent(sanitizedData),
(!hasContentDetails || hasContentDetails.assumptions) && await getAssumptionsContent(sanitizedData),
(!hasContentDetails || hasContentDetails.threats) && await getThreatsContent(sanitizedData),
(!hasContentDetails || hasContentDetails.controls) && await getControlsContent(sanitizedData),
Expand Down Expand Up @@ -116,9 +116,9 @@ const ThreatModelView: FC<ThreatModelViewProps> = ({
if (!hasContentDetails?.architecture) {
buttons.push(<Button key='architectureViewBtn' onClick={props.onArchitectureView}>Add Architecture</Button>);
}
if (!hasContentDetails?.diagram) {
buttons.push(<Button key='diagramViewBtn' onClick={props.onDiagramView}>Add Diagram</Button>);
}
//if (!hasContentDetails?.diagram) {
// buttons.push(<Button key='diagramViewBtn' onClick={props.onDiagramView}>Add Diagram</Button>);
//}
if (!hasContentDetails?.assumptions) {
buttons.push(<Button key='assumptionsViewBtn' onClick={props.onAssumptionListView}>Add Assumptions</Button>);
}
Expand Down

0 comments on commit d878077

Please sign in to comment.