Bug 1155974 - audit2allow produces a file with syntax errors
Summary: audit2allow produces a file with syntax errors
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1159540 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-23 10:18 UTC by Juanjo
Modified: 2015-06-30 01:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-30 01:11:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Juanjo 2014-10-23 10:18:41 UTC
Description of problem:
audit2allow is incapable of parsing audit.log or producing appropriate rules.

How reproducible:
Very systematic on all machines where I run glusterd and I try to use auth2allow to workaround Bug 1155935

# grep glusterd /var/log/audit/audit.log | audit2allow -M mypol
compilation failed:
mypol.te:18:ERROR 'syntax error' at token 'constrain' on line 18:
	constrain dir { create relabelfrom relabelto } ((u1 eq u2 -Fail-)  or (t1=glusterd_t  eq TYPE_ENTRY -Fail-) { POLICY_SOURCE: can_change_object_identity } ); Constraint DENIED
#Constraint rule: 
/usr/bin/checkmodule:  error(s) encountered while parsing configuration
/usr/bin/checkmodule:  loading policy configuration from mypol.te

# cat mypol.te 

module mypol 1.0;

require {
	type file_t;
	type home_root_t;
	type glusterd_t;
	type var_run_t;
	class sock_file { write unlink link setattr };
	class dir relabelto;
}

#============= glusterd_t ==============
allow glusterd_t file_t:sock_file { unlink link setattr };

#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.
#Constraint rule: 
	constrain dir { create relabelfrom relabelto } ((u1 eq u2 -Fail-)  or (t1=glusterd_t  eq TYPE_ENTRY -Fail-) { POLICY_SOURCE: can_change_object_identity } ); Constraint DENIED

#	Possible cause is the source user (system_u) and target user (unconfined_u) are different.
allow glusterd_t home_root_t:dir relabelto;

#!!!! This avc is allowed in the current policy
allow glusterd_t var_run_t:sock_file unlink;
allow glusterd_t var_run_t:sock_file write;

Comment 1 Miroslav Grepl 2014-10-24 08:05:46 UTC
Yes, this is a bug. It should just create rules if it generates a policy module.

Comment 2 Miroslav Grepl 2014-11-03 13:49:56 UTC
*** Bug 1159540 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2014-11-03 14:40:03 UTC
Actually a patch is easy.

Comment 4 Fedora End Of Life 2015-05-29 13:08:50 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2015-06-30 01:11:06 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.