From ce020b3f0e06377e397ff3b81589aa62e261ecd7 Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Fri, 13 Oct 2023 15:23:38 -0400 Subject: [PATCH 1/3] Add experimental security analysis plugins --- security-analysis/README | 4 + .../org.osate.analysis.security.ui/.classpath | 7 + .../org.osate.analysis.security.ui/.gitignore | 3 + .../org.osate.analysis.security.ui/.project | 34 +++ .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 15 + .../build.properties | 30 ++ .../icons/checkSafety.gif | Bin 0 -> 887 bytes .../icons/checkSecurity.gif | Bin 0 -> 888 bytes .../icons/noCheckSafety.gif | Bin 0 -> 880 bytes .../icons/noCheckSecurity.gif | Bin 0 -> 883 bytes .../plugin.properties | 41 +++ .../org.osate.analysis.security.ui/plugin.xml | 219 ++++++++++++++ .../org.osate.analysis.security.ui/pom.xml | 43 +++ .../osate/analysis/security/ui/Activator.java | 67 +++++ .../security/ui/handlers/RulesChecker.java | 125 ++++++++ .../security/ui/handlers/SecurityChecker.java | 149 ++++++++++ .../org.osate.analysis.security/.classpath | 7 + .../org.osate.analysis.security/.gitignore | 3 + .../org.osate.analysis.security/.project | 28 ++ .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 21 ++ .../build.properties | 28 ++ .../org.osate.analysis.security/build/pom.xml | 41 +++ .../p2.repository/category.xml | 28 ++ .../p2.repository/pom.xml | 43 +++ .../org.osate.analysis.security/pom.xml | 43 +++ .../src/aadl_project/DataRateUnits.java | 63 ++++ .../src/aadl_project/DataVolume.java | 70 +++++ .../src/aadl_project/DataVolumeUnits.java | 63 ++++ .../src/aadl_project/ProcessorSpeedUnits.java | 61 ++++ .../src/aadl_project/Size.java | 70 +++++ .../src/aadl_project/SizeRange.java | 80 ++++++ .../src/aadl_project/SizeUnits.java | 64 +++++ ...upportedActiveThreadHandlingProtocols.java | 49 ++++ .../SupportedClassifierSubstitutions.java | 51 ++++ .../SupportedConcurrencyControlProtocols.java | 56 ++++ .../SupportedConnectionPatterns.java | 62 ++++ .../aadl_project/SupportedConnectionQos.java | 51 ++++ .../SupportedDispatchProtocols.java | 54 ++++ .../aadl_project/SupportedDistributions.java | 50 ++++ .../SupportedHardwareSourceLanguages.java | 49 ++++ .../SupportedQueueProcessingProtocols.java | 49 ++++ .../SupportedSchedulingProtocols.java | 59 ++++ .../SupportedSourceLanguages.java | 54 ++++ .../src/aadl_project/Time.java | 70 +++++ .../src/aadl_project/TimeRange.java | 80 ++++++ .../src/aadl_project/TimeUnits.java | 65 +++++ .../analysis/security/BellLaPadulaPolicy.java | 152 ++++++++++ .../analysis/security/LabelPropagator.java | 90 ++++++ .../osate/analysis/security/LabelUtil.java | 94 ++++++ .../security/RuleViolationChecker.java | 228 +++++++++++++++ .../security/SecurityCheckAdapter.java | 73 +++++ .../security/SecurityCheckAdapterFactory.java | 44 +++ .../analysis/security/SecurityCheckData.java | 42 +++ .../analysis/security/SecurityLabel.java | 237 +++++++++++++++ .../security/SecurityLabelChecker.java | 271 ++++++++++++++++++ .../analysis/security/SecurityPlugin.java | 94 ++++++ .../analysis/security/SecurityPolicy.java | 152 ++++++++++ .../SecurityClassificationProperties.java | 200 +++++++++++++ .../DataSecurity.java | 99 +++++++ .../KeyDistribitionMethod.java | 56 ++++ .../KeyInstances.java | 115 ++++++++ .../SecurityEnforcementProperties.java | 260 +++++++++++++++++ .../TextType.java | 50 ++++ .../CaveatType.java | 129 +++++++++ .../DataAuthenticationType.java | 204 +++++++++++++ .../DataSecurityType.java | 53 ++++ .../DataSecurityTypes.java | 53 ++++ .../EncryptionSpecificationType.java | 208 ++++++++++++++ .../LevelType.java | 123 ++++++++ .../SecuritySpecificationType.java | 160 +++++++++++ .../SubjectAuthenticationType.java | 267 +++++++++++++++++ 73 files changed, 5718 insertions(+) create mode 100644 security-analysis/README create mode 100644 security-analysis/org.osate.analysis.security.ui/.classpath create mode 100644 security-analysis/org.osate.analysis.security.ui/.gitignore create mode 100644 security-analysis/org.osate.analysis.security.ui/.project create mode 100644 security-analysis/org.osate.analysis.security.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 security-analysis/org.osate.analysis.security.ui/META-INF/MANIFEST.MF create mode 100644 security-analysis/org.osate.analysis.security.ui/build.properties create mode 100644 security-analysis/org.osate.analysis.security.ui/icons/checkSafety.gif create mode 100644 security-analysis/org.osate.analysis.security.ui/icons/checkSecurity.gif create mode 100644 security-analysis/org.osate.analysis.security.ui/icons/noCheckSafety.gif create mode 100644 security-analysis/org.osate.analysis.security.ui/icons/noCheckSecurity.gif create mode 100644 security-analysis/org.osate.analysis.security.ui/plugin.properties create mode 100644 security-analysis/org.osate.analysis.security.ui/plugin.xml create mode 100644 security-analysis/org.osate.analysis.security.ui/pom.xml create mode 100644 security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/Activator.java create mode 100644 security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/RulesChecker.java create mode 100644 security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/SecurityChecker.java create mode 100644 security-analysis/org.osate.analysis.security/.classpath create mode 100644 security-analysis/org.osate.analysis.security/.gitignore create mode 100644 security-analysis/org.osate.analysis.security/.project create mode 100644 security-analysis/org.osate.analysis.security/.settings/org.eclipse.jdt.core.prefs create mode 100644 security-analysis/org.osate.analysis.security/META-INF/MANIFEST.MF create mode 100644 security-analysis/org.osate.analysis.security/build.properties create mode 100644 security-analysis/org.osate.analysis.security/build/pom.xml create mode 100644 security-analysis/org.osate.analysis.security/p2.repository/category.xml create mode 100644 security-analysis/org.osate.analysis.security/p2.repository/pom.xml create mode 100644 security-analysis/org.osate.analysis.security/pom.xml create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/DataRateUnits.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/DataVolume.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/DataVolumeUnits.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/ProcessorSpeedUnits.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/Size.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SizeRange.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SizeUnits.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedActiveThreadHandlingProtocols.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedClassifierSubstitutions.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConcurrencyControlProtocols.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionPatterns.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionQos.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDispatchProtocols.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDistributions.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedHardwareSourceLanguages.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedQueueProcessingProtocols.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSchedulingProtocols.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSourceLanguages.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/Time.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/TimeRange.java create mode 100644 security-analysis/org.osate.analysis.security/src/aadl_project/TimeUnits.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/BellLaPadulaPolicy.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/LabelPropagator.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/LabelUtil.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/RuleViolationChecker.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityCheckAdapter.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityCheckAdapterFactory.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityCheckData.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityLabel.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityLabelChecker.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityPlugin.java create mode 100644 security-analysis/org.osate.analysis.security/src/org/osate/analysis/security/SecurityPolicy.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_classification_properties/SecurityClassificationProperties.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_enforcement_properties/DataSecurity.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_enforcement_properties/KeyDistribitionMethod.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_enforcement_properties/KeyInstances.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_enforcement_properties/SecurityEnforcementProperties.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_enforcement_properties/TextType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/CaveatType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/DataAuthenticationType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/DataSecurityType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/DataSecurityTypes.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/EncryptionSpecificationType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/LevelType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/SecuritySpecificationType.java create mode 100644 security-analysis/org.osate.analysis.security/src/security_type_specifications/SubjectAuthenticationType.java diff --git a/security-analysis/README b/security-analysis/README new file mode 100644 index 00000000000..7f0e8c2c5f3 --- /dev/null +++ b/security-analysis/README @@ -0,0 +1,4 @@ +WARNING + +These plugins are the very early stage of an implementation of a security analysis. +The code is experimental, incomplete, and the maven build does not work. diff --git a/security-analysis/org.osate.analysis.security.ui/.classpath b/security-analysis/org.osate.analysis.security.ui/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/security-analysis/org.osate.analysis.security.ui/.gitignore b/security-analysis/org.osate.analysis.security.ui/.gitignore new file mode 100644 index 00000000000..ca1937f4a75 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/.gitignore @@ -0,0 +1,3 @@ +/bin/ +/target/ +*.jar diff --git a/security-analysis/org.osate.analysis.security.ui/.project b/security-analysis/org.osate.analysis.security.ui/.project new file mode 100644 index 00000000000..835e128dfce --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/.project @@ -0,0 +1,34 @@ + + + org.osate.analysis.security.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/security-analysis/org.osate.analysis.security.ui/.settings/org.eclipse.jdt.core.prefs b/security-analysis/org.osate.analysis.security.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..9f6ece88bdf --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/security-analysis/org.osate.analysis.security.ui/META-INF/MANIFEST.MF b/security-analysis/org.osate.analysis.security.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..d0cc2fc5827 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Ui +Bundle-SymbolicName: org.osate.analysis.security.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.osate.analysis.security.ui.Activator +Require-Bundle: org.osate.aadl2, + org.osate.aadl2.modelsupport, + org.osate.ui, + org.osate.analysis.security;bundle-version="1.0.0", + org.osate.results +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Automatic-Module-Name: org.osate.analysis.security.ui +Bundle-ActivationPolicy: lazy +Export-Package: org.osate.analysis.security.ui.handlers diff --git a/security-analysis/org.osate.analysis.security.ui/build.properties b/security-analysis/org.osate.analysis.security.ui/build.properties new file mode 100644 index 00000000000..f684985c15f --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/build.properties @@ -0,0 +1,30 @@ +############################################################################### +# Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). +# All Rights Reserved. +# +# NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +# KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +# OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +# MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +# +# This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# SPDX-License-Identifier: EPL-2.0 +# +# Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +# +# This program includes and/or can make use of certain third party source code, object code, documentation and other +# files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +# configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +# conditions contained in any such Third Party Software or separate license file distributed with such Third Party +# Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries +# to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses +# only apply to the Third Party Software and not any other portion of this program or this program as a whole. +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + icons/,\ + plugin.xml +src.includes = icons/ diff --git a/security-analysis/org.osate.analysis.security.ui/icons/checkSafety.gif b/security-analysis/org.osate.analysis.security.ui/icons/checkSafety.gif new file mode 100644 index 0000000000000000000000000000000000000000..fceb7da794b05fad7738096b2a08418e1821151c GIT binary patch literal 887 zcmb7DO=uHA6#lY_yIX&tHI)_(Voa2v-VEB>2$qkvYJcxKGnyR4nVuBHUZ)Z~rdhsnYZ{C}4zW2?(-6PR( zTl+vG8u1;{3>ZeKR5A<$zu2twznz9uQ8%~J?^UE#4S^3T#x7Sy?p8(c@fgL!vo%rP zsNtf8m0UIypLw7hf}v2tMY!U_yJCD%MymQeWp11q9z!-mi9NZ z5VEU71(A9%C0OrUb<*^H(vyAa!J}ASWC>%pn^2Ub3kPukNvaq`3{k{!lGc0CgMEKx zljy}UoIp2W;^?FkA;NUhbC}MCXnrzO5v`JUWo{;|J~XVvs~29r+$u|FW}rfccwP~y z<(g=7RmD~sx^+i>ClO7<`TeqY7w(h)sDiJ=Oq$6hXI`G8Ue>cgioHuJ@yopR8n~Wv zjWlvyt`GVK7`v0Ob>kKHvL55z&r3W;KgquIkw)%IhGOmotK)V39?30L;irKwe>f#q zkL`y=%KBw5ti*pfchzA7)?g2x;eP^p0_${Fq?nr?(HeZo*}S`D#IZh-DSsW9PCGXw zMtx)1nd>bbgMJtjwzHn@D}kk^9nqW4)Azi6#~0^@H=XJlZ!ZppZ!5c%)~@C|FDG=n Gf{x#!WYG8k literal 0 HcmV?d00001 diff --git a/security-analysis/org.osate.analysis.security.ui/icons/checkSecurity.gif b/security-analysis/org.osate.analysis.security.ui/icons/checkSecurity.gif new file mode 100644 index 0000000000000000000000000000000000000000..4b7bd1dae17ff1ab3ad16a53966195fa2fe7d009 GIT binary patch literal 888 zcmb7DO=uHA6#nw#ZmJ$q^-yY%rj0g;CoOiZ6|6CF)220QMTJllJa{mWljF^`^$;Z} zLWBq&g4)zvO6);IQPNgaXb(j%9zF)PJpCI@0Z^^gsuj=pRW#8asL0ECsVzqs*7k|w#AH=4b~)`g zvJkQh$%07T9uuthl`>-aHqw)O(1N?MVUZ(@%Vj}PmM#)P2NF~abwvLYHJ@8Z0Mv<6YP7%yD}_;O1uoqYlY9*BvG zNG()_<}<}Q8Xo(O{7!UL#ff&=yOX2jKPccUF_UU>$(fhOsh72Eh~mI|h4^LOehpmD znIVl_m+OPR0mg11Y|VJZy{yHU{dtDRxsS3hhe;#%B}*~)g4OZ5c8|nbQ?${*=Rcg1 ztJm?vCT0Dy7k1)5oZoaifMwXkXZW9h=O9*ie0nKAKBU$K6WZvUHsoHZXSKe$$-(;8 z##{Pq^LXabu8wb-_h!U}rtZM0&Fddu@gKR~U))!iy40F{mMMOH6FuMF<80{81}ARl J^@f|)1&|Z literal 0 HcmV?d00001 diff --git a/security-analysis/org.osate.analysis.security.ui/icons/noCheckSafety.gif b/security-analysis/org.osate.analysis.security.ui/icons/noCheckSafety.gif new file mode 100644 index 0000000000000000000000000000000000000000..3be512c94ebb1654a046adeb4d7acbd4fa5d5a2b GIT binary patch literal 880 zcmb7DO=uHQ5dM;;`&LmYsRz-tG`46^FVdh@E40Ma4NWv?!5%_s!9x)X(aU&qH9>+E zp^!raksvn3i=;h>C`zi}4-_eQ@gP#LX#4?NFD4k#ncYn-=*3yyn>X{m_s#cqb`MAT zy7rAUp$Xq%n+ek_l}e^*;+L3{{n6mBkxp z{E%mg=DQ2D^F6|u%k)<*J@T)JnvU%<2`VZH)UH}jxnO`3&)8kH4^Mv-rp=j z*e;J1C^P3fKZk1)S&!9mEJ+4r4 zxkg>SDz);^ojb}qF_gmSUb}av@38-*L9QfB%HpzTS)Sxx*0UjwJ3ea6Z|9xYAobi= zSfkXH`rvOsu-h10H(5z9>oFF7o|lpSZ1-i5HA-Ky97``moviEkNNlN6kO#j0;k3D8 zt{)Dm=(l^}B>uzss~#87h+T3<{t4(YDBWii^Rp>kdE1cpBjs6VWXnqB!Q%{%mW@jo{$)_Lu3N)COJ0f#2U*&(#0` literal 0 HcmV?d00001 diff --git a/security-analysis/org.osate.analysis.security.ui/icons/noCheckSecurity.gif b/security-analysis/org.osate.analysis.security.ui/icons/noCheckSecurity.gif new file mode 100644 index 0000000000000000000000000000000000000000..99ddcb78f8f6a640d8c2b91a26e3c04b9fb6cb24 GIT binary patch literal 883 zcmb7DO=uHQ5dQMxzEx35>_Ie0e?kr7rL<_(3JEc3Y7>oC@P}Bc_Ta%n6k&RE{Xv3= zR4fw3LoQA6QeqDxiW0S;haL)EJcv}0+NvP+VuBH!*|(_$y*SHz^Jd=nzWLtHZdZ4# zW81Mh)Zsg{S+J~9sbpCeeu+8he>;Ut(X_X+vj(z;Lgz;V*Uwidf2&M#Ji+mWmsOhc zDGWJS&E-PzNi*CbSZ+@E8CSf2m+mYW2=( z`@CZ`-C3Zfodt?>9A%yZn<@lwtu@MyryCU-cn@6U&79VjV~l9~!g2a}l?1zj_t%LK zwkv}L%G{eE(figIvwb`3$vtkygTyH17~}ESP?WTbMX()dt{6cA-AJLA*KJ5*%U{_v z4q`9%qlYmmg!x32F=2jo@!2TPj|R)MR`V{-^{h3B<%{vsML;gM#IhqVV88@DD^q5n zN*(?RZQx-#ca(P$R|+S$>fW6iXaC87TuGRe&825q4sb7P*$Bshd4u_N-gymD&wZ6O zN?oZB{ssiw!q}S0N_ts~G4u1Bj7y(&UkB|Vm(hE^1>)Jii>nqgG17H7eYObW~ zheIm*buXO6f4Ihq*99!YW;rAO1k4na>5mulPcNFv*MR)Hu-j;gd5d*cIO|)L8W?JQ zU%I?{<#GS;z7t)ZK--b}`O`C#H+;S0fo$t+&&}Y`+mnaSY)lS^A}#*iXZu6g@f*%Y B&QAaU literal 0 HcmV?d00001 diff --git a/security-analysis/org.osate.analysis.security.ui/plugin.properties b/security-analysis/org.osate.analysis.security.ui/plugin.properties new file mode 100644 index 00000000000..a9d2352bc30 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/plugin.properties @@ -0,0 +1,41 @@ +############################################################################### +# Copyright (c) 2000, 2021 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Common Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/cpl-v10.html +# +# Contributors: +# Carnegie Mellon University - initial API and implementation +############################################################################### +# +# Resource strings for Security Checker +# +pluginName=Security Checker +providerName = sei.cmu.edu + +# +# Menu labels +# +menu.analyses.label = Analyses +menu.security.label = Security +menu.osate.label = OSATE + +popupMenu.aadl.label = OSATE +popupMenu.analyses.label = AADL Analyses +popupMenu.Security.label = Security + +# +# Action labels & tooltips +# +actionSet.label = OSATE Security Analyses + +CheckSafety.label = &Check Safety Levels +CheckSafety.toolTip = Check Safety +CheckSafety.icon = icons/checkSafety.gif +CheckSafety.disabledIcon = icons/noCheckSafety.gif + +CheckSecurity.label = &Check Security Levels +CheckSecurity.toolTip = Check Security +CheckSecurity.icon = icons/checkSecurity.gif +CheckSecurity.disabledIcon = icons/noCheckSecurity.gif diff --git a/security-analysis/org.osate.analysis.security.ui/plugin.xml b/security-analysis/org.osate.analysis.security.ui/plugin.xml new file mode 100644 index 00000000000..bb3ba2594aa --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/plugin.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-analysis/org.osate.analysis.security.ui/pom.xml b/security-analysis/org.osate.analysis.security.ui/pom.xml new file mode 100644 index 00000000000..1f9dd548137 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + + org.osate + analyses.parent + 2.8.0-SNAPSHOT + + + org.osate + org.osate.analysis.security.ui + 1.0.0-SNAPSHOT + eclipse-plugin + + diff --git a/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/Activator.java b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/Activator.java new file mode 100644 index 00000000000..303c9365d74 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/Activator.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package org.osate.analysis.security.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.osate.analysis.security.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/RulesChecker.java b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/RulesChecker.java new file mode 100644 index 00000000000..b05e638883e --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/RulesChecker.java @@ -0,0 +1,125 @@ +/* + * + * + * Copyright 2004, 2021 by Carnegie Mellon University, all rights reserved. + * + * Use of the Open Source AADL Tool Environment (OSATE) is subject to the terms of the license set forth + * at http://www.eclipse.org/legal/cpl-v10.html. + * + * NO WARRANTY + * + * ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER PROPERTY OR RIGHTS GRANTED OR PROVIDED BY + * CARNEGIE MELLON UNIVERSITY PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN "AS-IS" BASIS. + * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, + * BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, INFORMATIONAL CONTENT, + * NONINFRINGEMENT, OR ERROR-FREE OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT, SPECIAL OR + * CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, + * REGARDLESS OF WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES. LICENSEE AGREES THAT IT WILL NOT + * MAKE ANY WARRANTY ON BEHALF OF CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON CONCERNING THE + * APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE DELIVERABLES UNDER THIS LICENSE. + * + * Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie Mellon University, its trustees, officers, + * employees, and agents from all claims or demands made against them (and any related losses, expenses, or + * attorney's fees) arising out of, or relating to Licensee's and/or its sub licensees' negligent use or willful + * misuse of or negligent conduct or willful misconduct regarding the Software, facilities, or other rights or + * assistance granted by Carnegie Mellon University under this License, including, but not limited to, any claims of + * product liability, personal injury, death, damage to property, or violation of any laws or regulations. + * + * Carnegie Mellon University Software Engineering Institute authored documents are sponsored by the U.S. Department + * of Defense under Contract F19628-00-C-0003. Carnegie Mellon University retains copyrights in all material produced + * under this contract. The U.S. Government retains a non-exclusive, royalty-free license to publish or reproduce these + * documents, or allow others to do so, for U.S. Government purposes only pursuant to the copyright license + * under the contract clause at 252.227.7013. + * + * + * + * + * %W% + * @version %I% %H% + */ +package org.osate.analysis.security.ui.handlers; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.osate.aadl2.Element; +import org.osate.aadl2.instance.SystemInstance; +import org.osate.aadl2.instance.SystemOperationMode; +import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; +import org.osate.analysis.security.RuleViolationChecker; +import org.osate.ui.handlers.AbstractInstanceOrDeclarativeModelModifyHandler; + +public final class RulesChecker extends AbstractInstanceOrDeclarativeModelModifyHandler { + + @Override + public String getMarkerType() { + return "org.osate.analysis.security.SecurityRuleObjectMarker"; + } + + @Override + protected String getActionName() { + return "Check security rules"; + } + + public void invoke(IProgressMonitor monitor, SystemInstance root, SystemOperationMode som) { + invoke(monitor, null, root, som); + } + + public void invoke(final IProgressMonitor monitor, final AnalysisErrorReporterManager errManager, + final SystemInstance root, final SystemOperationMode som) { + this.errManager = errManager != null ? errManager + : new AnalysisErrorReporterManager(getAnalysisErrorReporterFactory()); + analyzeInstanceModel(monitor, this.errManager, root, som); + } + + @Override + protected boolean canAnalyzeDeclarativeModels() { + return false; + } + + @Override + protected void analyzeDeclarativeModel(IProgressMonitor monitor, AnalysisErrorReporterManager errManager, + Element declarativeObject) { +// final Element as; +// if (!(declarativeObject instanceof ComponentImplementation)) { +// as = declarativeObject.getElementRoot(); +// } else { +// as = declarativeObject; +// } +// +// /* +// * ensure that enclosing component security level encompasses contained +// * security levels. The switch acts as filter on the model object +// * classes. +// */ +// final ComponentLevelChecker componentSecuritySwitch = new ComponentLevelChecker(monitor, errManager); +// monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN); +// if (as instanceof ComponentImplementation) { +// componentSecuritySwitch.processBottomUpComponentImpl((ComponentImplementation) as); +// } else { +// componentSecuritySwitch.processBottomUpComponentImpl(); +// } +// if (componentSecuritySwitch.cancelled()) { +// throw new OperationCanceledException(); +// } +// +// final ConnectionLevelChecker connectionSecuritySwitch = new ConnectionLevelChecker(monitor, errManager, +// theProperty, getLevelComparator()); +// if (as instanceof ComponentImplementation) { +// connectionSecuritySwitch.processTopDownComponentImpl((ComponentImplementation) as); +// } else { +// connectionSecuritySwitch.processAllComponentImpl(); +// } +// if (connectionSecuritySwitch.cancelled()) { +// throw new OperationCanceledException(); +// } +// monitor.done(); + } + + @Override + protected void analyzeInstanceModel(IProgressMonitor monitor, AnalysisErrorReporterManager errManager, + SystemInstance root, SystemOperationMode som) { + monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN); + final RuleViolationChecker checker = new RuleViolationChecker(errManager); + checker.processPostOrderAll(root); + monitor.done(); + } +} \ No newline at end of file diff --git a/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/SecurityChecker.java b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/SecurityChecker.java new file mode 100644 index 00000000000..f4bcd33cef3 --- /dev/null +++ b/security-analysis/org.osate.analysis.security.ui/src/org/osate/analysis/security/ui/handlers/SecurityChecker.java @@ -0,0 +1,149 @@ +/* + * + * + * Copyright 2004, 2021 by Carnegie Mellon University, all rights reserved. + * + * Use of the Open Source AADL Tool Environment (OSATE) is subject to the terms of the license set forth + * at http://www.eclipse.org/legal/cpl-v10.html. + * + * NO WARRANTY + * + * ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER PROPERTY OR RIGHTS GRANTED OR PROVIDED BY + * CARNEGIE MELLON UNIVERSITY PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN "AS-IS" BASIS. + * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, + * BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, INFORMATIONAL CONTENT, + * NONINFRINGEMENT, OR ERROR-FREE OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT, SPECIAL OR + * CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, + * REGARDLESS OF WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES. LICENSEE AGREES THAT IT WILL NOT + * MAKE ANY WARRANTY ON BEHALF OF CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON CONCERNING THE + * APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE DELIVERABLES UNDER THIS LICENSE. + * + * Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie Mellon University, its trustees, officers, + * employees, and agents from all claims or demands made against them (and any related losses, expenses, or + * attorney's fees) arising out of, or relating to Licensee's and/or its sub licensees' negligent use or willful + * misuse of or negligent conduct or willful misconduct regarding the Software, facilities, or other rights or + * assistance granted by Carnegie Mellon University under this License, including, but not limited to, any claims of + * product liability, personal injury, death, damage to property, or violation of any laws or regulations. + * + * Carnegie Mellon University Software Engineering Institute authored documents are sponsored by the U.S. Department + * of Defense under Contract F19628-00-C-0003. Carnegie Mellon University retains copyrights in all material produced + * under this contract. The U.S. Government retains a non-exclusive, royalty-free license to publish or reproduce these + * documents, or allow others to do so, for U.S. Government purposes only pursuant to the copyright license + * under the contract clause at 252.227.7013. + * + * + * + * + * %W% + * @version %I% %H% + */ +package org.osate.analysis.security.ui.handlers; + +import java.util.Optional; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.osate.aadl2.Element; +import org.osate.aadl2.instance.SystemInstance; +import org.osate.aadl2.instance.SystemOperationMode; +import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; +import org.osate.analysis.security.SecurityLabelChecker; +import org.osate.analysis.security.SecurityPolicy; +import org.osate.result.AnalysisResult; +import org.osate.result.Diagnostic; +import org.osate.result.DiagnosticType; +import org.osate.result.Result; +import org.osate.ui.handlers.AbstractInstanceOrDeclarativeModelReadOnlyHandler; + +public final class SecurityChecker extends AbstractInstanceOrDeclarativeModelReadOnlyHandler { + + @Override + public String getMarkerType() { + return "org.osate.analysis.security.ui.SecurityLabelMarker"; + } + + @Override + protected String getActionName() { + return "Check security labels"; + } + + public void invoke(IProgressMonitor monitor, SystemInstance root, SystemOperationMode som) { + invoke(monitor, null, root, som); + } + + public void invoke(final IProgressMonitor monitor, final AnalysisErrorReporterManager errManager, + final SystemInstance root, final SystemOperationMode som) { + this.errManager = errManager != null ? errManager + : new AnalysisErrorReporterManager(getAnalysisErrorReporterFactory()); + analyzeInstanceModel(monitor, this.errManager, root, som); + } + + @Override + protected boolean canAnalyzeDeclarativeModels() { + return false; + } + + @Override + protected void analyzeDeclarativeModel(IProgressMonitor monitor, AnalysisErrorReporterManager errManager, + Element declarativeObject) { +// final Element as; +// if (!(declarativeObject instanceof ComponentImplementation)) { +// as = declarativeObject.getElementRoot(); +// } else { +// as = declarativeObject; +// } +// +// /* +// * ensure that enclosing component security level encompasses contained +// * security levels. The switch acts as filter on the model object +// * classes. +// */ +// final ComponentLevelChecker componentSecuritySwitch = new ComponentLevelChecker(monitor, errManager); +// monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN); +// if (as instanceof ComponentImplementation) { +// componentSecuritySwitch.processBottomUpComponentImpl((ComponentImplementation) as); +// } else { +// componentSecuritySwitch.processBottomUpComponentImpl(); +// } +// if (componentSecuritySwitch.cancelled()) { +// throw new OperationCanceledException(); +// } +// +// final ConnectionLevelChecker connectionSecuritySwitch = new ConnectionLevelChecker(monitor, errManager, +// theProperty, getLevelComparator()); +// if (as instanceof ComponentImplementation) { +// connectionSecuritySwitch.processTopDownComponentImpl((ComponentImplementation) as); +// } else { +// connectionSecuritySwitch.processAllComponentImpl(); +// } +// if (connectionSecuritySwitch.cancelled()) { +// throw new OperationCanceledException(); +// } +// monitor.done(); + } + + @Override + protected void analyzeInstanceModel(IProgressMonitor monitor, AnalysisErrorReporterManager errManager, + SystemInstance root, SystemOperationMode som) { + monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN); + Optional policy = SecurityPolicy.of(root); + + if (!policy.isPresent()) { + error(root, "Missing security policy for " + root.getQualifiedName()); + return; + } + + final SecurityLabelChecker checker = new SecurityLabelChecker(null); + AnalysisResult analysisResult = checker.invoke(root); + + for (Result result : analysisResult.getResults()) { + for (Diagnostic diag : result.getDiagnostics()) { + if (diag.getDiagnosticType() == DiagnosticType.ERROR) { + error((Element) diag.getModelElement(), diag.getMessage()); + } else if (diag.getDiagnosticType() == DiagnosticType.WARNING) { + warning((Element) diag.getModelElement(), diag.getMessage()); + } + } + } + monitor.done(); + } +} \ No newline at end of file diff --git a/security-analysis/org.osate.analysis.security/.classpath b/security-analysis/org.osate.analysis.security/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/security-analysis/org.osate.analysis.security/.gitignore b/security-analysis/org.osate.analysis.security/.gitignore new file mode 100644 index 00000000000..dcca6a5961c --- /dev/null +++ b/security-analysis/org.osate.analysis.security/.gitignore @@ -0,0 +1,3 @@ +/bin +target/ +*.jar diff --git a/security-analysis/org.osate.analysis.security/.project b/security-analysis/org.osate.analysis.security/.project new file mode 100644 index 00000000000..49d74031ae5 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/.project @@ -0,0 +1,28 @@ + + + org.osate.analysis.security + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/security-analysis/org.osate.analysis.security/.settings/org.eclipse.jdt.core.prefs b/security-analysis/org.osate.analysis.security/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/security-analysis/org.osate.analysis.security/META-INF/MANIFEST.MF b/security-analysis/org.osate.analysis.security/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..bd18f56b6e8 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.osate.analysis.security;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: org.osate.analysis.security.SecurityPlugin +Bundle-Vendor: CMU-SEI +Bundle-Localization: plugin +Export-Package: org.osate.analysis.security +Require-Bundle: org.osate.aadl2, + org.osate.ui, + org.osate.aadl2.modelsupport, + org.osate.xtext.aadl2.properties;bundle-version="1.0.0", + org.osate.results +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.e4.core.services.log, + org.osate.contribution.sei.names +Automatic-Module-Name: org.osate.analysis.security +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 + diff --git a/security-analysis/org.osate.analysis.security/build.properties b/security-analysis/org.osate.analysis.security/build.properties new file mode 100644 index 00000000000..d6efc0b2288 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/build.properties @@ -0,0 +1,28 @@ +############################################################################### +# Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). +# All Rights Reserved. +# +# NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +# KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +# OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +# MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +# +# This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# SPDX-License-Identifier: EPL-2.0 +# +# Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +# +# This program includes and/or can make use of certain third party source code, object code, documentation and other +# files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +# configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +# conditions contained in any such Third Party Software or separate license file distributed with such Third Party +# Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries +# to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses +# only apply to the Third Party Software and not any other portion of this program or this program as a whole. +############################################################################### +bin.includes = META-INF/,\ + . +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/security-analysis/org.osate.analysis.security/build/pom.xml b/security-analysis/org.osate.analysis.security/build/pom.xml new file mode 100644 index 00000000000..9d4859c7660 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/build/pom.xml @@ -0,0 +1,41 @@ + + + + + 4.0.0 + + org.osate + org.osate.analysis.security.aggregator + 1.0.0-SNAPSHOT + pom + + + ../../org.osate.analysis.security + ../../org.osate.analysis.security.ui + ../p2.repository + + diff --git a/security-analysis/org.osate.analysis.security/p2.repository/category.xml b/security-analysis/org.osate.analysis.security/p2.repository/category.xml new file mode 100644 index 00000000000..7b17ec7f56d --- /dev/null +++ b/security-analysis/org.osate.analysis.security/p2.repository/category.xml @@ -0,0 +1,28 @@ + + + + + + diff --git a/security-analysis/org.osate.analysis.security/p2.repository/pom.xml b/security-analysis/org.osate.analysis.security/p2.repository/pom.xml new file mode 100644 index 00000000000..f4f46735b1a --- /dev/null +++ b/security-analysis/org.osate.analysis.security/p2.repository/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + + org.osate + analyses.parent + 2.8.0-SNAPSHOT + ../.. + + + org.osate + org.osate.analysis.security.repository + 1.0.0-SNAPSHOT + eclipse-repository + + diff --git a/security-analysis/org.osate.analysis.security/pom.xml b/security-analysis/org.osate.analysis.security/pom.xml new file mode 100644 index 00000000000..13b903c7fa6 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/pom.xml @@ -0,0 +1,43 @@ + + + + + 4.0.0 + + + org.osate + analyses.parent + 2.8.0-SNAPSHOT + + + org.osate + org.osate.analysis.security + 1.0.0-SNAPSHOT + eclipse-plugin + + diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/DataRateUnits.java b/security-analysis/org.osate.analysis.security/src/aadl_project/DataRateUnits.java new file mode 100644 index 00000000000..387777d70d1 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/DataRateUnits.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.UnitLiteral; + +public enum DataRateUnits { + BITSPS(1.0, "bitsps"), + BYTESPS(8.0, "Bytesps"), + KBYTESPS(8000.0, "KBytesps"), + MBYTESPS(8000000.0, "MBytesps"), + GBYTESPS(8.0E9, "GBytesps"); + + private final double factorToBase; + private final String originalName; + + private DataRateUnits(double factorToBase, String originalName) { + this.factorToBase = factorToBase; + this.originalName = originalName; + } + + public static DataRateUnits valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((UnitLiteral) abstractNamedValue).getName().toUpperCase()); + } + + public double getFactorToBase() { + return factorToBase; + } + + public double getFactorTo(DataRateUnits target) { + return factorToBase / target.factorToBase; + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolume.java b/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolume.java new file mode 100644 index 00000000000..9b7fe724c00 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolume.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import java.util.Objects; + +import org.osate.aadl2.IntegerLiteral; +import org.osate.aadl2.PropertyExpression; + +public class DataVolume { + private final long value; + private final DataVolumeUnits unit; + + public DataVolume(PropertyExpression propertyExpression) { + IntegerLiteral numberValue = (IntegerLiteral) propertyExpression; + value = numberValue.getValue(); + unit = DataVolumeUnits.valueOf(numberValue.getUnit().getName().toUpperCase()); + } + + public long getValue() { + return value; + } + + public DataVolumeUnits getUnit() { + return unit; + } + + @Override + public int hashCode() { + return Objects.hash(value, unit); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataVolume)) { + return false; + } + DataVolume other = (DataVolume) obj; + return value == other.value && unit == other.unit; + } + + @Override + public String toString() { + return value + unit.toString(); + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolumeUnits.java b/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolumeUnits.java new file mode 100644 index 00000000000..bee0321b049 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/DataVolumeUnits.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.UnitLiteral; + +public enum DataVolumeUnits { + BITSPS(1.0, "bitsps"), + BYTESPS(8.0, "Bytesps"), + KBYTESPS(8000.0, "KBytesps"), + MBYTESPS(8000000.0, "MBytesps"), + GBYTESPS(8.0E9, "GBytesps"); + + private final double factorToBase; + private final String originalName; + + private DataVolumeUnits(double factorToBase, String originalName) { + this.factorToBase = factorToBase; + this.originalName = originalName; + } + + public static DataVolumeUnits valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((UnitLiteral) abstractNamedValue).getName().toUpperCase()); + } + + public double getFactorToBase() { + return factorToBase; + } + + public double getFactorTo(DataVolumeUnits target) { + return factorToBase / target.factorToBase; + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/ProcessorSpeedUnits.java b/security-analysis/org.osate.analysis.security/src/aadl_project/ProcessorSpeedUnits.java new file mode 100644 index 00000000000..65078550653 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/ProcessorSpeedUnits.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.UnitLiteral; + +public enum ProcessorSpeedUnits { + KIPS(1.0, "KIPS"), + MIPS(1000.0, "MIPS"), + GIPS(1000000.0, "GIPS"); + + private final double factorToBase; + private final String originalName; + + private ProcessorSpeedUnits(double factorToBase, String originalName) { + this.factorToBase = factorToBase; + this.originalName = originalName; + } + + public static ProcessorSpeedUnits valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((UnitLiteral) abstractNamedValue).getName().toUpperCase()); + } + + public double getFactorToBase() { + return factorToBase; + } + + public double getFactorTo(ProcessorSpeedUnits target) { + return factorToBase / target.factorToBase; + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/Size.java b/security-analysis/org.osate.analysis.security/src/aadl_project/Size.java new file mode 100644 index 00000000000..89e5da5c4e6 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/Size.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import java.util.Objects; + +import org.osate.aadl2.IntegerLiteral; +import org.osate.aadl2.PropertyExpression; + +public class Size { + private final long value; + private final SizeUnits unit; + + public Size(PropertyExpression propertyExpression) { + IntegerLiteral numberValue = (IntegerLiteral) propertyExpression; + value = numberValue.getValue(); + unit = SizeUnits.valueOf(numberValue.getUnit().getName().toUpperCase()); + } + + public long getValue() { + return value; + } + + public SizeUnits getUnit() { + return unit; + } + + @Override + public int hashCode() { + return Objects.hash(value, unit); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Size)) { + return false; + } + Size other = (Size) obj; + return value == other.value && unit == other.unit; + } + + @Override + public String toString() { + return value + unit.toString(); + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SizeRange.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SizeRange.java new file mode 100644 index 00000000000..196841a0a6e --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SizeRange.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import java.util.Objects; +import java.util.Optional; + +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.RangeValue; + +public class SizeRange { + private final Size minimum; + private final Size maximum; + private final Optional delta; + + public SizeRange(PropertyExpression propertyExpression) { + RangeValue rangeValue = (RangeValue) propertyExpression; + minimum = new Size(rangeValue.getMinimum()); + maximum = new Size(rangeValue.getMaximum()); + delta = Optional.ofNullable(rangeValue.getDelta()).map(Size::new); + } + + public Size getMinimum() { + return minimum; + } + + public Size getMaximum() { + return maximum; + } + + public Optional getDelta() { + return delta; + } + + @Override + public int hashCode() { + return Objects.hash(minimum, maximum, delta); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SizeRange)) { + return false; + } + SizeRange other = (SizeRange) obj; + return Objects.equals(minimum, other.minimum) && Objects.equals(maximum, other.maximum) + && Objects.equals(delta, other.delta); + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(minimum + " .. " + maximum); + delta.ifPresent(it -> builder.append(" delta " + it)); + return builder.toString(); + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SizeUnits.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SizeUnits.java new file mode 100644 index 00000000000..bd5b1f27043 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SizeUnits.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.UnitLiteral; + +public enum SizeUnits { + BITS(1.0, "bits"), + BYTES(8.0, "Bytes"), + KBYTE(8000.0, "KByte"), + MBYTE(8000000.0, "MByte"), + GBYTE(8.0E9, "GByte"), + TBYTE(8.0E12, "TByte"); + + private final double factorToBase; + private final String originalName; + + private SizeUnits(double factorToBase, String originalName) { + this.factorToBase = factorToBase; + this.originalName = originalName; + } + + public static SizeUnits valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((UnitLiteral) abstractNamedValue).getName().toUpperCase()); + } + + public double getFactorToBase() { + return factorToBase; + } + + public double getFactorTo(SizeUnits target) { + return factorToBase / target.factorToBase; + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedActiveThreadHandlingProtocols.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedActiveThreadHandlingProtocols.java new file mode 100644 index 00000000000..4b2f221f95d --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedActiveThreadHandlingProtocols.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedActiveThreadHandlingProtocols { + ABORT("abort"); + + private final String originalName; + + private SupportedActiveThreadHandlingProtocols(String originalName) { + this.originalName = originalName; + } + + public static SupportedActiveThreadHandlingProtocols valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedClassifierSubstitutions.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedClassifierSubstitutions.java new file mode 100644 index 00000000000..c059721e0e1 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedClassifierSubstitutions.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedClassifierSubstitutions { + CLASSIFIER_MATCH("Classifier_Match"), + TYPE_EXTENSION("Type_Extension"), + SIGNATURE_MATCH("Signature_Match"); + + private final String originalName; + + private SupportedClassifierSubstitutions(String originalName) { + this.originalName = originalName; + } + + public static SupportedClassifierSubstitutions valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConcurrencyControlProtocols.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConcurrencyControlProtocols.java new file mode 100644 index 00000000000..ce607c15902 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConcurrencyControlProtocols.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedConcurrencyControlProtocols { + NONE_SPECIFIED("None_Specified"), + INTERRUPT_MASKING("Interrupt_Masking"), + MAXIMUM_PRIORITY("Maximum_Priority"), + PRIORITY_INHERITANCE("Priority_Inheritance"), + PRIORITY_CEILING("Priority_Ceiling"), + SPIN_LOCK("Spin_Lock"), + SEMAPHORE("Semaphore"), + PROTECTED_ACCESS("Protected_Access"); + + private final String originalName; + + private SupportedConcurrencyControlProtocols(String originalName) { + this.originalName = originalName; + } + + public static SupportedConcurrencyControlProtocols valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionPatterns.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionPatterns.java new file mode 100644 index 00000000000..76c5c7ae7e4 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionPatterns.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedConnectionPatterns { + ONE_TO_ONE("One_To_One"), + ALL_TO_ALL("All_To_All"), + ONE_TO_ALL("One_To_All"), + ALL_TO_ONE("All_To_One"), + NEXT("Next"), + PREVIOUS("Previous"), + CYCLIC_NEXT("Cyclic_Next"), + CYCLIC_PREVIOUS("Cyclic_Previous"), + ODD_TO_ODD("Odd_To_Odd"), + EVEN_TO_EVEN("Even_To_Even"), + NEXT_NEXT("Next_Next"), + CYCLIC_NEXT_NEXT("Cyclic_Next_Next"), + PREVIOUS_PREVIOUS("Previous_Previous"), + CYCLIC_PREVIOUS_PREVIOUS("Cyclic_Previous_Previous"); + + private final String originalName; + + private SupportedConnectionPatterns(String originalName) { + this.originalName = originalName; + } + + public static SupportedConnectionPatterns valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionQos.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionQos.java new file mode 100644 index 00000000000..bd5c741bc53 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedConnectionQos.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedConnectionQos { + GUARANTEEDDELIVERY("GuaranteedDelivery"), + ORDEREDDELIVERY("OrderedDelivery"), + SECUREDELIVERY("SecureDelivery"); + + private final String originalName; + + private SupportedConnectionQos(String originalName) { + this.originalName = originalName; + } + + public static SupportedConnectionQos valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDispatchProtocols.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDispatchProtocols.java new file mode 100644 index 00000000000..835c0840245 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDispatchProtocols.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedDispatchProtocols { + PERIODIC("Periodic"), + SPORADIC("Sporadic"), + APERIODIC("Aperiodic"), + TIMED("Timed"), + HYBRID("Hybrid"), + BACKGROUND("Background"); + + private final String originalName; + + private SupportedDispatchProtocols(String originalName) { + this.originalName = originalName; + } + + public static SupportedDispatchProtocols valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDistributions.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDistributions.java new file mode 100644 index 00000000000..9db8d69f965 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedDistributions.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedDistributions { + FIXED("Fixed"), + POISSON("Poisson"); + + private final String originalName; + + private SupportedDistributions(String originalName) { + this.originalName = originalName; + } + + public static SupportedDistributions valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedHardwareSourceLanguages.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedHardwareSourceLanguages.java new file mode 100644 index 00000000000..9d9642d4366 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedHardwareSourceLanguages.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedHardwareSourceLanguages { + VHDL("VHDL"); + + private final String originalName; + + private SupportedHardwareSourceLanguages(String originalName) { + this.originalName = originalName; + } + + public static SupportedHardwareSourceLanguages valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedQueueProcessingProtocols.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedQueueProcessingProtocols.java new file mode 100644 index 00000000000..366163d26e3 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedQueueProcessingProtocols.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedQueueProcessingProtocols { + FIFO("Fifo"); + + private final String originalName; + + private SupportedQueueProcessingProtocols(String originalName) { + this.originalName = originalName; + } + + public static SupportedQueueProcessingProtocols valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSchedulingProtocols.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSchedulingProtocols.java new file mode 100644 index 00000000000..348a97a36da --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSchedulingProtocols.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedSchedulingProtocols { + STATIC("Static"), + ROUND_ROBIN_PROTOCOL("Round_Robin_Protocol"), + POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL("POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL"), + FIXEDTIMELINE("FixedTimeline"), + COOPERATIVE("Cooperative"), + RMS("RMS"), + DMS("DMS"), + EDF("EDF"), + SPORADICSERVER("SporadicServer"), + SLACKSERVER("SlackServer"), + ARINC653("ARINC653"); + + private final String originalName; + + private SupportedSchedulingProtocols(String originalName) { + this.originalName = originalName; + } + + public static SupportedSchedulingProtocols valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSourceLanguages.java b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSourceLanguages.java new file mode 100644 index 00000000000..2097b300a6b --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/SupportedSourceLanguages.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import org.osate.aadl2.AbstractNamedValue; +import org.osate.aadl2.EnumerationLiteral; +import org.osate.aadl2.NamedValue; +import org.osate.aadl2.PropertyExpression; + +public enum SupportedSourceLanguages { + ADA95("Ada95"), + ADA2005("Ada2005"), + C("C"), + JAVA("Java"), + SIMULINK_6_5("Simulink_6_5"), + SCADE("SCADE"); + + private final String originalName; + + private SupportedSourceLanguages(String originalName) { + this.originalName = originalName; + } + + public static SupportedSourceLanguages valueOf(PropertyExpression propertyExpression) { + AbstractNamedValue abstractNamedValue = ((NamedValue) propertyExpression).getNamedValue(); + return valueOf(((EnumerationLiteral) abstractNamedValue).getName().toUpperCase()); + } + + @Override + public String toString() { + return originalName; + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/Time.java b/security-analysis/org.osate.analysis.security/src/aadl_project/Time.java new file mode 100644 index 00000000000..973fdec2ba4 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/Time.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import java.util.Objects; + +import org.osate.aadl2.IntegerLiteral; +import org.osate.aadl2.PropertyExpression; + +public class Time { + private final long value; + private final TimeUnits unit; + + public Time(PropertyExpression propertyExpression) { + IntegerLiteral numberValue = (IntegerLiteral) propertyExpression; + value = numberValue.getValue(); + unit = TimeUnits.valueOf(numberValue.getUnit().getName().toUpperCase()); + } + + public long getValue() { + return value; + } + + public TimeUnits getUnit() { + return unit; + } + + @Override + public int hashCode() { + return Objects.hash(value, unit); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Time)) { + return false; + } + Time other = (Time) obj; + return value == other.value && unit == other.unit; + } + + @Override + public String toString() { + return value + unit.toString(); + } +} diff --git a/security-analysis/org.osate.analysis.security/src/aadl_project/TimeRange.java b/security-analysis/org.osate.analysis.security/src/aadl_project/TimeRange.java new file mode 100644 index 00000000000..8c3be303b03 --- /dev/null +++ b/security-analysis/org.osate.analysis.security/src/aadl_project/TimeRange.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries + * to this license with respect to the terms applicable to their Third Party Software. Third Party Software licenses + * only apply to the Third Party Software and not any other portion of this program or this program as a whole. + *******************************************************************************/ +package aadl_project; + +import java.util.Objects; +import java.util.Optional; + +import org.osate.aadl2.PropertyExpression; +import org.osate.aadl2.RangeValue; + +public class TimeRange { + private final Time minimum; + private final Time maximum; + private final Optional