summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-10-25policychecker: print error related informationtizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasesubmit/tizen_6.5/20211028.162501submit/tizen_6.0_hotfix/20201103.114804submit/tizen_6.0_hotfix/20201102.192504submit/tizen_6.0/20201029.205104submit/tizen/20191031.025611accepted/tizen/unified/20191101.042154accepted/tizen/8.0/unified/20231005.093735accepted/tizen/7.0/unified/hotfix/20221116.105702accepted/tizen/7.0/unified/20221110.063450accepted/tizen/6.5/unified/20211028.114312accepted/tizen/6.0/unified/hotfix/20201103.003704accepted/tizen/6.0/unified/20201030.115416tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.0_hotfixtizen_6.0accepted/tizen_unifiedaccepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unifiedsanghyeok.oh1-6/+152
Change-Id: I07dbeffd02cf67f98ec0363b7b4aaa55e8f34e02 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-10-21policychecker: skip preprocessor iso_dsdl_include.xslsanghyeok.oh1-15/+59
* 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>
2019-09-06policychecker: check syntaxtizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185104submit/tizen_5.5/20191031.000004submit/tizen/20190918.103006submit/tizen/20190916.012648submit/tizen/20190910.115228accepted/tizen/unified/20190919.010711accepted/tizen/5.5/unified/mobile/hotfix/20201027.090448accepted/tizen/5.5/unified/20191031.022716tizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfixAdrian Szyndela1-0/+53
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
2019-09-04policychecker: add option(--system --session)sanghyeok.oh1-22/+56
Change-Id: Idf5d2cbbb0173461a609fa7e323b82e31e9618e7 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-09-03policychecker: is allow own for me present?Adrian Szyndela1-0/+8
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
2019-08-23policychecker: receiving signals without sendersubmit/tizen/20190827.044306submit/tizen/20190827.025238accepted/tizen/unified/20190828.011037Adrian Szyndela1-1/+1
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
2019-08-23policychecker: allow i-dont-need-any-name configsAdrian Szyndela1-7/+0
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
2019-07-25policychecker: allow 'destination without interface' rulessubmit/tizen/20190807.012805submit/tizen/20190807.012600submit/tizen/20180808.030253accepted/tizen/unified/20190807.111828Adrian Szyndela1-2/+0
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
2019-05-08policychecker: rename to dbuspolicy-checkersubmit/tizen/20190509.081837accepted/tizen/unified/20190510.012043sanghyeok.oh3-4/+4
Use 'dbuspolicy-' as prefix of dbus policy related tool name Change-Id: I72a6ab822312346a4efc51bd9a5737c52ce90a11 Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
2019-05-07policychecker: add rule for group 'priv_*'submit/tizen/20190507.115737accepted/tizen/unified/20190508.111129sanghyeok.oh1-0/+1
/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>
2019-04-19Set PATH env explicitly for better securityHyotaek Shim2-1/+3
Change-Id: If9f558321e170d9653df6715047949dcbf82900d Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2019-01-11policychecker: allow signal rules if send_path is presentsubmit/tizen/20190115.084148accepted/tizen/unified/20190115.173220Adrian Szyndela1-2/+2
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
2019-01-09policychecker: add rules for send_destination_prefixAdrian Szyndela1-10/+50
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
2018-12-12dbus-policychecker: adjust maxdepth for xsltprocsubmit/tizen/20181217.062834accepted/tizen/unified/20181217.142407Adrian Szyndela1-1/+1
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
2018-11-15policychecker: allow sending signal rules with only send_interfacesubmit/tizen/20181116.003516accepted/tizen/unified/20181119.013241Adrian Szyndela1-1/+1
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
2018-10-05policychecker: simplified field selectionsubmit/tizen/20181112.020121submit/tizen/20181112.020057accepted/tizen/unified/20181112.060917Adrian Szyndela1-8/+11
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
2018-10-04Add comments on Cynara privilege formatsHyotaek Shim1-0/+6
Change-Id: I3a620bd89deed55231a7c2b52f3abb154c28c805 Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2018-10-03policychecker: add more types of privilegesAdrian Szyndela1-1/+8
Added three more types of privileges. Requested by bro kim. Change-Id: I3219a7b10cd4b5c784a88abe1fb034dde10bb0ff
2018-08-20policychecker: removed at_console from checking duplicatessubmit/tizen_5.0/20181112.020142submit/tizen_5.0/20181101.000004submit/tizen/20180820.105030accepted/tizen/unified/20180821.091103accepted/tizen/5.0/unified/20181113.090038accepted/tizen/5.0/unified/20181102.021905Adrian Szyndela1-22/+2
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
2018-08-20policychecker: modified 'Unconstrained allow' ruleAdrian Szyndela1-3/+27
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
2018-07-11packaging: make package 'noarch' as it contains only scriptsKarol Lewandowski1-0/+1
Change-Id: Ib7aafe0ce59da009259f22469d83cfc7bf25f701
2018-07-11packaging: minor fixesKarol Lewandowski1-4/+4
Change-Id: I8b61b31c52ff190ac6541e90762fd0895ed018e8
2018-06-29packaging, integrating with Tizensubmit/tizen/20180705.081312accepted/tizen/unified/20180705.172727Adrian Szyndela12-104/+370
Also, some improvements in shell scripts. Change-Id: I10a06b8b30f45722746361b7ce27364baaebc957
2018-06-28Policy checker: initial versionAleksy Barcz24-0/+9076
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
2018-06-22Initial empty repositoryHEADmasterTizen Infrastructure0-0/+0