Commit Graph

896 Commits

Author SHA1 Message Date
Chris PeBenito
16a3ffbdf1 DomainTransitionAnalysis: Silence wrong lint errors. 2017-08-05 17:14:54 -04:00
Chris PeBenito
e918b3741a .travis.yml: Switch to tox-travis 2017-08-05 16:49:23 -04:00
Chris PeBenito
f8eaafc53f setup.py: Update for travis-ci. 2017-08-05 15:55:35 -04:00
Chris PeBenito
0a5897aeaa .travis.yml: Update for 2.7 userspace. 2017-08-05 15:55:07 -04:00
Chris PeBenito
43fee33c71 Merge pull request #168 from karlwmacmillan/append_perm_map
Mark append as a 10 in the perm_map file.
2017-03-13 15:47:03 -05:00
Karl MacMillan
26a8b1ba73 Mark append as a 10 in the perm_map file.
I checked and it looks like append has been a 1 for permission weighting since
the very beginning. But that makes no sense - append lets you write to files.
So this should be a 10.

I changed all instances of append but, honestly, I'm not clear on many of them.

I did verify that if you open a file with O_APPEND and then write to that file
you only need append - you don't need write. Here is my test program:

int main(int argc, char** argv) {
  int fd = open("test_file", O_APPEND | O_CREAT | O_WRONLY, S_IRWXU | S_IRWXG);
  char buf[256];

  ssize_t b = write(fd, buf, 256);
  printf("%zd\n", b);
}

Running this in a domain with no permissions shows that we need:

allow lprog user_home_dir_t:file { append create open };

Which is what I expected - but this being wrong for so long made me question
my understanding of how this worked.
2017-03-12 22:54:31 -04:00
Chris PeBenito
a484867c94 Merge pull request #166 from fishilico/fix_apol_help
Fix Apol help
2017-02-15 18:33:17 -05:00
Nicolas Iooss
dae1080d51
Update compiled Apol Help files 2017-02-15 21:37:49 +01:00
Nicolas Iooss
3868613c8f
Generate Apol compressed help file with "setup.py build_qhc"
"setup.py build_qhc" invokes qcollectiongenerator on qhc/apol.qhcp,
which produces two files:
- apol.qhc, a Qt Help Collection file
- apol.qch, a Qt Compressed Help file

As apol.qhc is merely a set of metadata with a relative link to
apol.qch, Qt Assistant requires both files in order to display Apol
help.

Make "setup.py build_qhc" build both files in setoolsgui/apol/.

Moreover '*.qch' needs to be added to package_data in order to install
apol.qch.

