ima_policy 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. What: security/ima/policy
  2. Date: May 2008
  3. Contact: Mimi Zohar <zohar@us.ibm.com>
  4. Description:
  5. The Trusted Computing Group(TCG) runtime Integrity
  6. Measurement Architecture(IMA) maintains a list of hash
  7. values of executables and other sensitive system files
  8. loaded into the run-time of this system. At runtime,
  9. the policy can be constrained based on LSM specific data.
  10. Policies are loaded into the securityfs file ima/policy
  11. by opening the file, writing the rules one at a time and
  12. then closing the file. The new policy takes effect after
  13. the file ima/policy is closed.
  14. rule format: action [condition ...]
  15. action: measure | dont_measure
  16. condition:= base | lsm
  17. base: [[func=] [mask=] [fsmagic=] [uid=]]
  18. lsm: [[subj_user=] [subj_role=] [subj_type=]
  19. [obj_user=] [obj_role=] [obj_type=]]
  20. base: func:= [BPRM_CHECK][FILE_MMAP][INODE_PERMISSION]
  21. mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
  22. fsmagic:= hex value
  23. uid:= decimal value
  24. lsm: are LSM specific
  25. default policy:
  26. # PROC_SUPER_MAGIC
  27. dont_measure fsmagic=0x9fa0
  28. # SYSFS_MAGIC
  29. dont_measure fsmagic=0x62656572
  30. # DEBUGFS_MAGIC
  31. dont_measure fsmagic=0x64626720
  32. # TMPFS_MAGIC
  33. dont_measure fsmagic=0x01021994
  34. # SECURITYFS_MAGIC
  35. dont_measure fsmagic=0x73636673
  36. measure func=BPRM_CHECK
  37. measure func=FILE_MMAP mask=MAY_EXEC
  38. measure func=INODE_PERM mask=MAY_READ uid=0
  39. The default policy measures all executables in bprm_check,
  40. all files mmapped executable in file_mmap, and all files
  41. open for read by root in inode_permission.
  42. Examples of LSM specific definitions:
  43. SELinux:
  44. # SELINUX_MAGIC
  45. dont_measure fsmagic=0xF97CFF8C
  46. dont_measure obj_type=var_log_t
  47. dont_measure obj_type=auditd_log_t
  48. measure subj_user=system_u func=INODE_PERM mask=MAY_READ
  49. measure subj_role=system_r func=INODE_PERM mask=MAY_READ
  50. Smack:
  51. measure subj_user=_ func=INODE_PERM mask=MAY_READ