/ securityd / src / securityd.d
securityd.d
  1  /*
  2   * DTrace provider for securityd
  3   */
  4  
  5  
  6  /*
  7   * Work around 5194316
  8   */
  9  #define uint32_t unsigned
 10  
 11  
 12  /*
 13   * Types
 14   */
 15  typedef const void *DTHandle;
 16  typedef uint32_t DTPort;
 17  typedef uint32_t DTGuest;
 18  typedef uint8_t bool;
 19  
 20  /*
 21   * The main static provider for securityd
 22   */
 23  provider securityd {
 24  	/*
 25  	 * Overall operational events
 26  	 */
 27  	probe installmode();		// configuring for system installation scenario
 28  	probe initialized(const char *bootstrapName);
 29  
 30  
 31  	/*
 32  	 * Keychain activity (DbCommon status change)
 33  	 */
 34  	probe keychain__create(DTHandle common, const char *name, DTHandle db);
 35  	probe keychain__make(DTHandle common, const char *name, DTHandle db);
 36  	probe keychain__join(DTHandle common, const char *name, DTHandle db);
 37  	probe keychain__unlock(DTHandle id, const char *name);
 38  	probe keychain__lock(DTHandle id, const char *name);
 39  	probe keychain__release(DTHandle id, const char *name);
 40  	
 41  	/*
 42  	 * Client management
 43  	 */
 44  	probe client__new(DTHandle id, int pid, DTHandle session, const char *path, DTPort taskport, int uid, int gid, bool flipped);
 45  	probe client__release(DTHandle id, int pid);
 46  	probe client__connection__new(DTHandle id, DTPort port, DTHandle client);
 47  	probe client__connection__release(DTHandle id);
 48  	
 49  	probe client__change_session(DTHandle id, DTHandle session);
 50  	probe client__reset__amnesia(DTHandle id);
 51  	probe client__reset__full(DTHandle id);
 52  	
 53  	probe request__entry(const char *name, DTHandle connection, DTHandle process);
 54  	probe request__return(uint32_t osstatus);
 55  
 56  	/*
 57  	 * Session management
 58  	 */
 59  	probe session__create(DTHandle id, uint32_t sessionId, const void *auditInfo, uint32_t auditInfoLength);
 60  	probe session__kill(DTHandle id, uint32_t sessionId);
 61  	probe session__destroy(DTHandle id, uint32_t sessionId);
 62  	
 63  	probe session__notify(uint64_t id, uint32_t flags, int uid);
 64  	
 65  	/*
 66  	 * Port-related events (internal interest only)
 67  	 */
 68  	probe ports__dead__connection(DTPort port);
 69  	probe ports__dead__process(DTPort port);
 70  	probe ports__dead__session(DTPort port);
 71  	probe ports__dead__orphan(DTPort port);
 72  	
 73  	/*
 74  	 * Power management and tracking
 75  	 */
 76  	probe power__sleep();
 77  	probe power__wake();
 78  	probe power__on();
 79  	
 80  	/*
 81  	 * Code Signing related
 82  	 */
 83  	probe host__register(DTHandle proc, DTPort port);
 84  	probe host__proxy(DTHandle proc, DTPort port);
 85  	probe host__unregister(DTHandle proc);
 86  	probe guest__create(DTHandle proc, DTGuest host, DTGuest guest, uint32_t status, uint32_t flags, const char *path);
 87  	probe guest__cdhash(DTHandle proc, DTGuest guest, const void *hash, uint32_t length);
 88  	probe guest__destroy(DTHandle proc, DTGuest guest);
 89  	probe guest__change(DTHandle proc, DTGuest guest, uint32_t status);
 90  	
 91  	/*
 92  	 * Child management
 93  	 */
 94  	probe child__dying(int pid);
 95  	probe child__checkin(int pid, DTPort servicePort);
 96  	probe child__stillborn(int pid);
 97  	probe child__ready(int pid);
 98      
 99      /*
100       * Authorization
101       */
102      /* creation */
103      probe auth__create(DTHandle session, void *authref);
104      /* rule evaluation types */
105      probe auth__allow(DTHandle authref, const char *rule);
106      probe auth__deny(DTHandle authref, const char *rule);
107      probe auth__user(DTHandle authref, const char *rule);
108      probe auth__rules(DTHandle authref, const char *rule);
109      probe auth__kofn(DTHandle authref, const char *rule);
110      probe auth__mechrule(DTHandle authref, const char *rule);
111      probe auth__mech(DTHandle authref, const char *mechanism);
112      /* evaluation intermediate results */
113      probe auth__user__allowroot(DTHandle authref);
114      probe auth__user__allowsessionowner(DTHandle authref);
115      /* evaluation final result */
116      probe auth__evalright(DTHandle authref, const char *right, int32_t status);
117  	
118  	/*
119  	 * Miscellaneous activity
120  	 */
121  	probe shutdown__begin();
122  	probe shutdown__count(int processesLeft, int dirtyCountLeft);
123  	probe shutdown__now();
124  
125  	probe entropy__collect();
126  	probe entropy__seed(const void *data, uint32_t count);
127  	probe entropy__save(const char *path);
128  	
129  	probe signal__received(int signal);
130  	probe signal__handled(int signal);
131  };