この付録では、DTrace プローブおよび引数構造体について説明します。その使用法の例については、Kerberos サービスでの DTrace の使用を参照してください。
プローブとは、DTrace が、一連のアクションを実行するためのリクエストをバインドできるプログラムの場所またはアクティビティーのことです。プローブは、プロバイダによって定義および実装されます。プロバイダは、プローブによるデータのトレースを可能にする、カーネルでロード可能なモジュールです。
これらのプローブは、ユーザー静的定義トレース (USDT) に使用されます。USDT プローブは、ユーザーランド内の Kerberos プロトコルを検査するように設計されています。静的定義トレースのためのカーネルプローブは提供されていません。
適切な DTrace プローブでユーザーが必要とする情報 (スタックトレース、タイムスタンプ、関数の引数など) を記録するスクリプトを作成します。プローブが起動されると、DTrace はそのプローブからデータを収集し、それをユーザーに報告します。プローブのアクションを指定しない場合、DTrace は、プローブが起動した各時間と動作している CPU を記録します。
Kerberos DTrace プローブは、RFC4120: The Kerberos Network Authentication Service (V5) で説明されている Kerberos メッセージタイプのあとにモデル化されます。プローブは、libkrb5/mech_krb5 のコンシューマ (libgss 経由で mech_krb5 を使用するアプリケーションを含む) が使用できます。プローブは、メッセージの作成と消費、および送信と受信の間で分けられます。libgss の詳細は、libgss(3LIB) のマニュアルページを参照してください。
プローブを使用するには、kerberos プロバイダ、プローブの名前 (krb_message-recv など)、および引数を指定します。例については、Kerberos サービスでの DTrace の使用を参照してください。
KRB_AP_REP 用のプローブ:
kerberos$pid:::krb_ap_rep-make kerberos$pid:::krb_ap_rep-read args[0] krbinfo_t * args[1] kaprepinfo_t *
KRB_AP_REQ 用のプローブ:
kerberos$pid:::krb_ap_req-make kerberos$pid:::krb_ap_req-read args[0] krbinfo_t * args[1] kapreqinfo_t * args[2] kticketinfo_t * args[3] kauthenticatorinfo_t *
KRB_KDC_REP 用のプローブ:
kerberos$pid:::krb_kdc_rep-make kerberos$pid:::krb_kdc_rep-read args[0] krbinfo_t * args[1] kdcrepinfo_t * args[2] kticketinfo_t *
KRB_KDC_REQ 用のプローブ:
kerberos$pid:::krb_kdc_req-make kerberos$pid:::krb_kdc_req-read args[0] krbinfo_t * args[1] kdcreqinfo_t *
KRB_CRED 用のプローブ:
kerberos$pid:::krb_cred-make kerberos$pid:::krb_cred-read args[0] krbinfo_t * args[1] kcredinfo_t *
KRB_ERROR 用のプローブ:
kerberos$pid:::krb_error-make kerberos$pid:::krb_error-read args[0] krbinfo_t * args[1] kerrorinfo_t *
KRB_PRIV 用のプローブ:
kerberos$pid:::krb_priv-make kerberos$pid:::krb_priv-read args[0] krbinfo_t * args[1] kprivinfo_t *
KRB_SAFE 用のプローブ:
kerberos$pid:::krb_safe-make kerberos$pid:::krb_safe-read args[0] krbinfo_t * args[1] ksafeinfo_t *
メッセージを送受信するためのプローブ
kerberos$pid:::krb_message-recv kerberos$pid:::krb_message-send args[0] krbinfo_t * args[1] kconninfo_t *
特定の状況では、一部の引数の値が 0 または空になることがあります。Kerberos 引数構造体は、RFC4120: The Kerberos Network Authentication Service (V5) と一般的に整合性があるように設計されています。
typedef struct krbinfo {
uint8_t krb_version; /* protocol version number (5) */
string krb_message_type; /* Message type (AS_REQ(10), ...) */
uint64_t krb_message_id; /* message identifier */
uint32_t krb_message_length; /* message length */
uintptr_t krb_message; /* raw ASN.1 encoded message */
} krbinfo_t;
typedef struct kconninfo {
string kconn_remote; /* remote host address */
string kconn_local; /* local host address */
uint16_t kconn_localport; /* local port */
uint16_t kconn_remoteport; /* remote port */
string kconn_protocol; /* protocol (ipv4, ipv6) */
string kconn_type; /* transport type (udp, tcp) */
} kconninfo_t;
typedef struct kauthenticatorinfo {
string kauth_client; /* client principal identifier */
string kauth_cksum_type; /* type of checksum (des-cbc, ...) */
uint32_t kauth_cksum_length; /* length of checksum */
uintptr_t kauth_cksum_value; /* raw checksum data */
uint32_t kauth_cusec; /* client time, microseconds */
uint32_t kauth_ctime; /* client time in seconds */
string kauth_subkey_type; /* sub-key type (des3-cbc-sha1, ...) */
uint32_t kauth_subkey_length; /* sub-key length */
uintptr_t kauth_subkey_value; /* sub-key data */
uint32_t kauth_seq_number; /* sequence number */
string kauth_authorization_data; /* top-level authorization types
(AD-IF-RELEVANT, ... ) */
} kauthenticatorinfo_t;
typedef struct kticketinfo_t {
string kticket_server; /* service principal identifier */
uint32_t kticket_enc_part_kvno; /* key version number */
string kticket_enc_part_etype; /* enc type of encrypted ticket */
string kticket_enc_flags; /* ticket flags (forwardable, ...) */
string kticket_enc_key_type; /* key type (des3-cbc-sha1, ...) */
uint32_t kticket_enc_key_length; /* key length */
uintptr_t kticket_enc_key_value; /* key data */
string kticket_enc_client; /* client principal identifier */
string kticket_enc_transited; /* list of transited Kerberos realms */
string kticket_enc_transited_type; /* encoding type */
uint32_t kticket_enc_authtime; /* time of initial authentication */
uint32_t kticket_enc_starttime; /* ticket start time in seconds */
uint32_t kticket_enc_endtime; /* ticket end time in seconds */
uint32_t kticket_enc_renew_till; /* ticket renewal time in seconds */
string kticket_enc_addresses; /* addresses associated with ticket */
string kticket_enc_authorization_data; /* list of top-level auth types */
} kticketinfo_t;
typedef struct kdcreqinfo {
string kdcreq_padata_types; /* list of pre-auth types */
string kdcreq_kdc_options; /* requested ticket flags */
string kdcreq_client; /* client principal identifier */
string kdcreq_server; /* server principal identifier */
uint32_t kdcreq_from; /* requested start time in seconds */
uint32_t kdcreq_till; /* requested end time in seconds */
uint32_t kdcreq_rtime; /* requested renewal time in seconds */
uint32_t kdcreq_nonce; /* nonce for replay detection */
string kdcreq_etype; /* preferred encryption types */
string kdcreq_addresses; /* list of requested ticket addresses */
string kdcreq_authorization_data; /* list of top-level auth types */
uint32_t kdcreq_num_additional_tickets; /* number of additional tickets */
} kdcreqinfo_t;
typedef struct kdcrepinfo {
string kdcrep_padata_types; /* list of pre-auth types */
string kdcrep_client; /* client principal identifier */
uint32_t kdcrep_enc_part_kvno; /* key version number */
string kdcrep_enc_part_etype; /* enc type of encrypted KDC reply */
string kdcrep_enc_key_type; /* key type (des3-cbc-sha1, ...) */
uint32_t kdcrep_enc_key_length; /* key length */
uintptr_t kdcrep_enc_key_value; /* key data */
string kdcrep_enc_last_req; /* times of last request of principal */
uint32_t kdcrep_enc_nonce; /* nonce for replay detection */
uint32_t kdcrep_enc_key_expiration; /* expiration time of client's key */
string kdcrep_enc_flags; /* ticket flags */
uint32_t kdcrep_enc_authtime; /* time of authentication of ticket */
uint32_t kdcrep_enc_starttime; /* ticket start time in seconds */
uint32_t kdcrep_enc_endtime; /* ticket end time in seconds */
uint32_t kdcrep_enc_renew_till; /* ticket renewal time in seconds*/
string kdcrep_enc_server; /* server principal identifier */
string kdcrep_enc_caddr; /* zero or more client addresses */
} kdcrepinfo_t;
typedef struct kapreqinfo {
string kapreq_ap_options; /* options (use-session-key,... ) */
uint32_t kapreq_authenticator_kvno; /* key version number */
string kapreq_authenticator_etype; /* enc type of authenticator */
} kapreqinfo_t;
typedef struct kaprepinfo {
uint32_t kaprep_enc_part_kvno; /* key version number */
string kaprep_enc_part_etype; /* enc type of encrypted AP reply */
uint32_t kaprep_enc_ctime; /* client time in seconds */
uint32_t kaprep_enc_cusec; /* client time, microseconds portion */
string kaprep_enc_subkey_type; /* sub-key type */
uint32_t kaprep_enc_subkey_length; /* sub-key length */
uintptr_t kaprep_enc_subkey_value; /* sub-key data */
uint32_t kaprep_enc_seq_number; /* sequence number */
} kaprepinfo_t;
typedef struct kerrorinfo {
uint32_t kerror_ctime; /* client time in seconds */
uint32_t kerror_cusec; /* client time, microseconds */
uint32_t kerror_stime; /* server time in seconds */
uint32_t kerror_susec; /* server time, microseconds */
string kerror_error_code; /* error code (KRB_AP_ERR_SKEW, ...) */
string kerror_client; /* client principal identifier */
string kerror_server; /* server principal identifier */
string kerror_e_text; /* additional error text */
string kerror_e_data; /* additional error data */
} kerrorinfo_t;
typedef struct ksafeinfo {
uintptr_t ksafe_user_data; /* raw application specific data */
uint32_t ksafe_timestamp; /* time of sender in seconds */
uint32_t ksafe_usec; /* time of sender, microseconds */
uint32_t ksafe_seq_number; /* sequence number */
string ksafe_s_address; /* sender's address */
string ksafe_r_address; /* recipient's address */
string ksafe_cksum_type; /* checksum type (des-cbc, ...) */
uint32_t ksafe_cksum_length; /* length of checksum */
uintptr_t ksafe_cksum_value; /* raw checksum data */
} ksafeinfo_t;
typedef struct kprivinfo {
uint32_t kpriv_enc_part_kvno; /* key version number */
string kpriv_enc_part_etype; /* enc type of encrypted message */
uintptr_t kpriv_enc_user_data; /* raw application specific data */
uint32_t kpriv_enc_timestamp; /* time of sender in seconds */
uint32_t kpriv_enc_usec; /* time of sender, microseconds */
uint32_t kpriv_enc_seq_number; /* sequence number */
string kpriv_enc_s_address; /* sender's address */
string kpriv_enc_r_address; /* recipient's address */
} kprivinfo_t;
typedef struct kcredinfo {
uint32_t kcred_enc_part_kvno; /* key version number */
string kcred_enc_part_etype; /* enc type of encrypted message */
uint32_t kcred_tickets; /* number of tickets */
uint32_t kcred_enc_nonce; /* nonce for replay detection */
uint32_t kcred_enc_timestamp; /* time of sender in seconds */
uint32_t kcred_enc_usec; /* time of sender, microseconds */
string kcred_enc_s_address; /* sender's address */
string kcred_enc_r_address; /* recipient's address */
} kcredinfo_t;