Skip to content

Commit

Permalink
11037 SMB File access audit logging (reserve IDs)
Browse files Browse the repository at this point in the history
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>
Reviewed by: John Levon <john.levon@joyent.com>
  • Loading branch information
mbarden authored and gwr committed Oct 25, 2019
1 parent 7284664 commit b5c366f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
9 changes: 9 additions & 0 deletions usr/src/cmd/auditrecord/audit_record_attr.txt
Expand Up @@ -3,6 +3,7 @@
# other comments are removed.
##
## Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
## Copyright 2018 Nexenta Systems, Inc. All rights reserved.
## Copyright 2019 Joyent, Inc.
##
## CDDL HEADER START
Expand Down Expand Up @@ -1485,6 +1486,14 @@ label=AUE_RFSSYS
label=AUE_RMDIR
format=path:[attr]

label=AUE_SACL
title=File Access Audit
syscall=none
see=none
format=head:path:arg1:[text]2:subj
comment="access_mask":
comment="Windows SID"

label=AUE_SEMCTL
format=arg1:[ipc]:[ipc_perm]
comment=1, semaphore ID, "sem ID"
Expand Down
3 changes: 3 additions & 0 deletions usr/src/cmd/auditreduce/auditrt.h
Expand Up @@ -21,6 +21,8 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2018 Nexenta Systems, Inc. All rights reserved.
*/

#ifndef _AUDITRT_H
Expand Down Expand Up @@ -155,6 +157,7 @@ typedef struct audit_pcb audit_pcb_t;
#define OBJ_SHMOWNER 0x10000 /* 'o' shared memory [c]owner */
#define OBJ_FMRI 0x20000 /* 'o' fmri object */
#define OBJ_USER 0x40000 /* 'o' user object */
#define OBJ_WSID 0x80000 /* 'o' windows sid object */

#define SOCKFLG_MACHINE 0 /* search socket token by machine name */
#define SOCKFLG_PORT 1 /* search socket token by port number */
Expand Down
3 changes: 3 additions & 0 deletions usr/src/cmd/praudit/toktable.h
Expand Up @@ -21,6 +21,8 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2018 Nexenta Systems, Inc. All rights reserved.
*/

#ifndef _TOKTABLE_H
Expand Down Expand Up @@ -156,6 +158,7 @@ enum tagnum_t { TAG_INVALID = MAXTOKEN,
TAG_ACETYPE, /* with ace token */
TAG_ACEID, /* with ace token */
TAG_USERNAME, /* with user token */
TAG_WSID, /* with wsid token */
MAXTAG
};

Expand Down
5 changes: 3 additions & 2 deletions usr/src/lib/libbsm/audit_class.txt
Expand Up @@ -2,6 +2,8 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
Expand All @@ -21,8 +23,6 @@
#
# CDDL HEADER END
#
# ident "%Z%%M% %I% %E% SMI"
#
# User Level Class Masks
#
# Developers: If you change this file you must also edit audit.h.
Expand Down Expand Up @@ -66,6 +66,7 @@
0x00800000:xc:X - object create/destroy
0x01000000:xs:X - operations that always silently fail, if bad
0x01c00000:xx:X - all X events (meta-class)
0x02000000:sa:SACL-based File Access Auditing
0x20000000:io:ioctl
0x40000000:ex:exec
0x80000000:ot:other
Expand Down
2 changes: 2 additions & 0 deletions usr/src/lib/libbsm/audit_event.txt
@@ -1,5 +1,6 @@
#
# Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
#
#
# CDDL HEADER START
Expand Down Expand Up @@ -361,6 +362,7 @@
310:AUE_AUDITON_GETAMASK:auditon(2) - get default user preselection mask:aa
311:AUE_AUDITON_SETAMASK:auditon(2) - set default user preselection mask:as
312:AUE_PSECFLAGS:psecflags(2) - set process security flags:pm
313:AUE_SACL:SACL-based File Access Auditing:sa
#
# user level audit events
# 2048 - 6143 Reserved
Expand Down
4 changes: 3 additions & 1 deletion usr/src/uts/common/c2/audit_kevents.h
Expand Up @@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2018 Nexenta Systems, Inc. All rights reserved.
*/

#ifndef _BSM_AUDIT_KEVENTS_H
Expand Down Expand Up @@ -348,9 +349,10 @@ extern "C" {
#define AUE_AUDITON_GETAMASK 310 /* =aa */
#define AUE_AUDITON_SETAMASK 311 /* =as */
#define AUE_PSECFLAGS 312 /* =pm psecflags */
#define AUE_SACL 313 /* =sa SACL auditing */

/* NOTE: update MAX_KEVENTS below if events are added. */
#define MAX_KEVENTS 312
#define MAX_KEVENTS 313

#ifdef __cplusplus
}
Expand Down
8 changes: 8 additions & 0 deletions usr/src/uts/common/c2/audit_record.h
Expand Up @@ -21,6 +21,8 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2018 Nexenta Systems, Inc. All rights reserved.
*/

#ifndef _BSM_AUDIT_RECORD_H
Expand Down Expand Up @@ -189,6 +191,12 @@ extern "C" {
#define AUT_IN_ADDR_EX ((char)0x7e)
#define AUT_SOCKET_EX ((char)0x7f)

/*
* Can't do >= 0x80 because these are chars. 0x16/0x17 seem to be free here,
* but who knows if they have historical uses
*/
#define AUT_ACCESS_MASK ((char)0x16)
#define AUT_WSID ((char)0x17)

/*
* Audit print suggestion types.
Expand Down

0 comments on commit b5c366f

Please sign in to comment.