【发布时间】:2019-11-13 18:02:00
【问题描述】:
我正在使用 RHEL 7。我在这里存储了另一台机器的日志文件。 我使用以下命令创建策略:
grep -inr "denied" audit.log* | audit2allow -M Policy_File_Name
使用此命令,我能够为许多日志文件创建策略。但在某些情况下我遇到了这个错误:
Traceback (most recent call last):
File "/usr/bin/audit2allow", line 365, in <module>
app.main()
File "/usr/bin/audit2allow", line 352, in main
self.__process_input()
File "/usr/bin/audit2allow", line 180, in __process_input
self.__avs = self.__parser.to_access()
File "/usr/lib64/python2.7/site-packages/sepolgen/audit.py", line 591, in to_access
avc.path = self.__restore_path(avc.name, avc.ino)
File "/usr/lib64/python2.7/site-packages/sepolgen/audit.py", line 531, in __restore_path
universal_newlines=True)
File "/usr/lib64/python2.7/subprocess.py", line 568, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1224, in _execute_child
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
我很少遇到这个错误:
libsepol.context_from_record: type celery_t is not defined
libsepol.context_from_record: could not create context structure
libsepol.context_from_string: could not create context structure
libsepol.sepol_context_to_sid: could not convert system_u:system_r:celery_t:s0 to sid
这里的 'celery_t' 会根据目标上下文发生变化。
系统状况:
[root@selinux-policy-creation abhisheklog]# free -h
total used free shared buff/cache available
Mem: 31G 261M 27G 8.4M 3.1G 30GB
Swap: 0B 0B 0B
请提供原因和解决方法。谢谢。
【问题讨论】:
-
你在这里运行的是直接的 python 脚本或一些网络服务器?
-
@TarunLalwani 我在审计日志文件的位置使用提到的命令。另一个系统的日志存储在我的系统中。这里没有python或web服务器的作用。
标签: memory operating-system redhat policy selinux