Bug 1329037

Summary: module name in troubleshoot instruction should be my_<command> instead of mypol
Product: [Fedora] Fedora Reporter: Ding-Yi Chen <dchen>
Component: setroubleshoot-pluginsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: setroubleshoot-plugins-3.3.4-1.fc24 setroubleshoot-plugins-3.3.4-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 01:29:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ding-Yi Chen 2016-04-21 01:26:12 UTC
Description of problem:
When you encountered SELinux alert, you will be given following instruction:

  You can generate a local policy module to allow this access.
  Allow this access for now by executing:
  # grep <command1> /var/log/audit/audit.log | audit2allow -M mypol
  # semodule -i mypol.pp

While it is correct if you only have to allow one module,
however, after using the same instruction on command2,
the change for command1 is replaced thus no longer active.

Suggestion:
  Change the "mypol" with "my_<command>". the <command> is the one showing after grep.


Version-Release number of selected component (if applicable):
setroubleshoot-3.3.5-2.fc23

How reproducible:
Always

Steps to Reproduce:
1. Run "sealert"
2. Find any SELinux problem
3. Click "Troubleshoot"

Actual results:
Following instruction is shown in solution text area:
   You can generate a local policy module to allow this access.
   Allow this access for now by executing:
   # grep <command> /var/log/audit/audit.log | audit2allow -M mypol
   # semodule -i mypol.pp

Expected results:
Following instruction is shown in solution text area:
   You can generate a local policy module to allow this access.
   Allow this access for now by executing:
   # grep <command> /var/log/audit/audit.log | audit2allow -M my_<command>
   # semodule -i my_<command>.pp


Additional info:

Comment 1 Petr Lautrbach 2016-04-21 14:23:57 UTC
Sounds reasonable for me. Thanks for the idea!

The patch is available for now at https://github.com/bachradsusi/setroubleshoot/commit/192f55ed28e1258618da2d4b6ee33015f5c6ce99

You can try it with setroubleshoot-plugins-3.3.4-0.fc25.2 build from my COPR repo  https://copr.fedorainfracloud.org/coprs/plautrba/setroubleshoot/build/179680/ 

I will update translation files and create a pull request.

Comment 2 Petr Lautrbach 2016-04-21 14:26:40 UTC
Note: alert reports are cached in /var/lib/setroubleshoot/setroubleshoot_database.xml. You need to remove the file and restart setroubleshootd.

Comment 3 Fedora Update System 2016-05-09 11:50:16 UTC
setroubleshoot-plugins-3.3.4-1.fc24 setroubleshoot-3.3.6-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-812271b66f

Comment 4 Fedora Update System 2016-05-09 12:08:08 UTC
setroubleshoot-plugins-3.3.4-1.fc23 setroubleshoot-3.3.6-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e5a3abe570

Comment 5 Fedora Update System 2016-05-10 19:26:38 UTC
setroubleshoot-3.3.6-1.fc23, setroubleshoot-plugins-3.3.4-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e5a3abe570

Comment 6 Fedora Update System 2016-05-10 20:30:56 UTC
setroubleshoot-3.3.6-1.fc24, setroubleshoot-plugins-3.3.4-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-812271b66f

Comment 7 Fedora Update System 2016-05-12 01:28:57 UTC
setroubleshoot-3.3.6-1.fc24, setroubleshoot-plugins-3.3.4-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2016-05-12 07:28:24 UTC
setroubleshoot-3.3.6-1.fc23, setroubleshoot-plugins-3.3.4-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.