Forum Discussion
Chad_Roberts_21
Nimbostratus
Jul 16, 2007Log IMAP user name
Any ideas on how I might go about writing an iRule which would log the user name given each time a user authenticates? I need to log the source IP and the username for correlating connections later. Obviously the IP is the easy part.
I've got only a small idea where to start. We use IMAP-SSL, but I've used tcpdump with ssldump to find the following text string I'd like to match on somehow:
hkvs LOGIN "[username]" "[password]"
Any ideas on how I could search for the text "LOGIN" and then log whatever comes in between, say, the next to spaces? Sorry for being so vague. I'm kinda at a loss here.
- Deb_Allen_18Historic F5 AccountIf you are decrypting traffic @ LTM, you should be able to collect and examine the TCP data using the "TCP::collect" command. (Click here)
- Eric_van_Wilten
Nimbostratus
I would like to do something similar. The problem is, when terminating IMAP-SSL at the BigIP, TCP::collect get's the encrypted traffic. Is there a way to do something similar to a TCP::collect that collects the decrypted payload instead? - Colin_Walker_12Historic F5 AccountWhen you say you're "terminating" the IMAP-SSL connection at the LTM, do you mean actually terminating the SSL at the LTM? If you've got a clientSSL profile set up to actually decrypt the SSL at the LTM, which is what Deb was referring to, then TCP::collect should be able to capture plain-text data just fine.
- Eric_van_Wilten
Nimbostratus
Thanks Colin, but for whatever reason, that doesn't appear to be happening. I am, indeed, terminating the SSL at the LTM with a plain-text connection to the server pool. I'm using a very basic iRule: - Colin_Walker_12Historic F5 AccountI'd try moving your collect to the CLIENTSSL_HANDSHAKE event, instead of CLIENT_ACCEPTED, to ensure that the collection of data actually occurs after the handshake has been completed.
- Eric_van_Wilten
Nimbostratus
Yes, I had tried using CLIENTSSL_HANDSHAKE before and it didn't seem to make a difference. - bl0ndie_127134Historic F5 AccountTCP runs below SSL. You will need to use the stream filter to do the replacement.
- Eric_van_Wilten
Nimbostratus
Thanks bl0ndie. - bl0ndie_127134Historic F5 AccountSince your expression is static, I would suggest that you configure the expression in the stream profile. Regexp compilation is a tad bit expensive to be doing it per connection (which is what happens in STREAM::expression). Otherwise it looks like you are on the right track.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects