Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

11.3.7. sealert 메시지

거부는 /var/log/messages 에 표시된 대로 할당된 ID입니다. 다음은 Apache HTTP Server(httpd_t 도메인에서 실행)에서 /var/www/html/file1 파일( samba _share_t 유형으로 레이블이 지정됨)에 액세스하려고 할 때 발생한 AVC 거부( 메시지로 로깅)입니다.
hostname setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l 32eee32b-21ca-4846-a22f-0ba050206786
권장되는 대로 sealert -l 32eee32b-21ca-4846-a22f-0ba050206786 명령을 실행하여 전체 메시지를 확인합니다. 이 명령은 로컬 시스템에서만 작동하며 sealert GUI와 동일한 정보를 제공합니다.
~]$ sealert -l 32eee32b-21ca-4846-a22f-0ba050206786
SELinux is preventing httpd from getattr access on the file /var/www/html/file1.

*****  Plugin restorecon (92.2 confidence) suggests   ************************

If you want to fix the label. 
/var/www/html/file1 default label should be httpd_sys_content_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/www/html/file1

*****  Plugin public_content (7.83 confidence) suggests   ********************

If you want to treat file1 as public content
Then you need to change the label on file1 to public_content_t or public_content_rw_t.
Do
# semanage fcontext -a -t public_content_t '/var/www/html/file1'
# restorecon -v '/var/www/html/file1'

*****  Plugin catchall (1.41 confidence) suggests   **************************

If you believe that httpd should be allowed getattr access on the file1 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 'httpd' --raw | audit2allow -M my-httpd
# semodule -i my-httpd.pp


Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:samba_share_t:s0
Target Objects                /var/www/html/file1 [ file ]
Source                        httpd
Source Path                   httpd
Port                          <Unknown>
Host                          hostname.redhat.com
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-166.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     hostname.redhat.com
Platform                      Linux hostname.redhat.com
                              3.10.0-693.el7.x86_64 #1 SMP Thu Jul 6 19:56:57
                              EDT 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-07-20 02:52:11 EDT
Last Seen                     2017-07-20 02:52:11 EDT
Local ID                      32eee32b-21ca-4846-a22f-0ba050206786

Raw Audit Messages
type=AVC msg=audit(1500533531.140:295): avc:  denied  { getattr } for  pid=24934 comm="httpd" path="/var/www/html/file1" dev="vda1" ino=31457414 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file


Hash: httpd,httpd_t,samba_share_t,file,getattr
요약
거부된 작업에 대한 간략한 요약. 이는 /var/log/messages 의 거부와 동일합니다. 이 예제에서 httpd 프로세스는 samba_share_t 유형으로 레이블이 지정된파일(file1)에 대한 액세스가거부되었습니다.
자세한 설명
보다 자세한 설명. 이 예제에서 file1samba_share_t 유형으로 레이블이 지정됩니다. 이 유형은 Samba를 사용하여 내보내려는 파일 및 디렉터리에 사용됩니다. 설명은 이러한 액세스가 필요한 경우 Apache HTTP Server 및 Samba에서 액세스할 수 있는 유형으로 유형을 변경하는 것을 제안합니다.
액세스 허용
액세스를 허용하는 방법에 대한 제안 사항. 이는 파일의 레이블을 다시 지정하거나 부울을 활성화하거나 로컬 정책 모듈을 만드는 것일 수 있습니다. 이 경우 제안은 Apache HTTP 서버와 Samba 모두에서 액세스할 수 있는 유형을 사용하여 파일에 레이블을 지정하는 것입니다.
명령 수정
액세스를 허용하고 거부를 해결하기 위해 제안된 명령. 이 예제에서는 명령을 제공하여 Apache HTTP 서버 및 Samba에서 액세스할 수 있는 public_content_tfile1 유형을 변경합니다.
추가 정보
정책 패키지 이름 및 버전(selinux-policy-3.13.1-166.el7.noarch)과 같은 버그 보고서에 유용한 정보이지만 거부가 발생한 이유를 해결하는 데 도움이 되지 않을 수 있습니다.
원시 감사 메시지
거부와 연결된 /var/log/audit/audit.log 의 원시 감사 메시지입니다. AVC 거부의 각 항목에 대한 자세한 내용은 11.3.6절. “원시 감사 메시지” 을 참조하십시오.