Commit 5294d807 authored by Zeke Hendrickson's avatar Zeke Hendrickson
Browse files

Monitor authentication over port 465 as well

parent d1bf858d
......@@ -10,16 +10,21 @@ parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', required=True)
parser.add_argument('-H', '--host', default='127.0.0.1')
parser.add_argument('-P', '--port', default=25)
parser.add_argument('-t', '--tls', action='store_true')
args = parser.parse_args()
try:
server = smtplib.SMTP('{}:{}'.format(args.host, args.port))
server.starttls()
dest = '{}:{}'.format(args.host, args.port)
if args.tls:
server = smtplib.SMTP_SSL(dest)
else:
server = smtplib.SMTP(dest)
server.starttls()
server.login(args.username, os.environ.get('SMTP_PASSWORD'))
server.quit()
print('Authentication Successful')
sys.exit(0)
except smtplib.SMTPAuthenticationError as e:
except (smtplib.SMTPAuthenticationError, smtplib.SMTPNotSupportedError) as e:
print('Authentication Failed')
print(e)
sys.exit(2)
......
......@@ -556,6 +556,21 @@
- influxdb_event
<<: *sensu_auth
- name: Monitor simta authentication on port 465
sensu.sensu_go.check:
name: simta-smtp-auth-465
command: check-smtp-auth -u simta --tls --port 465
interval: 60
publish: true
env_vars:
SMTP_PASSWORD: "{{ lookup('flowerysong.hvault.kv', 'simta/ldap_password').value }}"
subscriptions:
- Class_authn_relay
handlers:
- influxdb_event
<<: *sensu_auth
- name: Monitor IP reputation
sensu.sensu_go.check:
name: dnsbl
......@@ -625,8 +640,8 @@
- name: Monitor simta auth aggregate
sensu.sensu_go.check:
name: simta-smtp-auth-aggregate
command: check-aggregate -H {{ influxdb_server }} --check simta-smtp-auth
name: "{{ item }}-aggregate"
command: check-aggregate -H {{ influxdb_server }} --check {{ item }}
stdin: true
interval: 60
publish: true
......@@ -639,6 +654,9 @@
dashboard_host: dashboard.{{ aws_region }}.{{ subd }}
fatigue_check/occurrences: 2
<<: *sensu_auth
loop:
- simta-smtp-auth
- simta-smtp-auth-465
when: "'authn-relay' in aws_region_layout[aws_status][aws_region]"
- name: Monitor rbldnsd
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment