platform/core/system/dbus-tools.git
2 years agoAdd IPC benchmark 20/264420/11 submit/tizen/20211108.062031
Unsung Lee [Fri, 17 Sep 2021 08:18:15 +0000 (17:18 +0900)]
Add IPC benchmark

Change-Id: Ia886f1d1d123185205d04f15efcc60deeb9909b6
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Add IPC benchmark

Change-Id: Ia886f1d1d123185205d04f15efcc60deeb9909b6
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
4 years agopolicychecker: print error related information 37/216337/6 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen_6.0 tizen_6.0_hotfix tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.0/unified/20201030.115416 accepted/tizen/6.0/unified/hotfix/20201103.003704 accepted/tizen/6.5/unified/20211028.114312 accepted/tizen/7.0/unified/20221110.063450 accepted/tizen/7.0/unified/hotfix/20221116.105702 accepted/tizen/8.0/unified/20231005.093735 accepted/tizen/unified/20191101.042154 submit/tizen/20191031.025611 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 submit/tizen_6.5/20211028.162501 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
sanghyeok.oh [Wed, 23 Oct 2019 11:13:34 +0000 (20:13 +0900)]
policychecker: print error related information

Change-Id: I07dbeffd02cf67f98ec0363b7b4aaa55e8f34e02
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agopolicychecker: skip preprocessor iso_dsdl_include.xsl 36/216136/3
sanghyeok.oh [Mon, 21 Oct 2019 08:15:10 +0000 (17:15 +0900)]
policychecker: skip preprocessor iso_dsdl_include.xsl

* change option argument (--system,--session) to (-s,-u)
* add option (-v, -p) for checker developement

* skip preprocessor
policy checker using single schema file(rules.xsl) and it doesn't need XPath syntax check.
This reduce policy checking time. (3min -> 19sec at tm1)

Schematron's readme.txt states this:

1) First, preprocess your Schematron schema with iso_dsdl_include.xsl.
This is a macro processor to assemble the schema from various parts.
If your schema is not in separate parts, you can skip this stage.
This stage also generates error messages for some common XPath syntax problems.

Change-Id: Id8dbf03d3a4a5107440823b9bcb0ce1830cc4380
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopolicychecker: check syntax 41/213541/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.022716 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090448 accepted/tizen/unified/20190919.010711 submit/tizen/20190910.115228 submit/tizen/20190916.012648 submit/tizen/20190918.103006 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
Adrian Szyndela [Fri, 6 Sep 2019 10:04:25 +0000 (12:04 +0200)]
policychecker: check syntax

This adds a set of checking rules that check for typos, misspellings
in attributes and some of values of attributes, such as send_type.

Based on manual for dbus-daemon, which defines the policy tags
and attributes.

Change-Id: Ieb4795cdb1a4f0642684f8685092675e84e223ea

5 years agopolicychecker: add option(--system --session) 66/212066/2
sanghyeok.oh [Wed, 14 Aug 2019 01:55:40 +0000 (10:55 +0900)]
policychecker: add option(--system --session)

Change-Id: Idf5d2cbbb0173461a609fa7e323b82e31e9618e7
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopolicychecker: is allow own for me present? 65/213265/1
Adrian Szyndela [Tue, 3 Sep 2019 09:59:41 +0000 (11:59 +0200)]
policychecker: is allow own for me present?

This adds two checks which can help with detecting
config files that have no "allow own" or "check own" or "allow own_prefix"
or "check own_prefix" for services the config file is for.

This works by adding two checking rules:
1. a rule that - for a config file containing policy rule "deny own" - warns
   if the file does not contain corresponding "allow own" or "check own"
   policy rule with the same name.
2. a rule that does the same, but for 'own_prefix' instead of 'own'.

Change-Id: I758974724ffc5d5af821c44f4737ed87c9f63f59

5 years agopolicychecker: receiving signals without sender 13/212613/1 accepted/tizen/unified/20190828.011037 submit/tizen/20190827.025238 submit/tizen/20190827.044306
Adrian Szyndela [Fri, 23 Aug 2019 09:46:59 +0000 (11:46 +0200)]
policychecker: receiving signals without sender

This allows specifying of checking rules for signals without
specifying receive_sender. That is, it allows telling who can
receive some kind of signals without telling who can send them.

Without this change every receive checking rule needed receive_sender field.
This change is analogous to sending signals without send_destination.

Change-Id: Ifb0a596980631315d175b33460ad2579265c1e5e

5 years agopolicychecker: allow i-dont-need-any-name configs 12/212612/1
Adrian Szyndela [Fri, 23 Aug 2019 09:37:51 +0000 (11:37 +0200)]
policychecker: allow i-dont-need-any-name configs

This allows configurations that do not concern any owned names, e.g.
configurations for specifying who can receive some specific signals.

Without this change, the checking rules ensure that every policy
configuration file contains at least one <deny send_destination/prefix>
and one <deny own> policy rule. This was introduced when there
was "global default allow" policy in some uses. Nowadays, such policies
are probably long gone.

Anyway, there are still other checking rules present, which complain for
not having proper <deny> rules in default context, if <allow>
rules for a name are present in the configuration file.

Change-Id: Ic4eeee3ff5c8524fda58d17874fe6fdb37fb4d1c

5 years agopolicychecker: allow 'destination without interface' rules 49/210849/2 accepted/tizen/unified/20190807.111828 submit/tizen/20180808.030253 submit/tizen/20190807.012600 submit/tizen/20190807.012805
Adrian Szyndela [Thu, 25 Jul 2019 08:01:33 +0000 (10:01 +0200)]
policychecker: allow 'destination without interface' rules

It seems that the checking rules that require all the policy rules
with send_type="method_call" to have specified send_interface
are too strong.

This relaxes the checking rules a bit by allowing rules that:
- are in the "default" or "mandatory" contexts;
- have 'send_type' or 'receive_type set' to "method_call";
- have specified 'send_destination' or 'receive_sender'.
That is, we don't require "send_interface" or "receive interface" anymore
for such rules.

Change-Id: Iefa9bb5a5e23319c7549fa597ab00b5c88600585

5 years agopolicychecker: rename to dbuspolicy-checker 16/205716/1 accepted/tizen/unified/20190510.012043 submit/tizen/20190509.081837
sanghyeok.oh [Wed, 8 May 2019 11:58:15 +0000 (20:58 +0900)]
policychecker: rename to dbuspolicy-checker

Use 'dbuspolicy-' as prefix of dbus policy related tool name

Change-Id: I72a6ab822312346a4efc51bd9a5737c52ce90a11
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopolicychecker: add rule for group 'priv_*' 33/204333/2 accepted/tizen/unified/20190508.111129 submit/tizen/20190507.115737
sanghyeok.oh [Tue, 23 Apr 2019 06:18:15 +0000 (15:18 +0900)]
policychecker: add rule for group 'priv_*'

/usr/share/security-manager/policy/privilege-group.list

In case of App, 'priv_*' group is assigned by it's cynara privilege.
But, user daemon also has related 'priv_*' groups.
Due to this group assignment policy rule for group priv_* affects application, user daemons and process who has priv_*.
To prevent this unintended situation, block rule for group 'priv_*'.

Change-Id: I888f28375b017ec00c5fb85bc59557b2145bffbc
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoSet PATH env explicitly for better security 48/204048/2
Hyotaek Shim [Fri, 19 Apr 2019 02:12:35 +0000 (11:12 +0900)]
Set PATH env explicitly for better security

Change-Id: If9f558321e170d9653df6715047949dcbf82900d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopolicychecker: allow signal rules if send_path is present 09/197509/1 accepted/tizen/unified/20190115.173220 submit/tizen/20190115.084148
Adrian Szyndela [Thu, 10 Jan 2019 11:29:12 +0000 (12:29 +0100)]
policychecker: allow signal rules if send_path is present

In case a rule contained send_path, we required it also to have
send_destination or send_destination_prefix.
However, a rule may be crafted for signals, which are broadcast,
therefore they don't have any destination at all.
This patch relaxes the requirement a bit, allowing rules
having send_path without send_destination under condition that
the rule contains send_interface and send_type='signal' attributes.

Change-Id: I99ff19271121f726df81e2aed8a124a78f7eadbc

5 years agopolicychecker: add rules for send_destination_prefix 08/197108/2
Adrian Szyndela [Wed, 9 Jan 2019 15:46:32 +0000 (16:46 +0100)]
policychecker: add rules for send_destination_prefix

Added rules for send_destination_prefix.

Additionally, modified 'default denials' rule to take into account
possible own_prefix values. This is limited by XPath/Schematron
possibilities, and is currently set to 8 prefixes for each
tested destination.

Change-Id: I7a653b1f55339e67e63e9c97b0c6ba37ff2c9b73

5 years agodbus-policychecker: adjust maxdepth for xsltproc 33/195333/1 accepted/tizen/unified/20181217.142407 submit/tizen/20181217.062834
Adrian Szyndela [Wed, 12 Dec 2018 15:42:19 +0000 (16:42 +0100)]
dbus-policychecker: adjust maxdepth for xsltproc

Maxdepth 20000 for xsltproc seems to be too low, as it complains
for "potential infinite recursion" when there is no infinite recursion.

Change-Id: I873c8a9a4ba4fd58e13557308bb55cf2470d9b82

5 years agopolicychecker: allow sending signal rules with only send_interface 79/193179/1 accepted/tizen/unified/20181119.013241 submit/tizen/20181116.003516
Adrian Szyndela [Thu, 15 Nov 2018 16:01:27 +0000 (17:01 +0100)]
policychecker: allow sending signal rules with only send_interface

If the global policy for signals is deny, then we need a way
to choose who can send signals. They (usually) have no destination,
so the allowing rules can't have destination.

This commit changes checking rules to allow policy rules with
send_interface constraint, without send_destination, when
send_type="signal" is allows specified.

Change-Id: I041b4e409cbffeae2edaaec8bb2dfa8f60e3994f

5 years agopolicychecker: simplified field selection 39/190639/3 accepted/tizen/unified/20181112.060917 submit/tizen/20181112.020057 submit/tizen/20181112.020121
Adrian Szyndela [Thu, 4 Oct 2018 08:44:17 +0000 (10:44 +0200)]
policychecker: simplified field selection

Privilege field selection was selected using two seds,
but it is sufficient to use one cut, as it is suited
precisely for such tasks.

Additionally, minor improvements:
- removed array in favor of space separated string to avoid bash dependency;
- added call to sort for uniq to work properly;
- introduced a variable for cynara database path.

Change-Id: Ica9455cc14f714a2fe0acbea7fe019d067cbf9eb

5 years agoAdd comments on Cynara privilege formats 73/190573/2
Hyotaek Shim [Thu, 4 Oct 2018 02:52:32 +0000 (11:52 +0900)]
Add comments on Cynara privilege formats

Change-Id: I3a620bd89deed55231a7c2b52f3abb154c28c805
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopolicychecker: add more types of privileges 45/190545/1
Adrian Szyndela [Wed, 3 Oct 2018 13:52:22 +0000 (15:52 +0200)]
policychecker: add more types of privileges

Added three more types of privileges.
Requested by bro kim.

Change-Id: I3219a7b10cd4b5c784a88abe1fb034dde10bb0ff

6 years agopolicychecker: removed at_console from checking duplicates 47/186947/2 accepted/tizen/5.0/unified/20181102.021905 accepted/tizen/5.0/unified/20181113.090038 accepted/tizen/unified/20180821.091103 submit/tizen/20180820.105030 submit/tizen_5.0/20181101.000004 submit/tizen_5.0/20181112.020142
Adrian Szyndela [Thu, 16 Aug 2018 12:40:21 +0000 (14:40 +0200)]
policychecker: removed at_console from checking duplicates

At_console has its own "deprecated" checking rule, so we assume that
at_console rules are those to be removed. Thus, there is no point
in showing "duplicate" warning for duplicate rules in other contexts.

Change-Id: Ifdf7e3745d7ece49772ba3a3aad01a213b657d0c

6 years agopolicychecker: modified 'Unconstrained allow' rule 15/186815/3
Adrian Szyndela [Tue, 14 Aug 2018 13:54:50 +0000 (15:54 +0200)]
policychecker: modified 'Unconstrained allow' rule

Unconstrained allow rule was reporting any allow in context default
or mandatory.
Now, it reports those rules in both contexts that:
- allow send_type='method_call' but do not specify destination and interface;
- allow send_path but do not specify destination;
- allow receive_type='method_call' but do not specify sender and interface;
- allow receive_path but do not specify sender.
Additionally, in user and group context send_destination is required
when send_type="method_call" or send_path is present, and receive_sender
is required when receive_type="method_call" or receive_path is present.

Change-Id: Icd822bf4b3e2f105a07e80ca61415410faaeb00a

6 years agopackaging: make package 'noarch' as it contains only scripts 33/183833/1
Karol Lewandowski [Wed, 11 Jul 2018 10:07:55 +0000 (12:07 +0200)]
packaging: make package 'noarch' as it contains only scripts

Change-Id: Ib7aafe0ce59da009259f22469d83cfc7bf25f701

6 years agopackaging: minor fixes 32/183832/1
Karol Lewandowski [Wed, 11 Jul 2018 10:07:45 +0000 (12:07 +0200)]
packaging: minor fixes

Change-Id: I8b61b31c52ff190ac6541e90762fd0895ed018e8

6 years agopackaging, integrating with Tizen 76/182976/2 accepted/tizen/unified/20180705.172727 submit/tizen/20180705.081312
Adrian Szyndela [Thu, 28 Jun 2018 12:49:42 +0000 (14:49 +0200)]
packaging, integrating with Tizen

Also, some improvements in shell scripts.

Change-Id: I10a06b8b30f45722746361b7ce27364baaebc957

6 years agoPolicy checker: initial version 37/182737/2
Aleksy Barcz [Mon, 25 Jun 2018 14:27:38 +0000 (16:27 +0200)]
Policy checker: initial version

Policy checker is based on Schematron, which allows writing
declarative checks for xml files (see rules.xml file for details) and
yields xml output (which is converted to plain text for readability, but it
can be converted to any format). The checker is a shell script, it
depends only on xsltproc (libxslt-tools package in Tizen), so it's very
lightweight.

We can run the checker on any single dbus configuration file, e.g.:
./check ./test-policy.conf (a test policy containing violations of all
the implemented rules). So, during a package installation we can run
the checker on it's dbus configuration file.

Change-Id: I523b7a730fc93a0d4f99bc8ba750be7b6f0e051c

6 years agoInitial empty repository master
Tizen Infrastructure [Fri, 22 Jun 2018 05:43:52 +0000 (05:43 +0000)]
Initial empty repository