Does PAM Work with IDS?
Posted in 2006
Topics: High Availability & Replication, Connectivity: ODBC / JDBC / .NET, Security, Permissions & Auditing, Platform-Specific Issues
We're currently trying to develop a pam server for 10.00.UC4 using CSDK 2.90.UC3 and running over FC4 with kernel 2.6.14. The intention was to use this for application level authentication to try to stop remote clients accessing via ODBC-enabled clients such as Microsoft Access, Excel etc. We would have been happy to use pam_rps (rock, paper, scissors) on the pam server side and get the client to respond accordingly but we're getting blkpool assertion failures constantly. So we put together a small server that sends a fixed challenge and expects a fixed response. At first, this also was giving us blkpool assertion failures but got a bit better when the pam configuration file was amended to include account and password entries besides the auth entry as follows: auth required /lib/security/pam_test.so account required /lib/security/pam_test.so password required /lib/security/pam_test.so BTW. The pam implementation is through /etc/pam.d as opposed to /etc/pam.conf. We had to add the following functions to the server to get this working: PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; } PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; } Now we're at a stage where we're only getting block pool assertion errors on failed access attempts only and this usually on the second attempt. Assuming some memory leak, the server was reduced to the following lines of code: #include <sqlhdr.h> #include <sqliapi.h> #ifndef LINUX #include <security/pam_appl.h> #endif /* LINUX */ #define PAM_SM_AUTH #include <security/pam_modules.h> #include <syslog.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define _XOPEN_SOURCE #include <unistd.h> PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc,const char **argv) {return PAM_AUTH_ERR;} PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc,const char **argv) {return PAM_SUCCESS;} PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc,const char **argv) {return PAM_SUCCESS;} PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh,int flags,int argc,const char **argv) {return PAM_SUCCESS;} which basically fails all challenge attempts. Running against this also breaks the database server! What have we missed?