278df60f98efb99bda6a59dae6b4c7b9ca134315
[src/app-framework-main.git] / doc / application-framework.md
1
2 Application framework
3 =====================
4
5     version: 1
6     Date:    29 mai 2016
7     Author:  José Bollo
8
9 TABLE-OF-CONTENT-HERE
10
11 Foreword
12 --------
13
14 This document describes what we intend to do. It may happen that our
15 current implementation and the content of this document differ.
16
17 In case of differences, it is assumed that this document is right
18 and the implementation is wrong.
19
20
21 Overview
22 --------
23
24 The application framework on top of the security framework
25 provides the components to install and uninstall applications
26 and to run it in a secured environment.
27
28 The goal is to manage applications and to hide the details of
29 the security framework to the applications.
30
31 For the reasons explained in introduction, we did not used the
32 application framework of Tizen as is but used an adaptation of it.
33
34 The basis is kept identical: the applications are distributed
35 in a digitally signed container that must match the specifications
36 of widgets (web applications). This is described by the technical
37 recomendations [widgets] and [widgets-digsig] of the W3 consortium.
38
39 This model allows the distribution of HTML, QML and binary applications.
40
41 The management of signatures of the widget packages 
42 This basis is not meant as being rigid and it can be extended in the
43 futur to include for example incremental delivery.
44
45
46 Comparison to other frameworks
47 ------------------------------
48
49 ### Tizen framework
50
51 ### xdg-app
52
53 ### ostro
54
55 Organisation of directory of applications
56 =========================================
57
58 The main path for applivcations are: APPDIR/PKGID/VER.
59
60 Where:
61
62  - APPDIR is as defined above
63  - PKGID is a directory whose name is the package identifier
64  - VER is the version of the package MAJOR.MINOR
65
66 This organisation has the advantage to allow several versions to leave together.
67 This is needed for some good reasons (rolling back) and also for less good reasons (user habits).
68
69 Identity of installed files
70 ---------------------------
71
72 All the files are installed as the user "userapp" and group "userapp".
73 All files have rw(x) for user and r-(x) for group and others.
74
75 This allows any user to read the files.
76
77
78 Labelling the directories of applications
79 -----------------------------------------
80
81
82 Organisation of data
83 ====================
84
85 The data of a user are in its directory and are labelled using the labels of the application
86
87 Setting Smack rules for the application
88 =======================================
89
90 For Tizen, the following rules are set by the security manager for each application.
91
92     System ~APP~             rwx
93     System ~PKG~             rwxat
94     System ~PKG~::RO         rwxat
95     ~APP~  System            wx
96     ~APP~  System::Shared    rxl
97     ~APP~  System::Run       rwxat
98     ~APP~  System::Log       rwxa
99     ~APP~  _                 l
100     User   ~APP~             rwx
101     User   ~PKG~             rwxat
102     User   ~PKG~::RO         rwxat
103     ~APP~  User              wx
104     ~APP~  User::Home        rxl
105     ~APP~  User::App::Shared rwxat
106     ~APP~  ~PKG~             rwxat
107     ~APP~  ~PKG~::RO         rxl
108
109 Here, ~PKG~ is the identifier of the package and ~APP~ is the identifier of the application.
110
111 What user can run an application?
112 =================================
113
114 Not all user are able to run all applications.
115 How to manage that?
116
117
118
119
120
121
122 [meta-intel]:       https://github.com/01org/meta-intel-iot-security                "A collection of layers providing security technologies"
123 [widgets]:          http://www.w3.org/TR/widgets                                    "Packaged Web Apps"
124 [widgets-digsig]:   http://www.w3.org/TR/widgets-digsig                             "XML Digital Signatures for Widgets"
125 [libxml2]:          http://xmlsoft.org/html/index.html                              "libxml2"
126 [openssl]:          https://www.openssl.org                                         "OpenSSL"
127 [xmlsec]:           https://www.aleksey.com/xmlsec                                  "XMLSec"
128 [json-c]:           https://github.com/json-c/json-c                                "JSON-c"
129 [d-bus]:            http://www.freedesktop.org/wiki/Software/dbus                   "D-Bus"
130 [libzip]:           http://www.nih.at/libzip                                        "libzip"
131 [cmake]:            https://cmake.org                                               "CMake"
132 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
133 [app-manifest]:     http://www.w3.org/TR/appmanifest                                "Web App Manifest"
134 [tizen-security]:   https://wiki.tizen.org/wiki/Security                            "Tizen security home page"
135 [tizen-secu-3]:     https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview         "Tizen 3 security overview"
136
137