SELinux:进程域、文件级访问控制与网络通信管理
1. 进程域与文件级访问控制基础
在进行相关测试前,先准备好CGI脚本。接着,启动一个支持CGI的简单Web服务器,选择6020端口,因为非特权用户也能让进程绑定到该端口。操作步骤如下:
$ python -m CGIHTTPServer 6020在另一个会话中,连接到Web服务器并调用test.pyCGI脚本:
$ curl http://localhost:6020/cgi-bin/test.py此时能看到ping的结果:
PING localhost (127.0.0.1) 56(84) bytes of data 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.002 ms -- localhost ping statistics -- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.002/0.002/0.002/0.000 ms若启动同样的支持CGI的Web服务器,但开启了Linux的NNP(No New Privileges): </