My Favorites

Close

Please to see your favorites.

  • Bookmark
  • Email Document
  • Printer Friendly
  • Favorite
  • Rating:

Apparmor on SLES9 SP3: using a custom version of apache with mod-change-hat

This document (3010932) is provided subject to the disclaimer at the end of this document.

Environment


Novell SUSE Linux Enterprise Server 9

Situation

You use a non-suse apache installation on top of SLES9 SP3. The apache binaries are not in the default path. genprof/logprof do not offer an entry for the required file during scan. Entries in /var/log/messages are skipped while scanning the rejections of apparmor. It displays the following :
----------------------------------------------------------------------------start
Profile: /opt/CUSTOMApache2/sbin/apache_bin
Requested Hat: HANDLING_UNTRUSTED_INPUT

[(A)dd Requested Hat] / (D)eny / Abo(r)t / (F)inish
----------------------------------------------------------------------------end

Resolution

Using changehat with apache requires, that a couple of hats get inserted into the profile for basic profiling. For the SuSE supplied apache this is handled automatically via an option in the config file /etc/apparmor/logprof.conf. The option needs to specify default and required hats for a changehat enabled application.

However if you use a custom apache with a different path for the binaries, you have to adjust the configuration file. Open /etc/apparmor/logprof.conf with an editor of your choice and search for the [required_hats] and the [defaulthat] section:
[required_hats]
^.+/sshd$ = AUTHENTICATED EXEC PRIVSEP PRIVSEP_MONITOR
^.+/apache(|2|2-prefork)$ = DEFAULT_URI HANDLING_UNTRUSTED_INPUT
^.+/httpd(|2|2-prefork)$ = DEFAULT_URI HANDLING_UNTRUSTED_INPUT

[defaulthat]
^.+/sshd$ = EXEC
^.+/apache(|2|2-prefork)$ = DEFAULT_URI
^.+/httpd(|2|2-prefork)$ = DEFAULT_URI

Add the correct options for this customized apache path (/opt/CUSTOMApache2/sbin/apache_bin), so that it will look as follows:
[required_hats]
^.+/sshd$ = AUTHENTICATED EXEC PRIVSEP PRIVSEP_MONITOR
^.+/apache(|2|2-prefork)$ = DEFAULT_URI HANDLING_UNTRUSTED_INPUT
^.+/httpd(|2|2-prefork)$ = DEFAULT_URI HANDLING_UNTRUSTED_INPUT
^.+/apache_bin$ = DEFAULT_URI HANDLING_UNTRUSTED_INPUT

[defaulthat]
^.+/sshd$ = EXEC
^.+/apache(|2|2-prefork)$ = DEFAULT_URI
^.+/httpd(|2|2-prefork)$ = DEFAULT_URI
^.+/apache_bin$ = DEFAULT_URI

Disclaimer

This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:3010932
  • Creation Date:30-JUL-07
  • Modified Date:27-APR-12
    • SUSESUSE Linux Enterprise Server

Did this document solve your problem? Provide Feedback

< Back to Support Search

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center