46 Commits

Author SHA1 Message Date
Johan Wikman
f6731a898d Update change date 2019-11-13 08:37:17 +02:00
Johan Wikman
fdfbf3e133 Update 2.4.3 change date 2019-11-05 12:21:00 +02:00
Johan Wikman
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
Johan Wikman
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
Esa Korhonen
6edbd52324 MXS-2642 Do not re-test a pam-service for a given user
Because of how the user-data was read, the same service name could be
found multiple times if the user-search query matched multiple rows. Now
the service names are read to a set, which ignores duplicates. The same
service may be attempted again if the authentication fails and user-data
is fetched again.
2019-09-04 17:31:10 +03:00
Esa Korhonen
0996b9217a MXS-2544 Check roles in PAM authenticator
Also re-adds anonymous user support.
2019-07-16 11:36:11 +03:00
Esa Korhonen
d0e18b165a MXS-2544 Use separate sqlite tables for user authentication data
The data is now split into three tables similar to the server.
2019-07-16 10:59:15 +03:00
Esa Korhonen
f752f139ba MXS-2544 Add utility class for handling SQLite
Preparation and cleanup for adding more data to handle user roles in PAM
authenticator.
2019-07-16 10:58:47 +03:00
Marko
e45dcb6d8a Merge branch '2.3' into 2.4 2019-07-05 10:39:03 +03:00
Marko
edbbafc2e9 MXS-2502 Fix access denied when connecting to 'information_schema' 2019-07-05 10:37:31 +03:00
Esa Korhonen
5dca53f877 Merge branch '2.4.0' into 2.4 2019-06-28 17:58:01 +03:00
Esa Korhonen
3b39d42d3b Merge branch '2.3' into 2.4 2019-06-27 18:56:25 +03:00
Esa Korhonen
166d26ff13 Avoid using SQLITE_OPEN_URI
Centos6 uses a very old version of SQLite without support for URI filenames.
PAM authenticator must use a file-based database.

