Fail2Ban not blocking failed postfix login under plesk - iptables

I have plesk 12.0.18 Update #96
OS: Ubuntu 14.04.3 LTS
i have installed fail2ban through plesk and for some reason it's not blocking failed attempt on postfix server.
Dec 20 08:34:53 website postfix/smtpd[6696]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:34:56 website postfix/smtpd[27244]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:35:00 website postfix/smtpd[7415]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:35:32 website postfix/smtpd[6582]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:35:35 website postfix/smtpd[29514]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:35:41 website postfix/smtpd[6582]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:03 website postfix/smtpd[6582]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:06 website postfix/smtpd[6696]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:09 website postfix/smtpd[27244]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:15 website postfix/smtpd[6696]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:21 website postfix/smtpd[6696]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:24 website postfix/smtpd[27244]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
Dec 20 08:36:27 website postfix/smtpd[6696]: warning: unknown[37.216.243.35]: SASL LOGIN authentication failed: authentication failure
i had to block this ip myslef through iptables -I when i'm checking the logs of fail2ban there is nothing there that even show an attempt to block the ip.

found it. there was a problem with the filter that didnt match it + the rule for ip table was wrong for some reason. and that was the default installation.

Related

Freeradius authenticate windows ad username and password failed while testing thru wifi setup

Trying to authenticate windows AD username and password by freeradius thru NTLM auth.
while testing ntlm auth in freeradius machine, got success message.
ntlm_auth --request-nt-key --domain=MPLradius --username=Administrator --
password=abc#123456789
NT_STATUS_OK: Success (0x0)
While trying thru wifi , got below error
[chap] login attempt by "sophosadmin#mplradius.local" with CHAP password
[chap] Cleartext-Password is required for authentication
++[chap] = invalid
+} # group CHAP = invalid
Failed to authenticate the user.
expand: BLACK -> BLACK
Login incorrect (rlm_chap: Clear text password not available):
[sophosadmin#mplradius.local/<CHAP-Password>] (from client x.x.x.x port 2149580837
cli xx:xx:xx:xx:xx:xx) BLACK
Using Post-Auth-Type Reject
Could you help me sort out this error.

sssd Error: Could not start TLS encryption. (unknown error code)

I am trying to configure Linux machine authentication with Google secure LDAP, adding the steps below that I have done
Added the LDAP client with below permission:
Access permission: Entire Domain
Read user information: Entire Domain
Read group information: ON
Installed SSSd in my Ubuntu box(which is running in Azure)
sudo apt install -y sssd sssd-tools
My sssd.conf file
[sssd]
debug_level = 7
services = nss, pam
domains = mydomain.com
[pam]
debug_level = 7
[nss]
debug_level = 7
[domain/mydomain.com]
debug_level = 7
cache_credentials = true
ldap_id_use_start_tls = true
ldap_tls_cacertdir = /home/ubuntu/ssl_Linux
ldap_tls_cacert = /home/ubuntu/ssl_Linux/gldap.crt
ldap_tls_cert = /home/ubuntu/ssl_Linux/gldap.crt
ldap_tls_key = /home/ubuntu/ssl_Linux/gldap.key
ldap_uri = ldaps://ldap.google.com:636
ldap_search_base = ou=Users,dc=mydomain,dc=com
ldap_group_name = uniqueMember
id_provider = ldap
auth_provider = ldap
ldap_schema = rfc2307bis
ldap_user_uuid = entryUUID
ldap_groups_use_matching_rule_in_chain = true
ldap_initgroups_use_matching_rule_in_chain = true
enumerate = false
Here I'm able to start the SSSD service bt getting the below error
Nov 15 09:14:54 myserver systemd[1]: Started System Security Services Daemon.
Nov 15 09:14:55 myserver sssd[be[67530]: Could not start TLS encryption. (unknown error code)
Nov 15 09:16:11 myserver sssd[be[67530]: Could not start TLS encryption. (unknown error code)
Nov 15 09:16:11 myserver sssd[be[67530]: Backend is offline
Nov 15 09:17:19 myserver sssd[be[67530]: Could not start TLS encryption. (unknown error code)
Nov 15 09:19:48 myserver sssd[be[67530]: Could not start TLS encryption. (unknown error code)
Nov 15 09:24:02 myserver sssd[be[67530]: Could not start TLS encryption. (unknown error code)
FYI: I'm able to successfully authenticate with the google secure LDAP using below command
LDAPTLS_CERT=mycrt.crt LDAPTLS_KEY=mykey.key ldapsearch -H ldaps://ldap.google.com:636 -b "ou=Users,dc=mydomain,dc=com" -D "my.user#mydomain.com" "(uid=my.user)" -W
Refrance: https://helpcenter.itopia.com/en/articles/2394004-configuring-google-cloud-identity-ldap-on-ubuntu-16-04-for-user-logins
Please help me on this,
Thanks :)
I had same issue.
adding ldap_tls_cipher_suite = NORMAL:!VERS-TLS1.3 to sssd.conf file worked for me. I am on Ubuntu 20.04.5 LTS
I had tried the same document with the new Virtual-Machine, It works fine for me.
Just need to make sure after configuring google LDAP client in http://admin.google.com/ portal may take up to 24 hours to take effect.
Thanks

SSL connection fails to Datapusher app through port 8800, with NGINX reverse proxy to Apache

I am installing the datapusher service for CKAN.
CKAN has been configured to use an NGINX reverse proxy that routes client requests, following instructions here. SSL certificate is installed and configured in NGINX.
When trying to use the datapusher app to upload a file, it fails and Apache log gives this error:
Mon Apr 03 13:49:10.979179 2017] [:error] [pid 15468] 2017-04-03 13:49:10,979 CRITI [ckanext.datapusher.plugin] {'status_code': 403, 'message': 'An Error occurred while sending the job: 403 Client Error: Forbidden', 'details': u'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\\n<html><head>\\n<title>403 Forbidden</title>\\n</head><body>\\n<h1>Forbidden</h1>\\n<p>You don\\'t have permission to access /job\\non this server.</p>\\n<hr>\\n<address>Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 8800</address>\\n</body></html>\\n'}
When testing access to the datapusher's 8800 port through openssl this is the output:
[Mon Apr 03 13:49:10.981049 2017] [:error] [pid 15468] [remote 127.0.0.1:6855] Error - <type 'exceptions.TypeError'>: notify() takes exactly 3 arguments (2 given)
open:/etc/ckan> openssl s_client -connect 127.0.0.1:8800
CONNECTED(00000003)
140385459791520:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 275 bytes
The datapusher docs give a workaround for bypassing SSL here, using the SSL_Verify config. I tried this and there was no change.
I think that I need to either:
1. Force the nginx reverse proxy to allow SSL connections through port 8800 (in addition to 443). Or...
2. Configure ckan/datapusher/apache/nginx to bypass SSL/https on port 880.
Any suggestions?
I believe the 403 error is at the point that CKAN sends a request to DataPusher to ask it to load a particular resource. DataPusher is running on Apache only and thus is on HTTP (not HTTPS) so there should be no issue with SSL. Check your CKAN config is the default:
ckan.datapusher.url = http://127.0.0.1:8800/
DataPusher's SSL_VERIFY setting is for a later request - when datapusher makes a request to CKAN at ckan.site_url, which for you will go via nginx over HTTPS. You may need this setting, depending on whether the SSL in your python is compatible. Reading the code it suggests you need quotes and make sure the key is all caps. i.e. in your datapusher_settings.py:
SSL_VERIFY = 'False'

what is pam_unix in syslogs?

If I am authenticating using PAM, is it a standard/best practice to use pam_unix in syslog tags? Who added pam_unix in below log: vsftpd process or the PAM module itself which was used in authentication?
For example-
Feb 25 13;01:14 hostname vsftpd(pam_unix)[10561]: authentication failure : logname= uid== euuid=0 tty= ruser= rhost=a.b.c.d user=ron
The pam_unix module logs this. See modules/pam_unix/support.c in the pam library sources.

openldap and root password

I recently changed my root password, but when I restart Ldap (openldap-2.2.13) I couldn't log in with Ldap users to any application that is on this server.
in /var/log/httpd/ssl_error_log I can find a lot of error like:
[Tue Jun 01 02:27:24 2010] [warn] [client 89.138.98.214] [26762] auth_ldap authenticate: user foo authentication failed; URI /svn-clients/clients/myclient/ [LDAP: ldap_simple_bind_s() failed][Can't contact LDAP server]
I guess there is a linkage between user root and the Ldap configuration, I also changed the
rootpw entry in slapd.conf, but this doesn't seem to make things better.
The server is not running. I would restart on the commandline and immediately check for error messages in /var/log/daemon.log