Fixes: https://github.com/TresysTechnology/setools/issues/165
2017-02-15 21:37:45 +01:00
Chris PeBenito
e3a905f027 Update README and Travis-CI for new libsepol dependence. 2017-01-23 18:31:57 -05:00
Karl MacMillan
e743d2a0ea Ftrules hashtab (#164)
* Search for libsepol in /usr/local

* Support filename transition and range transitions rules in the new hashtable storage of libsepol

* Fix off-by-one bug in traversing hashtables and minor compile fixes under Fedora 25.

* Remove debugging.

* The policy_define.c that uses hashtables was not setting the otype for filetrans_rules. This
appears intentional (the hashtable is just being filled out to detect duplicates based on the comments),
but for qpol was causing problems.
2017-01-23 18:27:22 -05:00
Chris PeBenito
f9a235c2d7 Update Changelog for 4.1.0-rc. 2016-12-11 16:28:47 -05:00
Chris PeBenito
6815c422a9 README: Add SEPOL_SRC docs. 2016-12-04 11:18:39 -05:00
Chris PeBenito
566e61137d _avrule_expand_generator: Improve performance of permission unioning. 2016-12-03 17:06:37 -05:00
Chris PeBenito
5200f0c666 TERulesDifference: Fix bug with unioning permissions.
Unit tests did not correctly test this scenario.
2016-12-03 12:19:53 -05:00
Chris PeBenito
d0288fa861 README.md: Add an explicit build command to the install instructions.
If you switch between branches, the qpol C extension may not be rebuilt
correctly otherwise, causing breakage.
2016-11-20 09:49:59 -05:00
Chris PeBenito
e97afd7467 SEToolsTreeWidget: Subclass QTreeWidget to copy tree to clipboard.
Closes #122
2016-11-13 16:42:42 -05:00
Chris PeBenito
e434c1e688 Merge pull request #157 from fishilico/swig-exception-typo
policyrep: fix a mispelling in SWIG error message
2016-11-13 00:38:17 -05:00
Chris PeBenito
263ba9c070 Merge pull request #156 from fishilico/reproducible_sesearch-A
Make "search -A" output reproducible
2016-11-13 00:37:55 -05:00
Nicolas Iooss
988da4d1f2
Make "search -A" output reproducible
With Python 3, the values in a set are randomly organised. Therefore the
representation of the set of permissions of an allow/dontaudit/...
statement is not stable across execution.

Sort the permissions when converting them as strings.
2016-11-12 22:38:32 +01:00
Nicolas Iooss
d99a5cc31b
policyrep: fix a mispelling in SWIG error message 2016-11-12 21:46:06 +01:00
Chris PeBenito
42c2bbd606 Move data in as package data.
Closes #136.
2016-11-12 11:13:21 -05:00
Chris PeBenito
6927ea885b SummaryTab: Fix handle_unknown output. 2016-11-11 18:22:07 -05:00
Chris PeBenito
60e8b9d7fb setup.py: Support locally-built libsepol.
Set the SEPOL_SRC env. variable to the path to the compiled libsepol
source tree.

Closes #138
2016-11-11 18:21:48 -05:00
Chris PeBenito
c0ebad8d15 SELinuxPolicy: Create enumerations for handle_unknown and target_platform. 2016-11-11 13:58:43 -05:00
Chris PeBenito
85f9a32125 sediff: Fix enum usage. 2016-09-11 10:33:18 -04:00
Chris PeBenito
98eb0f15ce sediff: Add missing check for modified defaults. 2016-09-11 10:33:18 -04:00
Chris PeBenito
0f4887e086 sediff: Clear partial differences once used, to reduce memory usage.
Closes #127
2016-09-11 10:33:18 -04:00
Chris PeBenito
da87bfceb7 diff: Add slots to diff wrappers to reduce memory size.
For #127
2016-09-11 10:32:58 -04:00
Chris PeBenito
3f9a57521e policyrep: Add __slots__ to rules to reduce memory usage.
For #127
2016-09-11 09:28:39 -04:00
Chris PeBenito
77789b7417 BaseTERule: Add additional docs to conditional_block property. 2016-09-07 19:54:20 -04:00
Chris PeBenito
96428e6309 Implement an enumeration for *bounds rule types. 2016-09-03 16:44:13 -04:00
Chris PeBenito
9648d013a2 Implement an enumeration for constraint rule type. 2016-09-03 16:44:13 -04:00
Chris PeBenito
693b5a435b Implement an enumeration for default rule type, value, and range value. 2016-09-03 16:44:13 -04:00
Chris PeBenito
8ea292f934 Implement an enumeration for fs_use_* ruletype. 2016-09-03 16:44:07 -04:00
Chris PeBenito
3178745ffc Implement an enumeration for nodecon IP version. 2016-09-03 16:42:38 -04:00
Chris PeBenito
57e51ec69b Implement an enumeration for portcon protocol. 2016-09-03 16:42:06 -04:00
Chris PeBenito
4b5b6c0970 Implement an enumeration for MLS rule type. 2016-09-03 16:40:54 -04:00
Chris PeBenito
a441a92937 Implement an enumeration for RBAC rule type. 2016-09-03 16:19:52 -04:00
Chris PeBenito
f3fb462c88 Implement an enumeration for TE rule types. 2016-09-03 16:17:07 -04:00
Chris PeBenito
5f9309d05c CriteriaDescriptor/CriteriaSetDescriptor: Implement support for enums. 2016-09-03 09:02:50 -04:00
Chris PeBenito
c680bee717 PolicyRule: Change ruletype property to abstract. 2016-08-25 19:13:11 -04:00
Chris PeBenito
fcadd71b24 Implement utility enumeration for policyrep classes.
Requires enum34 (not enum) package for Python < 3.4.
2016-08-25 19:13:06 -04:00
Chris PeBenito
9f8f8f72c1 Change tool exception handlers to re-raise the exception if debugging.
This will allow the debugger to catch the exception for debugging purposes.
2016-07-22 19:14:40 -04:00
Chris PeBenito
ec0c2da337 SEToolsTableView: Change copy operation to use lists rather than string concatenation. 2016-07-14 21:44:35 -04:00
Chris PeBenito
fb3e14849d apol: Implement CSV export of SEToolsTableView.
Closes #54
2016-07-14 21:24:13 -04:00
Chris PeBenito
23e767e8e3 ObjClassQueryTab: Add clear button for common selection.
Closes #152.
2016-07-09 18:45:51 -04:00
Chris PeBenito
adfb31f518 apol: Implement copy from table results.
Closes #123
2016-07-09 18:18:47 -04:00
Chris PeBenito
ddca4536ee apol: Tabs raise exceptions if trying to save while there are errors.
Closes #97
Closes #98
2016-07-09 13:22:09 -04:00
Chris PeBenito
5fd724b300 apol: Convert tabs to use error methods from the base class. 2016-07-09 13:14:31 -04:00