SELinux에서 '검색' 권한을 부여하는 방법

SELinux에서 '검색' 권한을 부여하는 방법

SELinux(CentOS 7)에서 dspam을 작동시키려고 합니다. 문제없이 다음을 추가했습니다.

allow dspam_t dspam_rw_content_t:dir getattr;
allow dspam_t dspam_rw_content_t:file { append getattr lock open write };

그러나 dspam은 여전히 ​​procmail을 통해 작동하지 않습니다.

/bin/sh: /usr/bin/dspam: Permission denied
procmail: Program failure (126) of "/usr/bin/dspam"

SELinux를 허용으로 설정하면 제대로 작동합니다. audit2allow무엇이 누락되었는지 확인하기 위해 다음을 사용해 보았습니다 .

[root@opus ~]# audit2allow -i /var/log/audit/audit.log
#============= dspam_t ==============
allow dspam_t dspam_rw_content_t:dir search;

하지만 이를 정책에 추가하면 checkmodule오류가 발생합니다.

checkmodule:  loading policy configuration from OPUS.te
OPUS.te:19:ERROR 'permission search is not defined for class dir' at token ';' on line 19:
allow dspam_t dspam_rw_content_t:dir getattr;
allow dspam_t dspam_rw_content_t:dir search;
checkmodule:  error(s) encountered while parsing configuration

조금 검색했지만 해결책을 찾을 수 없습니다. search표시된 대로 권한을 어떻게 추가하거나 정의합니까 ?

답변1

이것이 나에게 있어서 최종 문제를 해결하지는 못하지만(SELinux 시행 모드에서는 dspam이 작동하지 않음) 내가 물어본 실제 질문(검색 권한을 부여하는 방법)에 대한 답변을 제공하기 때문에 이 글을 게시하고 있습니다.

알고 보니 이 모듈의 블록 search에는 제가 없었습니다. require나는 가지고 있었다 :

require {
[...]
    class dir getattr;
}

@harrymc의 댓글에서 링크를 탐색하는 것을 발견했을 때 다음이 필요했습니다.

require {
[...]
    class dir { write getattr add_name search };
}

그 후에는 모듈이 올바르게 컴파일되고 로드됩니다.

관련 정보