Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642476 - www-apache/mod_security does not provide the unicode.mapping file
Summary: www-apache/mod_security does not provide the unicode.mapping file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-28 07:57 UTC by Libor Polčák
Modified: 2022-02-20 00:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Libor Polčák 2017-12-28 07:57:23 UTC
The recommended mod_security configuration https://raw.githubusercontent.com/SpiderLabs/ModSecurity/master/modsecurity.conf-recommended that is distributed as /usr/share/doc/mod_security-2.9.1-r1/modsecurity.conf-recommended.bz2 lists SecUnicodeMapFile set to the file called unicode.mapping.

The file is provided in the package repository https://github.com/SpiderLabs/ModSecurity/blob/v2/master/unicode.mapping. However, the file is not installed after emerging mod_security from portage:

equery f www-apache/mod_security-2.9.1-r1
 * Searching for mod_security2.9.1-r1 in www-apache ...
 * Contents of www-apache/mod_security-2.9.1-r1:
/etc
/etc/apache2
/etc/apache2/modules.d
/etc/apache2/modules.d/79_mod_security.conf
/usr
/usr/lib
/usr/lib/apache2
/usr/lib/apache2/modules
/usr/lib/apache2/modules/mod_security2.so
/usr/share
/usr/share/doc
/usr/share/doc/mod_security-2.9.1-r1
/usr/share/doc/mod_security-2.9.1-r1/CHANGES.bz2
/usr/share/doc/mod_security-2.9.1-r1/README.TXT.bz2
/usr/share/doc/mod_security-2.9.1-r1/modsecurity.conf-recommended.bz2
/var
/var/lib
/var/lib/modsecurity
/var/lib/modsecurity/.keep_www-apache_mod_security-0
/var/lib/modsecurity/data
/var/lib/modsecurity/data/.keep_www-apache_mod_security-0
/var/lib/modsecurity/tmp
/var/lib/modsecurity/tmp/.keep_www-apache_mod_security-0
/var/lib/modsecurity/upload
/var/lib/modsecurity/upload/.keep_www-apache_mod_security-0

Is it possible to keep the file from the source after installation, please?
Comment 1 Pacho Ramos gentoo-dev 2018-10-08 13:35:15 UTC
I see for example Fedora neither providing that file and it seems to cause not issues... what is the problem you are hitting? (I cannot access the pointed link)
Comment 2 Libor Polčák 2018-10-08 15:06:09 UTC
I do not remember completely anymore but as far as I can remember I followed https://wiki.gentoo.org/wiki/Apache#Enabling_mod_security which uses /usr/share/doc/mod_security-2.9.1-r1/modsecurity.conf-recommended.bz2 as a basis for the configuration. However, modsecurity.conf-recommended refers to the file unicode.mapping ("SecUnicodeMapFile unicode.mapping 20127" on line 218 in the modsecurity.conf-recommended in https://www.modsecurity.org/tarball/2.9.2/modsecurity-2.9.2.tar.gz).

I guess that running mod_security with modsecurity.conf-recommended as the configuration resulted in an error mentioning the file unicode.mapping is missing. I downloaded the file from the github repository and mod_security worked.
Comment 3 Jouni Rinne 2022-02-16 22:21:59 UTC
This is still an issue. Please either include the 'unicode.mapping' file, or patch the 'modsecurity.conf-recommended' file to NOT refer to the 'unicode.mapping' file by default.
Comment 4 Tomáš Mózes 2022-02-19 10:55:44 UTC
Strictly speaking it's an optional part, but it's annoying to start with an example configuration that does not work.

A modified version that retains the missing file: https://github.com/gentoo/gentoo/pull/24272
Comment 5 Larry the Git Cow gentoo-dev 2022-02-20 00:31:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ca6bc6ad0eed589bffad56c71d0974e957ed464

commit 2ca6bc6ad0eed589bffad56c71d0974e957ed464
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2022-02-19 10:43:29 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-02-20 00:30:41 +0000

    www-apache/mod_security: keep unicode.mapping
    
    Closes: https://bugs.gentoo.org/642476
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../mod_security/mod_security-2.9.5-r1.ebuild      | 125 +++++++++++++++++++++
 1 file changed, 125 insertions(+)