Пример #1
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   self.logger = logging.getLogger(__name__)
   self.existing_role_id = 122
   self.existing_role_name = 'Certificate Authority'
   self.role_class = Role.__module__+'.'+Role.__name__
   self.new_role = Role(
     roleId=-1,
     roleName='Student',
     rType='Stakeholder',
     sCode='STU',
     roleDesc='This is a test role',
     cProps=[]
   )
   self.new_role_props = [
     RoleEnvironmentProperties(
       environmentName='Core Technology',
       responses=[('Prevent Unauthorised Certificate Access', 'High')],
       countermeasures=['Location-based X.509 extension']
     )
   ]
   self.new_role_dict = {
     'session_id': 'test',
     'object': self.new_role,
     'property_0': self.new_role_props
   }
   self.new_role_body = jsonpickle.encode(self.new_role_dict)
   self.logger.info('JSON data: %s', self.new_role_body)
Пример #2
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   self.logger = logging.getLogger('UserTests')
   self.data = {
     'username': '******',
     'password': '******'
   }
Пример #3
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
 
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_asset_name = 'Analysis data'
   self.existing_environment_name = 'Core Technology'
   self.requirement_class = Requirement.__module__+'.'+Requirement.__name__
   self.new_requirement = Requirement(
     id=-1,
     label='TE-1',
     name='Test requirement',
     description='This is a test description',
     priority='1',
     rationale='This is to test the requirements controller',
     fitCriterion='None',
     originator='Student',
     type='Functional',
     asset='Analysis data'
   )
   self.new_requirement_dict = {
     'session_id': 'test',
     'object': self.new_requirement,
   }
   self.new_requirement_body = jsonpickle.encode(self.new_requirement_dict)
   self.to_delete_ids = []
   # endregion
   self.logger.info('JSON data: %s', self.new_requirement_body)
Пример #4
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_response_name = 'Prevent Unauthorised Certificate Access'
   self.existing_environment_name = 'Stroke'
   self.existing_risk_name = 'Unauthorised Certificate Access'
   self.existing_role_name = 'Developer'
   self.response_class = Response.__module__+'.'+Response.__name__
Пример #5
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_goal_name = 'Multi-Factor Authentication'
   self.existing_category = 'Maintain'
   self.existing_environment_name_1 = 'Stroke'
   self.existing_environment_name_2 = 'Psychosis'
   self.goal_class = Goal.__module__+'.'+Goal.__name__
   self.to_delete_ids = []
Пример #6
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_persona_name = 'Claire'
   self.existing_environment_name = 'Psychosis'
   self.existing_direct_flag = False
   self.existing_environment_narrative = 'Nothing stipulated'
   self.existing_role_names = ['Researcher']
   persona_class = Persona.__module__+'.'+Persona.__name__
Пример #7
0
 def setUp(self):
   self.logger = logging.getLogger(__name__)
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   self.working_name_1 = ('Stroke', 'all', 'all', 'all')
   self.working_name_2 = ('Stroke', 'Data%20Consumer', 'Certificate%20Authority', 'Personal%20certificate')
   self.existing_environment_1 = 'Stroke'
   self.existing_environment_2 = 'Psychosis'
   self.existing_role_1 = 'Data Consumer'
   self.existing_role_2 = 'Certificate Authority'
   self.existing_type = 'goal'
   self.existing_dependency = 'Upload authorisation'
Пример #8
0
 def setUpClass(cls):
   cairis.core.BorgFactory.initialise()
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos.xml',1)
   importTVTypeFile(os.environ['CAIRIS_SRC'] + '/test/OWASPTypes.xml',0)
   importTVTypeFile(os.environ['CAIRIS_SRC'] + '/../examples/threat_vulnerability_types/cwecapec_tv_types.xml',0)
   importDirectoryFile(os.environ['CAIRIS_SRC'] + '/../examples/directories/owasp_directory.xml',0)
   importDirectoryFile(os.environ['CAIRIS_SRC'] + '/../examples/directories/cwecapec_directory.xml',0)
   importDirectoryFile(os.environ['CAIRIS_SRC'] + '/test/D28TV.xml',0)
   importComponentViewFile(os.environ['CAIRIS_SRC'] + '/test/ContextPolicyManagement.xml',0)
   importAttackPattern(os.environ['CAIRIS_SRC'] + '/test/XACMLAttackPattern.xml',0)
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/persona_synopses.xml',0)
Пример #9
0
  def setUp(self):
    importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
    # region Class fields
    self.logger = logging.getLogger(__name__)

    self.existing_task_name = 'Upload data'
    self.existing_environment_name = 'Psychosis'
    self.existing_direct_flag=False
    self.existing_personas=[('Claire','Medium','Medium','Low','Medium')]
    self.existing_assets=['Clinical data','Portal','Client workstation']
    self.existing_concern_associations=[]
    self.existing_narrative='Claire wants to analyse a data set, in relation to other data sets on NeuroGrid.  She anonymises her data to the extent that as much personalised data is removed as possible, but not to the extent that her analysis software will fail.  She then uploads this data, tagging this as available only to members of her exemplar.'
    self.existing_consequences='None'
    self.existing_benefits='None'
    self.existing_codes=[]

    task_class = Task.__module__+'.'+Task.__name__
Пример #10
0
  def setUp(self):
    importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')

    # region Class fields
    self.logger = logging.getLogger(__name__)
    self.existing_asset_name = 'Data node'
    self.new_asset = Asset(
      assetId=-1,
      assetName='Test',
      shortCode='TST',
      assetDescription='This is a new test asset',
      assetSig='Very significant',
      assetType='Hardware',
      cFlag=0,
      cRationale=None,
      tags=[],
      ifs=[],
      cProps=[]
    )
    self.new_asset_sec_attr = [
      SecurityAttribute(
        'Accountability',
        'Low',
        'None'
      ),
      SecurityAttribute(
        'Confidentiality',
        'Medium',
        'None'
      )
    ]
    self.new_asset_props = [
      AssetEnvironmentProperties(
        environmentName='Stroke',
        associations=[[0,"Association","1..*","","","1","Association",0,"Grid meta-data"]],
        syProperties=self.new_asset_sec_attr,
        pRationale=[]
      )
    ]
    self.new_asset_dict = {
      'session_id': 'test',
      'object': self.new_asset
    }
Пример #11
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_attacker_name = 'Mallory'
   self.existing_environment_name_1 = 'Stroke'
   self.existing_environment_name_2 = 'Psychosis'
   self.existing_motive_names = ['Hactivism', 'Money']
   self.existing_role_names = ['Hacker', 'Developer']
   self.existing_capabilities = [
     {
       'name':'Resources/Equipment',
       'value': 'Low'
     },
     {
       'name': 'Knowledge/Methods',
       'value': 'High'
     }
   ]
   attacker_class = Attacker.__module__+'.'+Attacker.__name__
Пример #12
0
 def testModelCreation(self):
   b = Borg()  
   b.get_dbproxy().classModel('Psychosis')
   b.get_dbproxy().classModel('Psychosis','',True)
   b.get_dbproxy().classModel('Psychosis','Clinical data',True)
   b.get_dbproxy().goalModel('Psychosis')
   b.get_dbproxy().goalModel('Psychosis','Process clinical data on NeuroGrid')
   b.get_dbproxy().responsibilityModel('Psychosis')
   b.get_dbproxy().responsibilityModel('Psychosis','Data Consumer')
   b.get_dbproxy().obstacleModel('Psychosis')
   b.get_dbproxy().obstacleModel('Psychosis','Unauthorised portal access')
   b.get_dbproxy().taskModel('Psychosis')
   b.get_dbproxy().taskModel('Psychosis','Upload data')
   b.get_dbproxy().riskAnalysisModel('Psychosis')
   b.get_dbproxy().riskAnalysisModel('Psychosis','risk','Unauthorised Certificate Access')
   b.get_dbproxy().riskObstacleModel('Unauthorised Certificate Access','Psychosis')
   b.get_dbproxy().assumptionPersonaModel('Claire')
   b.get_dbproxy().textualArgumentationModel('Claire','Activities')
   
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/ACME_Water.xml',1,'test')
   importLocationsFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/PooleWWTW.xml','test')
   b.get_dbproxy().locationsRiskModel('PooleWWTW','Day')
