Introduce core security and privilege structures
This commit is contained in:
@@ -54,6 +54,11 @@
|
||||
/* Default security quota */
|
||||
#define SE_DEFAULT_SECURITY_QUOTA 2048
|
||||
|
||||
#define SE_INITIAL_PRIVILEGE_COUNT 3
|
||||
|
||||
/* Token source length */
|
||||
#define SE_TOKEN_SOURCE_LENGTH 8
|
||||
|
||||
/* C/C++ specific code */
|
||||
#ifndef __XTOS_ASSEMBLER__
|
||||
|
||||
@@ -66,6 +71,15 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL
|
||||
SecurityDelegation
|
||||
} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
|
||||
|
||||
/* Security operation codes */
|
||||
typedef enum _SECURITY_OPERATION_CODE
|
||||
{
|
||||
SetSecurityDescriptor,
|
||||
QuerySecurityDescriptor,
|
||||
DeleteSecurityDescriptor,
|
||||
AssignSecurityDescriptor
|
||||
} SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE;
|
||||
|
||||
/* Generic security mapping structure definition */
|
||||
typedef struct _GENERIC_MAPPING
|
||||
{
|
||||
@@ -75,6 +89,45 @@ typedef struct _GENERIC_MAPPING
|
||||
ULONG GenericAll;
|
||||
} GENERIC_MAPPING, *PGENERIC_MAPPING;
|
||||
|
||||
/* LUID and attributes structure definition */
|
||||
typedef struct _LUID_AND_ATTRIBUTES
|
||||
{
|
||||
LUID Luid;
|
||||
ULONG Attributes;
|
||||
} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
|
||||
|
||||
/* Initial privilege set structure definition */
|
||||
typedef struct _INITIAL_PRIVILEGE_SET
|
||||
{
|
||||
ULONG PrivilegeCount;
|
||||
ULONG Control;
|
||||
LUID_AND_ATTRIBUTES Privilege[SE_INITIAL_PRIVILEGE_COUNT];
|
||||
} INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
|
||||
|
||||
/* Privilege set structure definition */
|
||||
typedef struct _PRIVILEGE_SET
|
||||
{
|
||||
ULONG PrivilegeCount;
|
||||
ULONG Control;
|
||||
LUID_AND_ATTRIBUTES Privilege[1];
|
||||
} PRIVILEGE_SET, *PPRIVILEGE_SET;
|
||||
|
||||
/* Token source structure definition */
|
||||
typedef struct _TOKEN_SOURCE
|
||||
{
|
||||
CHAR SourceName[SE_TOKEN_SOURCE_LENGTH];
|
||||
LUID SourceIdentifier;
|
||||
} TOKEN_SOURCE, *PTOKEN_SOURCE;
|
||||
|
||||
/* Token control structure definition */
|
||||
typedef struct _TOKEN_CONTROL
|
||||
{
|
||||
LUID TokenId;
|
||||
LUID AuthenticationId;
|
||||
LUID ModifiedId;
|
||||
TOKEN_SOURCE TokenSource;
|
||||
} TOKEN_CONTROL, *PTOKEN_CONTROL;
|
||||
|
||||
/* Security quality of service structure definition */
|
||||
typedef struct _SECURITY_QUALITY_OF_SERVICE
|
||||
{
|
||||
@@ -84,5 +137,50 @@ typedef struct _SECURITY_QUALITY_OF_SERVICE
|
||||
BOOLEAN EffectiveOnly;
|
||||
} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
|
||||
|
||||
/* Security client context structure definition */
|
||||
typedef struct _SECURITY_CLIENT_CONTEXT
|
||||
{
|
||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||
PACCESS_TOKEN ClientToken;
|
||||
BOOLEAN DirectlyAccessClientToken;
|
||||
BOOLEAN DirectAccessEffectiveOnly;
|
||||
BOOLEAN ServerIsRemote;
|
||||
TOKEN_CONTROL ClientTokenControl;
|
||||
} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;
|
||||
|
||||
/* Security subject context structure definition */
|
||||
typedef struct _SECURITY_SUBJECT_CONTEXT
|
||||
{
|
||||
PACCESS_TOKEN ClientToken;
|
||||
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
|
||||
PACCESS_TOKEN PrimaryToken;
|
||||
PVOID ProcessAuditId;
|
||||
} SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
|
||||
|
||||
/* Access state structure definition */
|
||||
typedef struct _ACCESS_STATE
|
||||
{
|
||||
LUID OperationID;
|
||||
BOOLEAN SecurityEvaluated;
|
||||
BOOLEAN GenerateAudit;
|
||||
BOOLEAN GenerateOnClose;
|
||||
BOOLEAN PrivilegesAllocated;
|
||||
ULONG Flags;
|
||||
ACCESS_MASK RemainingDesiredAccess;
|
||||
ACCESS_MASK PreviouslyGrantedAccess;
|
||||
ACCESS_MASK OriginalDesiredAccess;
|
||||
SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
|
||||
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
||||
PVOID AuxData;
|
||||
union
|
||||
{
|
||||
INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
|
||||
PRIVILEGE_SET PrivilegeSet;
|
||||
} Privileges;
|
||||
BOOLEAN AuditPrivileges;
|
||||
UNICODE_STRING ObjectName;
|
||||
UNICODE_STRING ObjectTypeName;
|
||||
} ACCESS_STATE, *PACCESS_STATE;
|
||||
|
||||
#endif /* __XTOS_ASSEMBLER__ */
|
||||
#endif /* __XTDK_SETYPES_H */
|
||||
|
||||
Reference in New Issue
Block a user