* increment the major version.
*/
#define AUTH_MAJOR 1
-#define AUTH_MINOR 2
+#define AUTH_MINOR 3
#define AUTHZ_MAJOR 1
-#define AUTHZ_MINOR 1
+#define AUTHZ_MINOR 2
#define KDC_AUTHZ_MAJOR 1
#define KDC_AUTHZ_MINOR 0
const char *domain_name,
const char *account_name,
struct dom_sid *sid,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info,
enum event_id_type event_id,
int debug_level)
{
struct json_object wrapper = json_empty_object;
struct json_object authentication = json_empty_object;
+ struct json_object client_policy = json_null_object();
+ struct json_object server_policy = json_null_object();
char logon_id[19];
int rc = 0;
const char *clientDomain = ui->orig_client.domain_name ?
goto failure;
}
+ if (client_audit_info != NULL) {
+ client_policy = json_from_audit_info(client_audit_info);
+ if (json_is_invalid(&client_policy)) {
+ goto failure;
+ }
+ }
+
+ rc = json_add_object(&authentication, "clientPolicyAccessCheck", &client_policy);
+ if (rc != 0) {
+ goto failure;
+ }
+
+ if (server_audit_info != NULL) {
+ server_policy = json_from_audit_info(server_audit_info);
+ if (json_is_invalid(&server_policy)) {
+ goto failure;
+ }
+ }
+
+ rc = json_add_object(&authentication, "serverPolicyAccessCheck", &server_policy);
+ if (rc != 0) {
+ goto failure;
+ }
+
wrapper = json_new_object();
if (json_is_invalid(&wrapper)) {
goto failure;
json_free(&wrapper);
return;
failure:
+ json_free(&server_policy);
+ json_free(&client_policy);
/*
* On a failure authentication will not have been added to wrapper so it
* needs to be freed to avoid a leak.
const char *auth_type,
const char *transport_protection,
struct auth_session_info *session_info,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info,
int debug_level)
{
struct json_object wrapper = json_empty_object;
struct json_object authorization = json_empty_object;
+ struct json_object client_policy = json_null_object();
+ struct json_object server_policy = json_null_object();
int rc = 0;
authorization = json_new_object();
goto failure;
}
+ if (client_audit_info != NULL) {
+ client_policy = json_from_audit_info(client_audit_info);
+ if (json_is_invalid(&client_policy)) {
+ goto failure;
+ }
+ }
+
+ rc = json_add_object(&authorization, "clientPolicyAccessCheck", &client_policy);
+ if (rc != 0) {
+ goto failure;
+ }
+
+ if (server_audit_info != NULL) {
+ server_policy = json_from_audit_info(server_audit_info);
+ if (json_is_invalid(&server_policy)) {
+ goto failure;
+ }
+ }
+
+ rc = json_add_object(&authorization, "serverPolicyAccessCheck", &server_policy);
+ if (rc != 0) {
+ goto failure;
+ }
+
wrapper = json_new_object();
if (json_is_invalid(&wrapper)) {
goto failure;
json_free(&wrapper);
return;
failure:
+ json_free(&server_policy);
+ json_free(&client_policy);
/*
* On a failure authorization will not have been added to wrapper so it
* needs to be freed to avoid a leak.
struct loadparm_context *lp_ctx,
const struct tsocket_address *remote,
const struct tsocket_address *local,
+ const struct authn_audit_info *server_audit_info,
const char *service_description,
const char *auth_type,
const char *domain_name,
{
struct json_object wrapper = json_empty_object;
struct json_object authorization = json_empty_object;
+ struct json_object server_policy = json_null_object();
int rc = 0;
authorization = json_new_object();
goto failure;
}
+ if (server_audit_info != NULL) {
+ server_policy = json_from_audit_info(server_audit_info);
+ if (json_is_invalid(&server_policy)) {
+ goto failure;
+ }
+ }
+
+ rc = json_add_object(&authorization, "serverPolicyAccessCheck", &server_policy);
+ if (rc != 0) {
+ goto failure;
+ }
+
wrapper = json_new_object();
if (json_is_invalid(&wrapper)) {
goto failure;
json_free(&wrapper);
return;
failure:
+ json_free(&server_policy);
/*
* On a failure authorization will not have been added to wrapper so it
* needs to be freed to avoid a leak.
const char *domain_name,
const char *account_name,
struct dom_sid *sid,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info,
enum event_id_type event_id,
int debug_level)
{
const char *auth_type,
const char *transport_protection,
struct auth_session_info *session_info,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info,
int debug_level)
{
log_no_json(msg_ctx, lp_ctx);
struct loadparm_context *lp_ctx,
const struct tsocket_address *remote,
const struct tsocket_address *local,
+ const struct authn_audit_info *server_audit_info,
const char *service_description,
const char *auth_type,
const char *domain_name,
NTSTATUS status,
const char *domain_name,
const char *account_name,
- struct dom_sid *sid)
+ struct dom_sid *sid,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info)
{
/* set the log level */
int debug_level = AUTH_FAILURE_LEVEL;
domain_name,
account_name,
sid,
+ client_audit_info,
+ server_audit_info,
event_id,
debug_level);
}
const char *service_description,
const char *auth_type,
const char *transport_protection,
- struct auth_session_info *session_info)
+ struct auth_session_info *session_info,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info)
{
int debug_level = AUTHZ_SUCCESS_LEVEL;
auth_type,
transport_protection,
session_info,
+ client_audit_info,
+ server_audit_info,
debug_level);
}
}
struct loadparm_context *lp_ctx,
const struct tsocket_address *remote,
const struct tsocket_address *local,
+ const struct authn_audit_info *server_audit_info,
const char *service_description,
const char *auth_type,
const char *domain_name,
log_authz_event_json(msg_ctx, lp_ctx,
remote,
local,
+ server_audit_info,
service_description,
auth_type,
domain_name,
* NOTE: msg_ctx and lp_ctx is optional, but when supplied allows streaming the
* authentication events over the message bus.
*/
+struct authn_audit_info;
void log_authentication_event(struct imessaging_context *msg_ctx,
struct loadparm_context *lp_ctx,
const struct timeval *start_time,
NTSTATUS status,
const char *domain_name,
const char *account_name,
- struct dom_sid *sid);
+ struct dom_sid *sid,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info);
/*
* Log details of a successful authorization to a service.
const char *service_description,
const char *auth_type,
const char *transport_protection,
- struct auth_session_info *session_info);
+ struct auth_session_info *session_info,
+ const struct authn_audit_info *client_audit_info,
+ const struct authn_audit_info *server_audit_info);
/*
* Log details of an authorization to a service.
struct loadparm_context *lp_ctx,
const struct tsocket_address *remote,
const struct tsocket_address *local,
+ const struct authn_audit_info *server_audit_info,
const char *service_description,
const char *auth_type,
const char *domain_name,