Commit cherry-picked to 2.4.0 from 2.3.
2019-06-27 15:18:49 +03:00
Esa Korhonen
d8790fa3e7 Merge branch '2.2' into 2.3 2019-06-27 14:20:42 +03:00
Esa Korhonen
b4289224de Avoid using SQLITE_OPEN_URI
Centos6 uses a very old version of SQLite without support for URI filenames.
PAM authenticator must use a file-based database.
2019-06-27 13:59:05 +03:00
Johan Wikman
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
Johan Wikman
2ab9aa9a94 Update 2.4.0 Change Date 2019-06-25 09:19:55 +03:00
Esa Korhonen
cf866a6a57 Merge branch '2.2' into 2.3 2019-06-14 10:49:51 +03:00
Esa Korhonen
acfaae9d46 MXS-2480 Use in-memory-database in PAM authenticator
This was already fixed in develop, but the fix is both small and useful
so should be backported.
2019-06-13 17:47:08 +03:00
Esa Korhonen
442d8bed9a MXS-2479 Add username and host to PAM authenticator log messages 2019-05-29 17:32:27 +03:00
Esa Korhonen
bed28db3fd Merge branch '2.3' into develop 2019-05-24 13:55:47 +03:00
Esa Korhonen
a1697e2aa6 MXS-2479 PAMBackendAuth is more tolerant of extra messages.
The authenticator can now receive additional questions from the server even
after the original password-query.
2019-05-24 11:31:55 +03:00
Esa Korhonen
bd8aa64547 MXS-2479 Accept additional messages in PAM authenticator
Plugins may send additional messages during authentication. These messages
often contain notifications such as password expiration dates. Both the client
and backend side authenticators now handle such messages. The messages are not
sent to the user, only the log. The requirement that only "Password: " is queried
still stands.
2019-05-23 14:14:25 +03:00
Marko
004e8e638f MXS-2480 Fix creating of the in memory sqlite3 databases in PAMAuth
SQLITE_OPEN_URI flag was missing causing the databases to be created in
disk instead of in memory. Also added info level log message from created
database in clustrixmonitor.
2019-05-20 09:11:58 +03:00
Markus Mäkelä
6625c1296b
Format authenticator and protocol modules 2019-05-10 10:31:12 +03:00
Esa Korhonen
74634abc80 MXS-1662 Move PAM authentication function into maxbase
The same code can be used for REST-API authentication.
2019-04-09 14:41:40 +03:00
Esa Korhonen
48a6ab503e MXS-2292 PAM authenticator detects anonymous users with defined hosts
This allows anonymous user mapping from well-defined hosts.
2019-02-19 10:40:23 +02:00
Markus Mäkelä
26da72a41f
Merge branch '2.2' into 2.3 2019-01-03 09:23:16 +02:00
Markus Mäkelä
04dd05b262
MXS-2231: Move TLS handshake code into MariaDBClient
The code is now in the correct place and TLS connections with all
authenticators should now work.
2019-01-02 19:29:41 +02:00
Markus Mäkelä
75ea1b6ea1
Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
Markus Mäkelä
d11c78ad80
Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Johan Wikman
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Johan Wikman
d0c74b5c8f MXS-421 Log event in case of authentication failure
- CDC authenticator
- MySQL authenticator
- PAM authenticator
2018-06-18 11:32:50 +03:00
Esa Korhonen
4b988d99a1 Print error descriptions when a PAM function fails 2018-05-14 12:35:54 +03:00
Esa Korhonen
cb0ac44e1f MXS-1758 Support anonymous user with proxy grant for PAM
This allows using user group mapping with PAM authenticator.
2018-04-24 15:22:01 +03:00
Esa Korhonen
04666b4b31 MXS-1716 Add diagnostic functions to PAM Authenticator
The functions print the user information. Normal version just prints
user@host, the json-version prints the whole array.
2018-03-19 11:02:14 +02:00
Esa Korhonen
e918810a4f MXS-1604: PAMAuth Use "mysql" as default service name, fix authentication data updating
If a user has an empty service name, use "mysql" as default.

Authentication data was only updated inside get_pam_user_services() if no service
was found. It was possible that the PAM service changed but the old service
would be used for authenticating, causing a false negative.

Now, the auth data is updated outside the function if authentication fails for
any reason. The new service data is compared to the old and if equal, password
check is not attempted again. This gives a false negative only if user password
has changed after the previous attempt.

Also, fixed some comments.
2018-01-26 11:00:04 +02:00
Esa Korhonen
c45a8abc20 Use SQLITE_OPEN_NOMUTEX for session specific sqlite3 handles in PAM auth 2018-01-04 10:55:52 +02:00
Markus Mäkelä
895d950da0 Format all source files with Astyle
Formatted all source files Astyle.
2017-09-28 07:04:21 +03:00
Esa Korhonen
2784858495 A few PAM cleanups
Print header found message only if libraries also found.
Change header guards to pragma once.
Check return value of store_client_password().
2017-08-16 13:47:29 +03:00
Esa Korhonen
7ba0533cc8 Authenticator API extract-entrypoint returns bool
Extraction either succeeds or fails, it does not need to return
defined integer values.
2017-08-09 17:28:58 +03:00
Esa Korhonen
ed05d24a9a Move SSL-code in mysql_auth.c and pam_client_session.cc to
a separate function in ssl.cc

Removes some duplicate code.
2017-08-07 12:22:59 +03:00
Esa Korhonen
8ef8ee6600 Add client-to-MaxScale SSL support to PAM authenticator
Only client-side SSL is supported for now.
2017-08-07 12:22:59 +03:00
Esa Korhonen
7488129afc PAM code cleanup & refactor
Divided functionality into classes, fixed comments +
various other cleanup. BackenAuth no longer increments
sequence on sending password. SQLite busy timeout shortened
to 1 second.
2017-08-07 12:22:59 +03:00