Пример #13
0
def file_import(importFile,mFormat,overwriteFlag,session_id = None):
  if overwriteFlag == None:
    overwriteFlag = 1

  if (os.access(importFile, os.R_OK)) == False:
    raise ARMException("Cannot access " + importFile)

  from cairis.mio.ModelImport import importSecurityPatternsFile, importAttackPattern,importTVTypeFile,importDirectoryFile,importRequirementsFile, importRiskAnalysisFile, importUsabilityFile, importAssociationsFile, importProjectFile, importDomainValuesFile, importComponentViewFile, importSynopsesFile,importProcessesFile,importAssetsFile,importLocationsFile,importModelFile,importMisusabilityFile,importDataflowsFile

  msgStr = ''
  if (mFormat == 'securitypattern' or mFormat == 'Security Pattern'):
    msgStr += importSecurityPatternsFile(importFile,session_id = session_id)
  elif (mFormat == 'attackpattern' or mFormat == 'Attack Pattern'):
    msgStr += importAttackPattern(importFile,session_id)
  elif (mFormat == 'tvtypes' or mFormat == 'Threat and Vulnerability Types'):
    msgStr += importTVTypeFile(importFile,int(overwriteFlag),session_id)
  elif (mFormat == 'directory' or mFormat == 'Threat and Vulnerability Directory'):
    msgStr += importDirectoryFile(importFile,int(overwriteFlag),session_id)
  elif (mFormat == 'requirements' or mFormat == 'Requirements'):
    msgStr += importRequirementsFile(importFile,session_id)
  elif (mFormat == 'riskanalysis' or mFormat == 'Risk Analysis'):
    msgStr += importRiskAnalysisFile(importFile,session_id)
  elif (mFormat == 'usability' or mFormat == 'Usability'):
    msgStr += importUsabilityFile(importFile,session_id)
  elif (mFormat == 'misusability' or mFormat == 'Misusability'):
    msgStr += importMisusabilityFile(importFile,session_id)
  elif (mFormat == 'associations' or mFormat == 'Associations'):
    msgStr += importAssociationsFile(importFile,session_id)
  elif (mFormat == 'project' or mFormat == 'Project data'):
    msgStr += importProjectFile(importFile,session_id)
  elif (mFormat == 'domainvalues' or mFormat == 'Domain Values'):
    msgStr += importDomainValuesFile(importFile,session_id)
  elif (mFormat == 'architecturalpattern' or mFormat == 'Architectural Pattern'):
    msgStr += importComponentViewFile(importFile,session_id)
  elif (mFormat == 'synopses' or mFormat == 'Synopses'):
    msgStr += importSynopsesFile(importFile,session_id)
  elif (mFormat == 'processes' or mFormat == 'Processes'):
    msgStr += importProcessesFile(importFile,session_id)
  elif (mFormat == 'assets' or mFormat == 'Assets'):
    msgStr += importAssetsFile(importFile,session_id)
  elif (mFormat == 'locations' or mFormat == 'Locations'):
    msgStr += importLocationsFile(importFile,session_id)
  elif (mFormat == 'dataflows' or mFormat == 'Dataflows'):
    msgStr += importDataflowsFile(importFile,session_id)
  elif (mFormat == 'all' or mFormat == 'Model'):
    msgStr += importModelFile(importFile,int(overwriteFlag),session_id)
  else:
    raise ARMException('Input model type ' + mFormat + ' not recognised')
  return 0
Пример #14
0
 def setUp(self):
     cairis.core.BorgFactory.initialise()
     importModelFile(
         os.environ['CAIRIS_SRC'] +
         '/../examples/exemplars/NeuroGrid/NeuroGrid.xml', 1, 'test')
Пример #15
0
 def setUpClass(cls):
   cairis.core.BorgFactory.initialise()
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1)
   importSecurityPatterns(os.environ['CAIRIS_SRC'] + '/../examples/architecture/schumacher_patterns.xml')
Пример #16
0
 def setUpClass(cls):
     cairis.core.BorgFactory.initialise()
     importModelFile(os.environ["CAIRIS_SRC"] + "/../examples/exemplars/NeuroGrid/NeuroGrid.xml", 1)
     importSecurityPatterns(os.environ["CAIRIS_SRC"] + "/../examples/architecture/schumacher_patterns.xml")
