SELinux for Redis: Failed to resolve typeattributeset

On AlmaLinux 9.5, I have to put SELinux into Permissive mode in order for Redis to work. Otherwise, I try installing an SELinux policy for Redis, and I get this error:

Attempting to install module 'redis.pp':
libsemanage.semanage_direct_install_info: Overriding redis module at lower priority 100 with module at priority 400.
Ok: return value of 0.
Committing changes:
Failed to resolve typeattributeset statement at /var/lib/selinux/targeted/tmp/modules/400/redis/cil:1
Failed to resolve AST
semodule:  Failed!

Web searches for this error have been fruitless.

Apparently I missed this StackOverflow question in my web search. It seems using the same name as an already-existing module is the problem. I ran grep "redis" /var/log/audit/audit.log | audit2allow -M redis-custom, and then semodule -i redis-custom.pp. The new module installed correctly, no errors.

https://stackoverflow.com/questions/75934726/selinux-error-failed-to-resolve-typeattributeset-statement-at-var-lib-selinux

1 Like