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.h
          +++ new/usr/src/uts/common/c2/audit.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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 (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  23   24   */
  24   25  
  25   26  /*
  26   27   * This file contains the declarations of the various data structures
  27   28   * used by the auditing module(s).
  28   29   */
  29   30  
  30   31  #ifndef _BSM_AUDIT_H
  31   32  #define _BSM_AUDIT_H
  32   33  
↓ open down ↓ 450 lines elided ↑ open up ↑
 483  484  #include <sys/crypto/ioctladmin.h>
 484  485  #include <sys/netstack.h>
 485  486  #include <sys/zone.h>
 486  487  
 487  488  #ifdef __cplusplus
 488  489  extern "C" {
 489  490  #endif
 490  491  
 491  492  struct fcntla;
 492  493  struct t_audit_data;
      494 +struct t_audit_sacl;
 493  495  struct audit_path;
 494  496  struct priv_set;
 495  497  struct devplcysys;
 496  498  
 497  499  struct auditcalls {
 498  500          long    code;
 499  501          long    a1;
 500  502          long    a2;
 501  503          long    a3;
 502  504          long    a4;
↓ open down ↓ 37 lines elided ↑ open up ↑
 540  542  void    audit_exitprom(int);
 541  543  void    audit_chdirec(struct vnode *, struct vnode **);
 542  544  void    audit_sock(int, struct queue *, struct msgb *, int);
 543  545  int     audit_start(unsigned int, unsigned int, uint32_t, int, klwp_t *);
 544  546  void    audit_finish(unsigned int, unsigned int, int, union rval *);
 545  547  int     audit_async_start(label_t *, au_event_t, int);
 546  548  void    audit_async_finish(caddr_t *, au_event_t, au_emod_t, timestruc_t *);
 547  549  void    audit_async_discard_backend(void *);
 548  550  void    audit_async_done(caddr_t *, int);
 549  551  void    audit_async_drop(caddr_t *, int);
      552 +void    audit_sacl(char *, cred_t *, uint32_t, boolean_t,
      553 +    struct t_audit_sacl *);
 550  554  
 551  555  #ifndef AUK_CONTEXT_T
 552  556  #define AUK_CONTEXT_T
 553  557  typedef struct au_kcontext au_kcontext_t;
 554  558  #endif
 555  559  
 556  560  /* Zone audit context setup routine */
 557  561  void au_zone_setup(void);
 558  562  
 559  563  /*
↓ open down ↓ 10 lines elided ↑ open up ↑
 570  574  #define AU_AUDIT_MASK   (AUC_AUDITING | AUC_NOSPACE)
 571  575  
 572  576  /*
 573  577   * Get the given zone audit status. zcontext != NULL serves
 574  578   * as a protection when c2audit module is not loaded.
 575  579   */
 576  580  #define AU_ZONE_AUDITING(zcontext)          \
 577  581          (audit_active == C2AUDIT_LOADED &&  \
 578  582              ((AU_AUDIT_MASK) & au_zone_getstate((zcontext))))
 579  583  
      584 +#define AU_AUDIT_PERZONE()      \
      585 +        ((audit_policy & AUDIT_PERZONE) != 0)
      586 +
 580  587  /*
 581  588   * Get auditing status
 582  589   */
 583  590  #define AU_AUDITING() (audit_getstate())
 584  591  
 585  592  int     audit_success(au_kcontext_t *, struct t_audit_data *, int, cred_t *);
 586  593  int     auditme(au_kcontext_t *, struct t_audit_data *, au_state_t);
      594 +int     auditev(au_event_t, cred_t *);
 587  595  void    audit_fixpath(struct audit_path *, int);
 588  596  void    audit_ipc(int, int, void *);
 589  597  void    audit_ipcget(int, void *);
 590  598  void    audit_fdsend(int, struct file *, int);
 591  599  void    audit_fdrecv(int, struct file *);
 592  600  void    audit_priv(int, const struct priv_set *, int);
 593  601  void    audit_setppriv(int, int, const struct priv_set *, const cred_t *);
 594  602  void    audit_psecflags(proc_t *, psecflagwhich_t,
 595  603      const secflagdelta_t *);
 596  604  void    audit_devpolicy(int, const struct devplcysys *);
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX