Blobfuse의 마운트포인트를Apache의 DocumentRoot로 사용할 경우 403 forbidden 발생
/var/www/httpd/error.log
SELinux로 인한 conext 불일치
Blobfuse로 마운트하는 순간 해당 디렉토리의 SELinux Context는 fusefs_t
로 변경됨, 이로 인해 Apache의 SELinux context인 httpd_sys_content_t
와 맞지 않으므로 403 forbidden 발생
SELinux가 활성화 되어 있으면 디렉토리 or 파일의 SELinux Context를 검사하여 프로세스의 권한을 필터링 합니다.
SELinux 종료 하여 SELinux Context 필터링 해제
disabled
하거나 permissive
모드로 변경# 1. permissive
setenforce 0
# 2. disabled
vi /etc/selinux/config
...
SELINUX=disabled
...
Caution
Blobfuse는 Azure Storage 서비스로서 아직까지 OS Filesystem의 ACL관련 Operation을 허용 하지 않습니다. 따라서,chcon
및restorecon
과 같은 명령 수행이 불가 합니다.
chcon -R -t httpd_sys_content_t /var/www/test
SELINUX=Enforcing
fusefs_t
컨텍스트 확인 및 restorcecon
동작 불가
ls -lZ /var/www/test
enforcing 상태에서 forbidden error 확인
SELINUX=diabled
컨텍스트 없어진 모습 및 웹페이지 정상 조회
SELINUX=permissive
컨텍스트는 조회 되지만 웹페이지도 정상 조회
1. 조회
getenforce
2. 설정
setenforce (0=permissive, 1=enforcing)
3. 시스템 수준 변경
/etc/selinux/config 편집
4. 기타
getsebool / setsebool / semanage