1. 07 8月, 2015 1 次提交
    • R
      audit: implement audit by executable · 34d99af5
      Richard Guy Briggs 提交于
      This adds the ability audit the actions of a not-yet-running process.
      
      This patch implements the ability to filter on the executable path.  Instead of
      just hard coding the ino and dev of the executable we care about at the moment
      the rule is inserted into the kernel, use the new audit_fsnotify
      infrastructure to manage this dynamically.  This means that if the filename
      does not yet exist but the containing directory does, or if the inode in
      question is unlinked and creat'd (aka updated) the rule will just continue to
      work.  If the containing directory is moved or deleted or the filesystem is
      unmounted, the rule is deleted automatically.  A future enhancement would be to
      have the rule survive across directory disruptions.
      
      This is a heavily modified version of a patch originally submitted by Eric
      Paris with some ideas from Peter Moody.
      
      Cc: Peter Moody <peter@hda3.com>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      [PM: minor whitespace clean to satisfy ./scripts/checkpatch]
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      34d99af5
  2. 12 12月, 2014 1 次提交
  3. 18 11月, 2014 1 次提交
    • R
      audit: convert status version to a feature bitmap · 0288d718
      Richard Guy Briggs 提交于
      The version field defined in the audit status structure was found to have
      limitations in terms of its expressibility of features supported.  This is
      distict from the get/set features call to be able to command those features
      that are present.
      
      Converting this field from a version number to a feature bitmap will allow
      distributions to selectively backport and support certain features and will
      allow upstream to be able to deprecate features in the future.  It will allow
      userspace clients to first query the kernel for which features are actually
      present and supported.  Currently, EINVAL is returned rather than EOPNOTSUP,
      which isn't helpful in determining if there was an error in the command, or if
      it simply isn't supported yet.  Past features are not represented by this
      bitmap, but their use may be converted to EOPNOTSUP if needed in the future.
      
      Since "version" is too generic to convert with a #define, use a union in the
      struct status, introducing the member "feature_bitmap" unionized with
      "version".
      
      Convert existing AUDIT_VERSION_* macros over to AUDIT_FEATURE_BITMAP*
      counterparts, leaving the former for backwards compatibility.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      [PM: minor whitespace tweaks]
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      0288d718
  4. 24 9月, 2014 2 次提交
  5. 10 7月, 2014 1 次提交
  6. 23 5月, 2014 1 次提交
  7. 22 5月, 2014 1 次提交
  8. 14 5月, 2014 1 次提交
  9. 23 4月, 2014 1 次提交
    • R
      audit: add netlink multicast group for log read · 451f9216
      Richard Guy Briggs 提交于
      Add a netlink multicast socket with one group to kaudit for "best-effort"
      delivery to read-only userspace clients such as systemd, in addition to the
      existing bidirectional unicast auditd userspace client.
      
      Currently, auditd is intended to use the CAP_AUDIT_CONTROL and CAP_AUDIT_WRITE
      capabilities, but actually uses CAP_NET_ADMIN.  The CAP_AUDIT_READ capability
      is added for use by read-only AUDIT_NLGRP_READLOG netlink multicast group
      clients to the kaudit subsystem.
      
      This will safely give access to services such as systemd to consume audit logs
      while ensuring write access remains restricted for integrity.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      451f9216
  10. 03 4月, 2014 1 次提交
  11. 25 3月, 2014 1 次提交
  12. 20 3月, 2014 2 次提交
    • A
      audit: Add generic compat syscall support · 4b588411
      AKASHI Takahiro 提交于
      lib/audit.c provides a generic function for auditing system calls.
      This patch extends it for compat syscall support on bi-architectures
      (32/64-bit) by adding lib/compat_audit.c.
      What is required to support this feature are:
       * add asm/unistd32.h for compat system call names
       * select CONFIG_AUDIT_ARCH_COMPAT_GENERIC
      Signed-off-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
      Acked-by: NRichard Guy Briggs <rgb@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      4b588411
    • W
      audit: Audit proc/<pid>/cmdline aka proctitle · 3f1c8250
      William Roberts 提交于
      During an audit event, cache and print the value of the process's
      proctitle value (proc/<pid>/cmdline). This is useful in situations
      where processes are started via fork'd virtual machines where the
      comm field is incorrect. Often times, setting the comm field still
      is insufficient as the comm width is not very wide and most
      virtual machine "package names" do not fit. Also, during execution,
      many threads have their comm field set as well. By tying it back to
      the global cmdline value for the process, audit records will be more
      complete in systems with these properties. An example of where this
      is useful and applicable is in the realm of Android. With Android,
      their is no fork/exec for VM instances. The bare, preloaded Dalvik
      VM listens for a fork and specialize request. When this request comes
      in, the VM forks, and the loads the specific application (specializing).
      This was done to take advantage of COW and to not require a load of
      basic packages by the VM on very app spawn. When this spawn occurs,
      the package name is set via setproctitle() and shows up in procfs.
      Many of these package names are longer then 16 bytes, the historical
      width of task->comm. Having the cmdline in the audit records will
      couple the application back to the record directly. Also, on my
      Debian development box, some audit records were more useful then
      what was printed under comm.
      
      The cached proctitle is tied to the life-cycle of the audit_context
      structure and is built on demand.
      
      Proctitle is controllable by userspace, and thus should not be trusted.
      It is meant as an aid to assist in debugging. The proctitle event is
      emitted during syscall audits, and can be filtered with auditctl.
      
      Example:
      type=AVC msg=audit(1391217013.924:386): avc:  denied  { getattr } for  pid=1971 comm="mkdir" name="/" dev="selinuxfs" ino=1 scontext=system_u:system_r:consolekit_t:s0-s0:c0.c255 tcontext=system_u:object_r:security_t:s0 tclass=filesystem
      type=SYSCALL msg=audit(1391217013.924:386): arch=c000003e syscall=137 success=yes exit=0 a0=7f019dfc8bd7 a1=7fffa6aed2c0 a2=fffffffffff4bd25 a3=7fffa6aed050 items=0 ppid=1967 pid=1971 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="mkdir" exe="/bin/mkdir" subj=system_u:system_r:consolekit_t:s0-s0:c0.c255 key=(null)
      type=UNKNOWN[1327] msg=audit(1391217013.924:386):  proctitle=6D6B646972002D70002F7661722F72756E2F636F6E736F6C65
      
      Acked-by: Steve Grubb <sgrubb@redhat.com> (wrt record formating)
      Signed-off-by: NWilliam Roberts <wroberts@tresys.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      3f1c8250
  13. 14 1月, 2014 3 次提交
  14. 06 11月, 2013 5 次提交
  15. 17 9月, 2013 1 次提交
  16. 08 5月, 2013 1 次提交
  17. 01 5月, 2013 1 次提交
  18. 12 1月, 2013 2 次提交
  19. 13 10月, 2012 4 次提交
  20. 12 10月, 2012 4 次提交
  21. 06 10月, 2012 1 次提交
  22. 21 9月, 2012 1 次提交
  23. 18 9月, 2012 3 次提交
    • E
      userns: Convert the audit loginuid to be a kuid · e1760bd5
      Eric W. Biederman 提交于
      Always store audit loginuids in type kuid_t.
      
      Print loginuids by converting them into uids in the appropriate user
      namespace, and then printing the resulting uid.
      
      Modify audit_get_loginuid to return a kuid_t.
      
      Modify audit_set_loginuid to take a kuid_t.
      
      Modify /proc/<pid>/loginuid on read to convert the loginuid into the
      user namespace of the opener of the file.
      
      Modify /proc/<pid>/loginud on write to convert the loginuid
      rom the user namespace of the opener of the file.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Paul Moore <paul@paul-moore.com> ?
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      e1760bd5
    • E
      audit: Add typespecific uid and gid comparators · ca57ec0f
      Eric W. Biederman 提交于
      The audit filter code guarantees that uid are always compared with
      uids and gids are always compared with gids, as the comparason
      operations are type specific.  Take advantage of this proper to define
      audit_uid_comparator and audit_gid_comparator which use the type safe
      comparasons from uidgid.h.
      
      Build on audit_uid_comparator and audit_gid_comparator and replace
      audit_compare_id with audit_compare_uid and audit_compare_gid.  This
      is one of those odd cases where being type safe and duplicating code
      leads to simpler shorter and more concise code.
      
      Don't allow bitmask operations in uid and gid comparisons in
      audit_data_to_entry.  Bitmask operations are already denined in
      audit_rule_to_entry.
      
      Convert constants in audit_rule_to_entry and audit_data_to_entry into
      kuids and kgids when appropriate.
      
      Convert the uid and gid field in struct audit_names to be of type
      kuid_t and kgid_t respectively, so that the new uid and gid comparators
      can be applied in a type safe manner.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ca57ec0f
    • E
      audit: Remove the unused uid parameter from audit_receive_filter · 017143fe
      Eric W. Biederman 提交于
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      017143fe