Lines Matching refs:diff

108     diff = setools.PolicyDifference(p1, p2)  variable
111 print("Policy Properties ({0} Modified)".format(len(diff.modified_properties)))
113 if diff.modified_properties and not args.stats:
114 for name, added, removed in sorted(diff.modified_properties, key=lambda x: x.property):
120 if diff.added_commons or diff.removed_commons or diff.modified_commons or args.common:
122 len(diff.added_commons), len(diff.removed_commons), len(diff.modified_commons)))
123 if diff.added_commons and not args.stats:
124 print(" Added Commons: {0}".format(len(diff.added_commons)))
125 for c in sorted(diff.added_commons):
127 if diff.removed_commons and not args.stats:
128 print(" Removed Commons: {0}".format(len(diff.removed_commons)))
129 for c in sorted(diff.removed_commons):
131 if diff.modified_commons and not args.stats:
132 print(" Modified Commons: {0}".format(len(diff.modified_commons)))
133 for name, mod in sorted(diff.modified_commons.items()):
148 if diff.added_classes or diff.removed_classes or diff.modified_classes or args.class_:
150 len(diff.added_classes), len(diff.removed_classes), len(diff.modified_classes)))
151 if diff.added_classes and not args.stats:
152 print(" Added Classes: {0}".format(len(diff.added_classes)))
153 for c in sorted(diff.added_classes):
155 if diff.removed_classes and not args.stats:
156 print(" Removed Classes: {0}".format(len(diff.removed_classes)))
157 for c in sorted(diff.removed_classes):
159 if diff.modified_classes and not args.stats:
160 print(" Modified Classes: {0}".format(len(diff.modified_classes)))
161 for name, mod in sorted(diff.modified_classes.items()):
176 if diff.added_booleans or diff.removed_booleans or \
177 diff.modified_booleans or args.bool_:
179 len(diff.added_booleans), len(diff.removed_booleans),
180 len(diff.modified_booleans)))
181 if diff.added_booleans and not args.stats:
182 print(" Added Booleans: {0}".format(len(diff.added_booleans)))
183 for a in sorted(diff.added_booleans):
185 if diff.removed_booleans and not args.stats:
186 print(" Removed Booleans: {0}".format(len(diff.removed_booleans)))
187 for a in sorted(diff.removed_booleans):
189 if diff.modified_booleans and not args.stats:
190 print(" Modified Booleans: {0}".format(len(diff.modified_booleans)))
191 for name, mod in sorted(diff.modified_booleans.items()):
199 if diff.added_roles or diff.removed_roles or diff.modified_roles or args.role:
200 print("Roles ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_roles),
201 len(diff.removed_roles),
202 len(diff.modified_roles)))
203 if diff.added_roles and not args.stats:
204 print(" Added Roles: {0}".format(len(diff.added_roles)))
205 for r in sorted(diff.added_roles):
207 if diff.removed_roles and not args.stats:
208 print(" Removed Roles: {0}".format(len(diff.removed_roles)))
209 for r in sorted(diff.removed_roles):
211 if diff.modified_roles and not args.stats:
212 print(" Modified Roles: {0}".format(len(diff.modified_roles)))
213 for name, mod in sorted(diff.modified_roles.items()):
228 if diff.added_types or diff.removed_types or diff.modified_types or args.type_:
229 print("Types ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_types),
230 len(diff.removed_types),
231 len(diff.modified_types)))
232 if diff.added_types and not args.stats:
233 print(" Added Types: {0}".format(len(diff.added_types)))
234 for r in sorted(diff.added_types):
236 if diff.removed_types and not args.stats:
237 print(" Removed Types: {0}".format(len(diff.removed_types)))
238 for r in sorted(diff.removed_types):
240 if diff.modified_types and not args.stats:
241 print(" Modified Types: {0}".format(len(diff.modified_types)))
242 for name, mod in sorted(diff.modified_types.items()):
276 if diff.added_type_attributes or diff.removed_type_attributes or \
277 diff.modified_type_attributes or args.attribute:
279 len(diff.added_type_attributes), len(diff.removed_type_attributes),
280 len(diff.modified_type_attributes)))
281 if diff.added_type_attributes and not args.stats:
282 print(" Added Type Attributes: {0}".format(len(diff.added_type_attributes)))
283 for a in sorted(diff.added_type_attributes):
285 if diff.removed_type_attributes and not args.stats:
286 print(" Removed Type Attributes: {0}".format(len(diff.removed_type_attributes)))
287 for a in sorted(diff.removed_type_attributes):
289 if diff.modified_type_attributes and not args.stats:
290 print(" Modified Type Attributes: {0}".format(len(diff.modified_type_attributes)))
291 for name, mod in sorted(diff.modified_type_attributes.items()):
306 if diff.added_users or diff.removed_users or diff.modified_users or args.user:
307 print("Users ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_users),
308 len(diff.removed_users),
309 len(diff.modified_users)))
310 if diff.added_users and not args.stats:
311 print(" Added Users: {0}".format(len(diff.added_users)))
312 for u in sorted(diff.added_users):
314 if diff.removed_users and not args.stats:
315 print(" Removed Users: {0}".format(len(diff.removed_users)))
316 for u in sorted(diff.removed_users):
318 if diff.modified_users and not args.stats:
319 print(" Modified Users: {0}".format(len(diff.modified_users)))
320 for name, mod in sorted(diff.modified_users.items()):
351 if diff.added_categories or diff.removed_categories or diff.modified_categories \
354 len(diff.added_categories), len(diff.removed_categories),
355 len(diff.modified_categories)))
356 if diff.added_categories and not args.stats:
357 print(" Added Categories: {0}".format(len(diff.added_categories)))
358 for c in sorted(diff.added_categories):
360 if diff.removed_categories and not args.stats:
361 print(" Removed Categories: {0}".format(len(diff.removed_categories)))
362 for c in sorted(diff.removed_categories):
364 if diff.modified_categories and not args.stats:
365 print(" Modified Categories: {0}".format(len(diff.modified_categories)))
366 for name, mod in sorted(diff.modified_categories.items()):
383 if diff.added_sensitivities or diff.removed_sensitivities or diff.modified_sensitivities \
386 len(diff.added_sensitivities), len(diff.removed_sensitivities),
387 len(diff.modified_sensitivities)))
388 if diff.added_sensitivities and not args.stats:
389 print(" Added Sensitivites: {0}".format(len(diff.added_sensitivities)))
390 for s in sorted(diff.added_sensitivities):
392 if diff.removed_sensitivities and not args.stats:
393 print(" Removed Sensitivities: {0}".format(len(diff.removed_sensitivities)))
394 for s in sorted(diff.removed_sensitivities):
396 if diff.modified_sensitivities and not args.stats:
397 print(" Modified Sensitivities: {0}".format(len(diff.modified_sensitivities)))
398 for name, mod in sorted(diff.modified_sensitivities.items()):
415 if diff.added_levels or diff.removed_levels or \
416 diff.modified_levels or args.level:
418 len(diff.added_levels), len(diff.removed_levels),
419 len(diff.modified_levels)))
420 if diff.added_levels and not args.stats:
421 print(" Added Levels: {0}".format(len(diff.added_levels)))
422 for l in sorted(diff.added_levels):
424 if diff.removed_levels and not args.stats:
425 print(" Removed Levels: {0}".format(len(diff.removed_levels)))
426 for l in sorted(diff.removed_levels):
428 if diff.modified_levels and not args.stats:
429 print(" Modified Levels: {0}".format(len(diff.modified_levels)))
430 for level, added_categories, removed_categories, _ in sorted(diff.modified_levels,
446 if diff.added_allows or diff.removed_allows or diff.modified_allows or args.allow:
448 len(diff.added_allows), len(diff.removed_allows), len(diff.modified_allows)))
450 if diff.added_allows and not args.stats:
451 print(" Added Allow Rules: {0}".format(len(diff.added_allows)))
452 for r in sorted(diff.added_allows):
455 if diff.removed_allows and not args.stats:
456 print(" Removed Allow Rules: {0}".format(len(diff.removed_allows)))
457 for r in sorted(diff.removed_allows):
460 if diff.modified_allows and not args.stats:
461 print(" Modified Allow Rules: {0}".format(len(diff.modified_allows)))
463 for rule, added_perms, removed_perms, matched_perms in sorted(diff.modified_allows,
480 if diff.added_neverallows or diff.removed_neverallows or diff.modified_neverallows or \
483 len(diff.added_neverallows), len(diff.removed_neverallows),
484 len(diff.modified_neverallows)))
486 if diff.added_neverallows and not args.stats:
487 print(" Added Neverallow Rules: {0}".format(len(diff.added_neverallows)))
488 for r in sorted(diff.added_neverallows):
491 if diff.removed_neverallows and not args.stats:
492 print(" Removed Neverallow Rules: {0}".format(len(diff.removed_neverallows)))
493 for r in sorted(diff.removed_neverallows):
496 if diff.modified_neverallows and not args.stats:
497 print(" Modified Neverallow Rules: {0}".format(len(diff.modified_neverallows)))
500 diff.modified_neverallows, key=lambda x: x.rule):
516 if diff.added_auditallows or diff.removed_auditallows or diff.modified_auditallows or \
519 len(diff.added_auditallows), len(diff.removed_auditallows),
520 len(diff.modified_auditallows)))
522 if diff.added_auditallows and not args.stats:
523 print(" Added Auditallow Rules: {0}".format(len(diff.added_auditallows)))
524 for r in sorted(diff.added_auditallows):
527 if diff.removed_auditallows and not args.stats:
528 print(" Removed Auditallow Rules: {0}".format(len(diff.removed_auditallows)))
529 for r in sorted(diff.removed_auditallows):
532 if diff.modified_auditallows and not args.stats:
533 print(" Modified Auditallow Rules: {0}".format(len(diff.modified_auditallows)))
536 diff.modified_auditallows, key=lambda x: x.rule):
552 if diff.added_dontaudits or diff.removed_dontaudits or diff.modified_dontaudits or \
555 len(diff.added_dontaudits), len(diff.removed_dontaudits),
556 len(diff.modified_dontaudits)))
558 if diff.added_dontaudits and not args.stats:
559 print(" Added Dontaudit Rules: {0}".format(len(diff.added_dontaudits)))
560 for r in sorted(diff.added_dontaudits):
563 if diff.removed_dontaudits and not args.stats:
564 print(" Removed Dontaudit Rules: {0}".format(len(diff.removed_dontaudits)))
565 for r in sorted(diff.removed_dontaudits):
568 if diff.modified_dontaudits and not args.stats:
569 print(" Modified Dontaudit Rules: {0}".format(len(diff.modified_dontaudits)))
572 diff.modified_dontaudits, key=lambda x: x.rule):
588 if diff.added_type_transitions or diff.removed_type_transitions or \
589 diff.modified_type_transitions or args.type_trans:
591 len(diff.added_type_transitions), len(diff.removed_type_transitions),
592 len(diff.modified_type_transitions)))
594 if diff.added_type_transitions and not args.stats:
596 len(diff.added_type_transitions)))
597 for r in sorted(diff.added_type_transitions):
600 if diff.removed_type_transitions and not args.stats:
602 len(diff.removed_type_transitions)))
603 for r in sorted(diff.removed_type_transitions):
606 if diff.modified_type_transitions and not args.stats:
608 len(diff.modified_type_transitions)))
610 for rule, added_default, removed_default in sorted(diff.modified_type_transitions,
632 if diff.added_type_changes or diff.removed_type_changes or \
633 diff.modified_type_changes or args.type_change:
635 len(diff.added_type_changes), len(diff.removed_type_changes),
636 len(diff.modified_type_changes)))
638 if diff.added_type_changes and not args.stats:
639 print(" Added Type_change Rules: {0}".format(len(diff.added_type_changes)))
640 for r in sorted(diff.added_type_changes):
643 if diff.removed_type_changes and not args.stats:
644 print(" Removed Type_change Rules: {0}".format(len(diff.removed_type_changes)))
645 for r in sorted(diff.removed_type_changes):
648 if diff.modified_type_changes and not args.stats:
649 print(" Modified Type_change Rules: {0}".format(len(diff.modified_type_changes)))
651 for rule, added_default, removed_default in sorted(diff.modified_type_changes,
673 if diff.added_type_members or diff.removed_type_members or \
674 diff.modified_type_members or args.type_member:
676 len(diff.added_type_members), len(diff.removed_type_members),
677 len(diff.modified_type_members)))
679 if diff.added_type_members and not args.stats:
680 print(" Added Type_member Rules: {0}".format(len(diff.added_type_members)))
681 for r in sorted(diff.added_type_members):
684 if diff.removed_type_members and not args.stats:
685 print(" Removed Type_member Rules: {0}".format(len(diff.removed_type_members)))
686 for r in sorted(diff.removed_type_members):
689 if diff.modified_type_members and not args.stats:
690 print(" Modified Type_member Rules: {0}".format(len(diff.modified_type_members)))
692 for rule, added_default, removed_default in sorted(diff.modified_type_members,
714 if diff.added_role_allows or diff.removed_role_allows or args.role_allow:
716 len(diff.added_role_allows), len(diff.removed_role_allows)))
718 if diff.added_role_allows and not args.stats:
720 len(diff.added_role_allows)))
721 for r in sorted(diff.added_role_allows):
724 if diff.removed_role_allows and not args.stats:
726 len(diff.removed_role_allows)))
727 for r in sorted(diff.removed_role_allows):
733 if diff.added_role_transitions or diff.removed_role_transitions or \
734 diff.modified_role_transitions or args.role_trans:
736 len(diff.added_role_transitions), len(diff.removed_role_transitions),
737 len(diff.modified_role_transitions)))
739 if diff.added_role_transitions and not args.stats:
741 len(diff.added_role_transitions)))
742 for r in sorted(diff.added_role_transitions):
745 if diff.removed_role_transitions and not args.stats:
747 len(diff.removed_role_transitions)))
748 for r in sorted(diff.removed_role_transitions):
751 if diff.modified_role_transitions and not args.stats:
753 len(diff.modified_role_transitions)))
755 for rule, added_default, removed_default in sorted(diff.modified_role_transitions,
766 if diff.added_range_transitions or diff.removed_range_transitions or \
767 diff.modified_range_transitions or args.range_trans:
769 len(diff.added_range_transitions), len(diff.removed_range_transitions),
770 len(diff.modified_range_transitions)))
772 if diff.added_range_transitions and not args.stats:
774 len(diff.added_range_transitions)))
775 for r in sorted(diff.added_range_transitions):
778 if diff.removed_range_transitions and not args.stats:
780 len(diff.removed_range_transitions)))
781 for r in sorted(diff.removed_range_transitions):
784 if diff.modified_range_transitions and not args.stats:
786 len(diff.modified_range_transitions)))
788 for rule, added_default, removed_default in sorted(diff.modified_range_transitions,
801 if diff.added_initialsids or diff.removed_initialsids or diff.modified_initialsids \
804 len(diff.added_initialsids), len(diff.removed_initialsids),
805 len(diff.modified_initialsids)))
806 if diff.added_initialsids and not args.stats:
807 print(" Added Initial SIDs: {0}".format(len(diff.added_initialsids)))
808 for s in sorted(diff.added_initialsids):
810 if diff.removed_initialsids and not args.stats:
811 print(" Removed Initial SIDs: {0}".format(len(diff.removed_initialsids)))
812 for s in sorted(diff.removed_initialsids):
814 if diff.modified_initialsids and not args.stats:
815 print(" Modified Initial SIDs: {0}".format(len(diff.modified_initialsids)))
816 for name, mod in sorted(diff.modified_initialsids.items()):
823 if diff.added_fs_uses or diff.removed_fs_uses or diff.modified_fs_uses \
826 len(diff.added_fs_uses), len(diff.removed_fs_uses),
827 len(diff.modified_fs_uses)))
828 if diff.added_fs_uses and not args.stats:
829 print(" Added Fs_use: {0}".format(len(diff.added_fs_uses)))
830 for s in sorted(diff.added_fs_uses):
832 if diff.removed_fs_uses and not args.stats:
833 print(" Removed Fs_use: {0}".format(len(diff.removed_fs_uses)))
834 for s in sorted(diff.removed_fs_uses):
836 if diff.modified_fs_uses and not args.stats:
837 print(" Modified Fs_use: {0}".format(len(diff.modified_fs_uses)))
838 for entry in sorted(diff.modified_fs_uses, key=lambda x: x.rule):
845 if diff.added_genfscons or diff.removed_genfscons or diff.modified_genfscons \
848 len(diff.added_genfscons), len(diff.removed_genfscons),
849 len(diff.modified_genfscons)))
850 if diff.added_genfscons and not args.stats:
851 print(" Added Genfscons: {0}".format(len(diff.added_genfscons)))
852 for s in sorted(diff.added_genfscons):
854 if diff.removed_genfscons and not args.stats:
855 print(" Removed Genfscons: {0}".format(len(diff.removed_genfscons)))
856 for s in sorted(diff.removed_genfscons):
858 if diff.modified_genfscons and not args.stats:
859 print(" Modified Genfscons: {0}".format(len(diff.modified_genfscons)))
860 for entry in sorted(diff.modified_genfscons, key=lambda x: x.rule):
867 if diff.added_netifcons or diff.removed_netifcons or \
868 diff.modified_netifcons or args.netifcon:
870 len(diff.added_netifcons), len(diff.removed_netifcons),
871 len(diff.modified_netifcons)))
872 if diff.added_netifcons and not args.stats:
873 print(" Added Netifcons: {0}".format(len(diff.added_netifcons)))
874 for n in sorted(diff.added_netifcons):
876 if diff.removed_netifcons and not args.stats:
877 print(" Removed Netifcons: {0}".format(len(diff.removed_netifcons)))
878 for n in sorted(diff.removed_netifcons):
880 if diff.modified_netifcons and not args.stats:
881 print(" Modified Netifcons: {0}".format(len(diff.modified_netifcons)))
882 for entry in sorted(diff.modified_netifcons, key=lambda x: x.rule):
907 if diff.added_nodecons or diff.removed_nodecons or diff.modified_nodecons \
910 len(diff.added_nodecons), len(diff.removed_nodecons),
911 len(diff.modified_nodecons)))
912 if diff.added_nodecons and not args.stats:
913 print(" Added Nodecons: {0}".format(len(diff.added_nodecons)))
914 for n in sorted(diff.added_nodecons):
916 if diff.removed_nodecons and not args.stats:
917 print(" Removed Nodecons: {0}".format(len(diff.removed_nodecons)))
918 for n in sorted(diff.removed_nodecons):
920 if diff.modified_nodecons and not args.stats:
921 print(" Modified Nodecons: {0}".format(len(diff.modified_nodecons)))
922 for con, added_context, removed_context in sorted(diff.modified_nodecons,
930 if diff.added_portcons or diff.removed_portcons or diff.modified_portcons \
933 len(diff.added_portcons), len(diff.removed_portcons),
934 len(diff.modified_portcons)))
935 if diff.added_portcons and not args.stats:
936 print(" Added Portcons: {0}".format(len(diff.added_portcons)))
937 for n in sorted(diff.added_portcons):
939 if diff.removed_portcons and not args.stats:
940 print(" Removed Portcons: {0}".format(len(diff.removed_portcons)))
941 for n in sorted(diff.removed_portcons):
943 if diff.modified_portcons and not args.stats:
944 print(" Modified Portcons: {0}".format(len(diff.modified_portcons)))
945 for con, added_context, removed_context in sorted(diff.modified_portcons,
958 if diff.added_polcaps or diff.removed_polcaps or args.polcap:
960 len(diff.added_polcaps), len(diff.removed_polcaps)))
961 if diff.added_polcaps and not args.stats:
962 print(" Added Policy Capabilities: {0}".format(len(diff.added_polcaps)))
963 for n in sorted(diff.added_polcaps):
965 if diff.removed_polcaps and not args.stats:
966 print(" Removed Policy Capabilities: {0}".format(len(diff.removed_polcaps)))
967 for n in sorted(diff.removed_polcaps):
973 if diff.added_defaults or diff.removed_defaults or args.default:
975 len(diff.added_defaults), len(diff.removed_defaults), len(diff.modified_defaults)))
976 if diff.added_defaults and not args.stats:
977 print(" Added Defaults: {0}".format(len(diff.added_defaults)))
978 for d in sorted(diff.added_defaults):
980 if diff.removed_defaults and not args.stats:
981 print(" Removed Defaults: {0}".format(len(diff.removed_defaults)))
982 for d in sorted(diff.removed_defaults):
984 if diff.modified_defaults and not args.stats:
985 print(" Modified Defaults: {0}".format(len(diff.modified_defaults)))
987 diff.modified_defaults, key=lambda x: x.rule):