Print this page
NEX-13644 File access audit logging
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/c2/audit_record.h
          +++ new/usr/src/uts/common/c2/audit_record.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  24   26   */
  25   27  
  26   28  #ifndef _BSM_AUDIT_RECORD_H
  27   29  #define _BSM_AUDIT_RECORD_H
  28   30  
  29   31  
  30   32  #ifdef _KERNEL
  31   33  #include <sys/priv.h>
  32   34  #else
  33   35  #include <priv.h>
  34   36  #endif
  35   37  #include <sys/socket.h>
  36   38  #include <sys/acl.h>
       39 +#include <sys/sid.h>
  37   40  
  38   41  #include <sys/tsol/label.h>
  39   42  
  40   43  #ifdef __cplusplus
  41   44  extern "C" {
  42   45  #endif
  43   46  
  44   47  /*
  45   48   * Version of audit attributes
  46   49   *
↓ open down ↓ 135 lines elided ↑ open up ↑
 182  185   */
 183  186  
 184  187  #define AUT_HEADER64_EX         ((char)0x79)
 185  188  #define AUT_SUBJECT32_EX        ((char)0x7a)
 186  189  #define AUT_PROCESS32_EX        ((char)0x7b)
 187  190  #define AUT_SUBJECT64_EX        ((char)0x7c)
 188  191  #define AUT_PROCESS64_EX        ((char)0x7d)
 189  192  #define AUT_IN_ADDR_EX          ((char)0x7e)
 190  193  #define AUT_SOCKET_EX           ((char)0x7f)
 191  194  
      195 +/*
      196 + * Can't do >= 0x80 because these are chars. 0x16/0x17 seem to be free here,
      197 + * but who knows if they have historical uses
      198 + */
      199 +#define AUT_ACCESS_MASK         ((char)0x16)
      200 +#define AUT_WSID                ((char)0x17)
 192  201  
 193  202  /*
 194  203   * Audit print suggestion types.
 195  204   */
 196  205  
 197  206  #define AUP_BINARY      ((char)0)
 198  207  #define AUP_OCTAL       ((char)1)
 199  208  #define AUP_DECIMAL     ((char)2)
 200  209  #define AUP_HEX         ((char)3)
 201  210  #define AUP_STRING      ((char)4)
↓ open down ↓ 57 lines elided ↑ open up ↑
 259  268  token_t *au_append_token(token_t *, token_t *);
 260  269  token_t *au_set(caddr_t, uint_t);
 261  270  
 262  271  void au_free_rec(au_buff_t *);
 263  272  
 264  273  #define au_getclr()             ((token_t *)au_get_buff())
 265  274  #define au_toss_token(tok)      (au_free_rec((au_buff_t *)(tok)))
 266  275  
 267  276  token_t *au_to_acl();
 268  277  token_t *au_to_ace();
      278 +token_t *au_to_access_mask(uint32_t);
      279 +token_t *au_to_wsid(ksid_t *);
 269  280  token_t *au_to_attr(struct vattr *);
 270  281  token_t *au_to_data(char, char, char, char *);
 271  282  token_t *au_to_header(int, au_event_t, au_emod_t);
 272  283  token_t *au_to_header_ex(int, au_event_t, au_emod_t);
 273  284  token_t *au_to_ipc(char, int);
 274  285  token_t *au_to_ipc_perm(kipc_perm_t *);
 275  286  token_t *au_to_iport(ushort_t);
 276  287  token_t *au_to_in_addr(struct in_addr *);
 277  288  token_t *au_to_in_addr_ex(int32_t *);
 278  289  token_t *au_to_ip(struct ip *);
 279  290  token_t *au_to_groups(const gid_t *, uint_t);
 280  291  token_t *au_to_path(struct audit_path *);
      292 +token_t *au_to_path_string(const char *);
 281  293  token_t *au_to_seq();
 282  294  token_t *au_to_process(uid_t, gid_t, uid_t, gid_t, pid_t,
 283  295                          au_id_t, au_asid_t, const au_tid_addr_t *);
 284  296  token_t *au_to_subject(uid_t, gid_t, uid_t, gid_t, pid_t,
 285  297                          au_id_t, au_asid_t, const au_tid_addr_t *);
 286  298  token_t *au_to_return32(int, int32_t);
 287  299  token_t *au_to_return64(int, int64_t);
 288  300  token_t *au_to_text(const char *);
 289  301  /* token_t *au_to_tid(au_generic_tid_t *);  no kernel implementation */
 290  302  token_t *au_to_trailer(int);
↓ open down ↓ 185 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX