func GenerateRisks() []model.Risk {
	risks := make([]model.Risk, 0)
	for _, technicalAsset := range model.ParsedModelRoot.TechnicalAssets {
		for _, dataFlow := range technicalAsset.CommunicationLinks {
			transferringAuthData := dataFlow.Authentication != model.NoneAuthentication
			sourceAsset := model.ParsedModelRoot.TechnicalAssets[dataFlow.SourceId]
			targetAsset := model.ParsedModelRoot.TechnicalAssets[dataFlow.TargetId]
			if !technicalAsset.OutOfScope || !sourceAsset.OutOfScope {
				if !dataFlow.Protocol.IsEncrypted() && !dataFlow.Protocol.IsProcessLocal() &&
					!sourceAsset.Technology.IsUnprotectedCommsTolerated() &&
					!targetAsset.Technology.IsUnprotectedCommsTolerated() {
					addedOne := false
					for _, sentDataAsset := range dataFlow.DataAssetsSent {
						dataAsset := model.ParsedModelRoot.DataAssets[sentDataAsset]
						if isHighSensitivity(dataAsset) || transferringAuthData {
							risks = append(risks, createRisk(technicalAsset, dataFlow, true, transferringAuthData))
							addedOne = true
							break
						} else if !dataFlow.VPN && isMediumSensitivity(dataAsset) {
							risks = append(risks, createRisk(technicalAsset, dataFlow, false, transferringAuthData))
							addedOne = true
							break
						}
					}
					if !addedOne {
						for _, receivedDataAsset := range dataFlow.DataAssetsReceived {
							dataAsset := model.ParsedModelRoot.DataAssets[receivedDataAsset]
							if isHighSensitivity(dataAsset) || transferringAuthData {
								risks = append(risks, createRisk(technicalAsset, dataFlow, true, transferringAuthData))
								break
							} else if !dataFlow.VPN && isMediumSensitivity(dataAsset) {
								risks = append(risks, createRisk(technicalAsset, dataFlow, false, transferringAuthData))
								break
							}
						}
					}
				}
			}
		}
	}
	return risks
}
// check for communication links that should be encrypted due to their confidentiality and/or integrity
check for communication links that should be encrypted due to their confidentiality and/or integrity
// check for communication links that should be encrypted due to their confidentiality and / or integrity
func GenerateRisks() []model.Risk {
	risks := make([]model.Risk, 0)
	for _, technicalAsset := range model.ParsedModelRoot.TechnicalAssets {
		for _, dataFlow := range technicalAsset.CommunicationLinks {
			transferringAuthData := dataFlow.Authentication != model.NoneAuthentication
			sourceAsset := model.ParsedModelRoot.TechnicalAssets[dataFlow.SourceId]
			targetAsset := model.ParsedModelRoot.TechnicalAssets[dataFlow.TargetId]
			if !technicalAsset.OutOfScope || !sourceAsset.OutOfScope {
				if !dataFlow.Protocol.IsEncrypted() && !dataFlow.Protocol.IsProcessLocal() &&
					!sourceAsset.Technology.IsUnprotectedCommsTolerated() &&
					!targetAsset.Technology.IsUnprotectedCommsTolerated() {
					addedOne := false
					for _, sentDataAsset := range dataFlow.DataAssetsSent {
						dataAsset := model.ParsedModelRoot.DataAssets[sentDataAsset]
						if isHighSensitivity(dataAsset) || transferringAuthData {
							risks = append(risks, createRisk(technicalAsset, dataFlow, true, transferringAuthData))
							addedOne = true
							break
						} else if !dataFlow.VPN && isMediumSensitivity(dataAsset) {
							risks = append(risks, createRisk(technicalAsset, dataFlow, false, transferringAuthData))
							addedOne = true
							break
						}
					}
					if !addedOne {
						for _, receivedDataAsset := range dataFlow.DataAssetsReceived {
							dataAsset := model.ParsedModelRoot.DataAssets[receivedDataAsset]
							if isHighSensitivity(dataAsset) || transferringAuthData {
								risks = append(risks, createRisk(technicalAsset, dataFlow, true, transferringAuthData))
								break
							} else if !dataFlow.VPN && isMediumSensitivity(dataAsset) {
								risks = append(risks, createRisk(technicalAsset, dataFlow, false, transferringAuthData))
								break
							}
						}
					}
				}
			}
		}
	}
	return risks
}
func GenerateRisks ( ) [ ] model . Risk { risks := make ( [ ] model . Risk , 0 ) for _ , technicalAsset := range model . ParsedModelRoot . TechnicalAssets { for _ , dataFlow := range technicalAsset . CommunicationLinks { transferringAuthData := dataFlow . Authentication != model . NoneAuthentication sourceAsset := model . ParsedModelRoot . TechnicalAssets [ dataFlow . SourceId ] targetAsset := model . ParsedModelRoot . TechnicalAssets [ dataFlow . TargetId ] if ! technicalAsset . OutOfScope || ! sourceAsset . OutOfScope { if ! dataFlow . Protocol . IsEncrypted ( ) && ! dataFlow . Protocol . IsProcessLocal ( ) && ! sourceAsset . Technology . IsUnprotectedCommsTolerated ( ) && ! targetAsset . Technology . IsUnprotectedCommsTolerated ( ) { addedOne := false for _ , sentDataAsset := range dataFlow . DataAssetsSent { dataAsset := model . ParsedModelRoot . DataAssets [ sentDataAsset ] if isHighSensitivity ( dataAsset ) || transferringAuthData { risks = append ( risks , createRisk ( technicalAsset , dataFlow , true , transferringAuthData ) ) addedOne = true break } else if ! dataFlow . VPN && isMediumSensitivity ( dataAsset ) { risks = append ( risks , createRisk ( technicalAsset , dataFlow , false , transferringAuthData ) ) addedOne = true break } } if ! addedOne { for _ , receivedDataAsset := range dataFlow . DataAssetsReceived { dataAsset := model . ParsedModelRoot . DataAssets [ receivedDataAsset ] if isHighSensitivity ( dataAsset ) || transferringAuthData { risks = append ( risks , createRisk ( technicalAsset , dataFlow , true , transferringAuthData ) ) break } else if ! dataFlow . VPN && isMediumSensitivity ( dataAsset ) { risks = append ( risks , createRisk ( technicalAsset , dataFlow , false , transferringAuthData ) ) break } } } } } } } return risks }
check for communication links that should be encrypted due to their confidentiality and/or integrity
check for communication links that should be encrypted due to their confidentiality and / or integrity