SELinux 정책 모듈을 영구적으로 활성화하는 방법은 무엇입니까?

SELinux 정책 모듈을 영구적으로 활성화하는 방법은 무엇입니까?

나는RHEL제가 개발할 때 사용한 8.1 시스템은 다음과 같습니다.SELinux기본값은 적용 모드입니다.

이 시스템에서 Python 스크립트를 작성하고 실행합니다.비주얼 스튜디오 코드, 어떤 이유로 SELinux 경고 브라우저에 다음과 같은 경고가 계속 표시됩니다.

SELinux가 gpgsm 파일에 대한 /usr/libexec/platform-python3.6 액세스를 차단하고 있습니다.

간단한 Python 스크립트가 호출되지 않기 때문에 이것이 무엇을 의미하는지 이해하지 못합니다 gpgsm(무엇인지 모르겠습니다 gpgsm).

세부 정보 대화 상자가 표시됩니다.

You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
# semodule -X 300 -i my-rhsmcertdworke.pp

세부정보의 전체 출력은 다음과 같습니다.


*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that platform-python3.6 should be allowed execute access on the gpgsm file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
# semodule -X 300 -i my-rhsmcertdworke.pp

Additional Information:
Source Context                system_u:system_r:rhsmcertd_t:s0
Target Context                system_u:object_r:gpg_exec_t:s0
Target Objects                gpgsm [ file ]
Source                        rhsmcertd-worke
Source Path                   /usr/libexec/platform-python3.6
Port                          <Unknown>
Host                          [my hostname]
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-20.el8.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     [my hostname]
Platform                      Linux [my hostname] 4.18.0-147.8.1.el8_1.x86_64 #1
                              SMP Wed Feb 26 03:08:15 UTC 2020 x86_64 x86_64
Alert Count                   2
First Seen                    2020-04-22 16:48:22 BST
Last Seen                     2020-04-22 16:48:22 BST
Local ID                      2114dd0f-4b36-420d-9ad4-617017e8b43d

Raw Audit Messages
type=AVC msg=audit(1587570502.586:134): avc:  denied  { execute } for  pid=4916 comm="rhsmcertd-worke" name="gpgsm" dev="dm-0" ino=765660 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:gpg_exec_t:s0 tclass=file permissive=0


Hash: rhsmcertd-worke,rhsmcertd_t,gpg_exec_t,file,execute

그래서 sudo두 개의 파일이 생성되는 두 개의 명령을 실행했습니다 . 명령 은 오류 없이 실행되며 목록 활성화 모듈을 사용하면 활성화된 다른 모듈이 나열됩니다 .my-rhsmcertdworke.temy-rhsmcertdworke.ppsemodule -X 300 -i my-rhsmcertdworke.ppsudo semodule -lstandardmy-rhsmcertdworke

그러나 모듈을 가져오거나 활성화하지 않은 것처럼 여전히 동일한 경고가 계속 나타납니다.

my-rhsmcertdworke.te그건 그렇고, 이것은 다음 명령을 통해 생성됩니다 ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke.

module my-rhsmcertdworke 1.0;

require {
    type gpg_exec_t;
    type root_t;
    type rhsmcertd_t;
    class file { execute open read };
}

#============= rhsmcertd_t ==============
allow rhsmcertd_t gpg_exec_t:file execute;

#!!!! This avc is allowed in the current policy
allow rhsmcertd_t root_t:file read;

#!!!! This avc can be allowed using the boolean 'daemons_dump_core'
allow rhsmcertd_t root_t:file open;

동일한 경고가 계속 발생하는 이유는 무엇입니까? 이 정책 모듈이 지속되도록 실제로 어떻게 활성화합니까? 감사합니다!

폴리스티렌정책 모듈의 이름일 필요는 없을 것 같습니다 my-rhsmcertdworke. 다른 이름으로 변경해도 안전합니까?SELinux 정책 모듈에 대한 명명 규칙이 있습니까?

관련 정보