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