Пример #17
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/DFDTestModel.xml',1,'test')
Пример #18
0
 def setUp(self):
   # region Class fields
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos_presituate.xml',1,'test')
   self.logger = logging.getLogger(__name__)
Пример #19
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/testusecase.xml',0,'test')
Пример #20
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   importSecurityPatternsFile(os.environ['CAIRIS_SRC'] + '/../examples/architecture/schumacher_patterns.xml','test')
Пример #21
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   importSecurityPatternsFile(os.environ['CAIRIS_SRC'] + '/../examples/architecture/schumacher_patterns.xml','test')
Пример #22
0
 def setUpClass(cls):
     importModelFile(os.environ["CAIRIS_SRC"] + "/../examples/exemplars/NeuroGrid/NeuroGrid.xml", 1, "test")
Пример #23
0
 def setUpClass(cls):
     cairis.core.BorgFactory.initialise()
     importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos.xml', 1)
Пример #24
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/NeuroGridTest.xml',1,'test')
Пример #25
0
 def setUpClass(cls):
     cairis.core.BorgFactory.initialise()
     importModelFile(os.environ["CAIRIS_SRC"] + "/test/webinos.xml", 1)
Пример #26
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos.xml',1,'test')
   importComponentViewFile(os.environ['CAIRIS_SRC'] + '/test/ContextPolicyManagement.xml','test')
Пример #27
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   importDirectoryFile(os.environ['CAIRIS_SRC'] + '/../examples/directories/ics_directory.xml',0,'test')
Пример #28
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/ACME_Water.xml',1,'test')
   importLocationsFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/PooleWWTW.xml','test')
Пример #29
0
 def setUp(self):
   cairis.core.BorgFactory.initialise()
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
Пример #30
0
 def setUp(self):
   # region Class fields
   self.logger = logging.getLogger(__name__)
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
Пример #31
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_environment_name = 'Stroke'
   self.environment_class = Environment.__module__+'.'+Environment.__name__
Пример #32
0
 def setUp(self):
     # region Class fields
     self.logger = logging.getLogger(__name__)
     importModelFile(
         os.environ['CAIRIS_SRC'] +
         '/../examples/exemplars/NeuroGrid/NeuroGrid.xml', 1, 'test')
Пример #33
0
 def setUpClass(cls):
     importModelFile(
         os.environ['CAIRIS_SRC'] +
         '/../examples/exemplars/NeuroGrid/NeuroGrid.xml', 1, 'test')
     importRequirementsFile(
         os.environ['CAIRIS_SRC'] + '/test/testusecase.xml', 'test')
Пример #34
0
 def setUpClass(cls):
     importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos.xml', 1,
                     'test')
Пример #35
0
 def setUpClass(cls):
     importModelFile(
         os.environ['CAIRIS_SRC'] +
         '/../examples/exemplars/ACME_Water/ACME_Water.xml', 1, 'test')
     addTestData()
Пример #36
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
   # region Class fields
   self.logger = logging.getLogger(__name__)
   self.existing_environment_name = 'Stroke'
   self.environment_class = Environment.__module__+'.'+Environment.__name__
Пример #37
0
 def setUpClass(cls):
     importModelFile(
         os.environ['CAIRIS_SRC'] +
         '/../examples/exemplars/NeuroGrid/NeuroGrid.xml', 1, 'test')
Пример #38
0
 def setUpClass(cls):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/ACME_Water.xml',1,'test')
   addTestData() 
Пример #39
0
 def setUp(self):
     cairis.core.BorgFactory.initialise()
     importModelFile(os.environ["CAIRIS_SRC"] + "/../examples/exemplars/NeuroGrid/NeuroGrid.xml", 1, "test")
Пример #40
0
 def setUp(self):
   importModelFile(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/NeuroGrid/NeuroGrid.xml',1,'test')
Пример #41
0
 def setUpClass(cls):
     importModelFile(os.environ['CAIRIS_SRC'] + '/test/webinos.xml', 1,
                     'test')
     importComponentViewFile(
         os.environ['CAIRIS_SRC'] + '/test/ContextPolicyManagement.xml',
         'test')