Security/Tizen 2.X vconf

From Tizen Wiki
Jump to: navigation, search

Objective

Since vconf is just a library and based on direct file access, if we assign same label on all of the vconf files, then all applications will be able to access them without any access control. Tizen 2.X, we specified vconf access control policy based on the usage scenarios.

  1. Only one module reads and writes
  2. Some modules read and write
  3. Some defined modules(one or more) read and write, all others read.

Categorization

  • Only one module reads and writes
    • Assign same label with the accessing module. This is basically treated as a private file.
      • If the owner module creates the vconf file on runtime, the file will have the same label of the module automatically.
    • Since there is no proper Smack rule for any others, other modules cannot access the file, therefore, we don't need any additional rules.
  • Some modules read and write
    • Related developers can determine the Smack label of the vconf file and add corresponding Smack rules.
    • Since there is no proper Smack rule for other modules, only related modules can access the file.
  • Some defined modules(one or more) read and write, all others read.
    • Use one of predefined smack labels. (prefix: system::vconf_)
    • All modules(including applications) will have read permission to those files and only restricted modules have write permission.
    • label list
      • setting : only setting application can write
      • inhouse : preloaded applications and platform modules can write
      • privacy : only privacy related modules can write
      • system : app framework, security, system, base
      • multimedia : graphics & UI, multimedia
      • network : web, connectivity
      • misc : other keys

Labeling

  • Use -s option of vconftool command
    • # vconftool set -t [type] vconf/key/path "[value]" -s [smack label]
  • If do not use -s option, no one can write to that key because that will have '_' label.

Change UID & GID

  • Use -u option in order to change euid of made key
    • # vconftool set -t [type] vconf/key/path "[value]" -u [uid]
    • This option will change euid and egid of key.
  • Use -g option in order to change egid of made key
    • # vconftool set -t [type] vconf/key/path "[value]" -g [gid]
    • This option will change ONLY egid of key.
  • If you use -u option and -g option together, -g option is ignored.