next draft of "secure" repository structure

git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@3289 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Jürgen Doser 2005-11-01 16:35:23 +00:00
parent d29962fec9
commit 9db920768b
6 changed files with 320 additions and 2 deletions

View File

@ -94,9 +94,9 @@ use "xmi_idtable.sml"; (* auxiliary table to store and dereference xmi.id's *
use "xmi2rep.sml"; (* conversion XMI to Rep *)
(* use "mds.sig";
use "mds.sig";
use "component_uml.sml";
use "secure_uml.sml";
use "rep_secure.sig";
use "rep_secure.sml";
*)

71
src/component_uml.sml Normal file
View File

@ -0,0 +1,71 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* component_uml.sml - a design language implementing mds.sig for
* component-based systems
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Juergen Doser <doserj@inf.ethz.ch>
* Burkhart Wolff <bwolff@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
structure ComponentUML : DESIGN_LANGUAGE =
struct
(* ComponentUML is a simple language for component-based modeling *)
(* It speaks about entities, methods, and attributes: *)
(* FIX: using Path for methods is unsafe, there can be severable *)
(* methods with the same name, but different signature. *)
type Resource = string * Rep_OclType.Path
val resource_types = ["Entity","EntityMethod","EntityAttribute"]
(* does nothing sensible, but perhaps you get the idea...*)
fun contained_resources ("Entity",c) = nil
datatype Action = SimpleAction of string * Resource
| CompositeAction of string * Resource
val action_names = ["create","read","update","delete","full_access","execute"]
(* not yet complete: *)
fun actions_of (e as ("Entity", c)) = [SimpleAction ("create", e),
CompositeAction ("read", e),
CompositeAction ("update", e),
SimpleAction ("delete", e),
CompositeAction ("full_access",e)]
| actions_of (m as ("EntityMethod", p)) = [SimpleAction ("execute", m)]
| actions_of (a as ("EntityAttribute", p)) = [SimpleAction ("read", a),
SimpleAction ("update", a),
CompositeAction ("full_access", a)]
fun resource_of (SimpleAction x) = #2 x
| resource_of (CompositeAction x) = #2 x
(* does nothing sensible, but perhaps you get the idea...*)
fun subordinated_actions (SimpleAction _) = nil
| subordinated_actions (CompositeAction ("read",("Entity", c))) =
let val read_attributes = nil
val read_methods = nil
in
List.concat [read_attributes,read_methods]
end
| subordinated_actions (CompositeAction _) = nil
end

80
src/mds.sig Normal file
View File

@ -0,0 +1,80 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* mds.sig - signatures for design and security languages
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Juergen Doser <doserj@inf.ethz.ch>
* Burkhart Wolff <bwolff@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
(* a design language specifies what the protected resources and the *)
(* possible actions on these resources are *)
signature DESIGN_LANGUAGE =
sig
type Resource
val resource_types: string list
val contained_resources : Resource -> Resource list
datatype Action = SimpleAction of string * Resource
| CompositeAction of string * Resource
val action_names: string list
val subordinated_actions: Action -> Action list
val actions_of : Resource -> Action list
val resource_of: Action -> Resource
end
(* A security language speaks about users, and their permissions: *)
(* at this level, this is completeley independent of the access *)
(* control model used in the application *)
signature SECURITY_LANGUAGE =
sig
structure Design : DESIGN_LANGUAGE
type Configuration
type Config_Type = string
val type_of : Configuration -> Config_Type
val is_empty: Configuration -> bool
type User
val name_of : User -> string
type Permission
(* a bit unclear, which of the following we really need *)
val users_of : Permission -> User list
(* val permissions_of : User -> Permission list *)
val check_permission: User * Permission -> bool
val actions_of : Permission -> Design.Action list
val permissions_of : Design.Action -> Permission list
val parse: Rep_Core.Classifier list -> (Rep_Core.Classifier list * Configuration)
end

35
src/rep_secure.sig Normal file
View File

@ -0,0 +1,35 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* rep_secure.sig - repository signature for uml models with security
* specifications
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Juergen Doser <doserj@inf.ethz.ch>
* Burkhart Wolff <bwolff@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
signature REP_SECURE =
sig
structure Security : SECURITY_LANGUAGE
type Model = Rep_Core.Classifier list * Security.Configuration
val readXMI: string -> Model
end

41
src/rep_secure.sml Normal file
View File

@ -0,0 +1,41 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* rep_secure.sml - repository structure for uml models with security
* specifications
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Juergen Doser <doserj@inf.ethz.ch>
* Burkhart Wolff <bwolff@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
functor Rep_Secure(structure Security : SECURITY_LANGUAGE) : REP_SECURE =
struct
structure Security = Security
type Model = Rep_Core.Classifier list * Security.Configuration
val readXMI = Security.parse o Xmi2Rep.readXMI
end
structure Rep_SecureUML_ComponentUML
= Rep_Secure(structure Security = SecureUML(structure Design=ComponentUML))

91
src/secure_uml.sml Normal file
View File

@ -0,0 +1,91 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* secure_uml.sml - a security language implementing mds.sig
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Juergen Doser <doserj@inf.ethz.ch>
* Burkhart Wolff <bwolff@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
(* SecureUML is a simple security language, based on RBAC, where permissions *)
(* can be further constrained using OCL: *)
functor SecureUML(structure Design: DESIGN_LANGUAGE):SECURITY_LANGUAGE =
struct
structure Design : DESIGN_LANGUAGE = Design
type User = string
fun name_of (u:User) = u
datatype Subject = Group of string * (string list)
| User of User
type Role = string
type SubjectAssignment = (Subject * (Role list)) list
(* fun actions_of (p:Permission) = #actions p*)
type Permission = {name: string,
roles: Role list,
constraints: Rep_OclTerm.OclTerm list,
actions: Design.Action list }
fun actions_of (p:Permission) = #actions p
type Config_Type = string
type 'a partial_order = ('a * 'a) list
(* unclear yet how this will look like:
fun domain_of (x:'a partial_order) = ...
fun closure_of (x:'a partial_order) = ...
*)
type Configuration = { config_type: Config_Type,
permissions: Permission list,
subjects: Subject list,
(* groups: Group partial_order,*)
roles: Role partial_order,
sa: SubjectAssignment }
fun type_of (c:Configuration) = #config_type c
fun is_empty (c:Configuration) = List.null (#permissions c) andalso
List.null (#subjects c)
(* the following functions have yet to be implemented *)
fun users_of p = nil
fun check_permission (u,p) = false
fun permissions_of u = nil
fun parse (cs:Rep_Core.Classifier list) = (cs,{config_type = "SecureUML",
permissions = nil,
subjects = nil,
roles = nil,
sa = nil})
end