/*1* Copyright (c) 2004, 2005 Darren Tucker. All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions5* are met:6* 1. Redistributions of source code must retain the above copyright7* notice, this list of conditions and the following disclaimer.8* 2. Redistributions in binary form must reproduce the above copyright9* notice, this list of conditions and the following disclaimer in the10* documentation and/or other materials provided with the distribution.11*12* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR13* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES14* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.15* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,16* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT17* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,18* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY19* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT20* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF21* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.22*/2324#ifndef _SSH_AUDIT_H25# define _SSH_AUDIT_H2627#include "loginrec.h"2829struct ssh;3031enum ssh_audit_event_type {32SSH_LOGIN_EXCEED_MAXTRIES,33SSH_LOGIN_ROOT_DENIED,34SSH_AUTH_SUCCESS,35SSH_AUTH_FAIL_NONE,36SSH_AUTH_FAIL_PASSWD,37SSH_AUTH_FAIL_KBDINT, /* keyboard-interactive or challenge-response */38SSH_AUTH_FAIL_PUBKEY, /* ssh2 pubkey or ssh1 rsa */39SSH_AUTH_FAIL_HOSTBASED, /* ssh2 hostbased or ssh1 rhostsrsa */40SSH_AUTH_FAIL_GSSAPI,41SSH_INVALID_USER,42SSH_NOLOGIN, /* denied by /etc/nologin, not implemented */43SSH_CONNECTION_CLOSE, /* closed after attempting auth or session */44SSH_CONNECTION_ABANDON, /* closed without completing auth */45SSH_AUDIT_UNKNOWN46};47typedef enum ssh_audit_event_type ssh_audit_event_t;4849void audit_connection_from(const char *, int);50void audit_event(struct ssh *, ssh_audit_event_t);51void audit_session_open(struct logininfo *);52void audit_session_close(struct logininfo *);53void audit_run_command(const char *);54ssh_audit_event_t audit_classify_auth(const char *);5556#endif /* _SSH_AUDIT_H */575859