![]() |
|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
I'm looking to set up some kind of mechanism to log all of the URLs that go over my home web connection (and probably do some blocking as well). I had initially considered using a squid proxy, but I recently discovered that relayd can do this! Is this the best route to take, or is there something better to be using?
|
|
||||
![]()
It comes as part of OpenBSD, so there is nothing to install. But note that relayd(8) uses syslog(3) for logging. If you want to record those logs, you will likely want to provision syslog.conf(5) to isolate the messages. See http://openbsd-archive.7691.n7.nabbl...e-td76656.html for a provisioning discussion.
|
|
|||
![]()
Do you need all URL or domain is enough?
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase |
|
|||
![]() Quote:
![]() I'll probably end up settling for just the domains, but I want to be sure to capture those for all http and https traffic. |
|
|||
![]()
One problem with DNS is that browsers have DNS prefetch. But some browsers also have HTTP(S) prefetch as well.
When you log DNS queries you also end up logging all DNS queries. Not only HTTP and HTTPS. You can also log IP addresses of TCP connection destination.
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase |
|
|||
![]()
Now that I think about it, monitoring full URLs might be more what I'm after. I did manage to get relayd working on both http and https, although the browsers are now complaining about cert mismatch, and I'm not sure how to work around that.
My ultimate goal is to filter out all the baddies (ads, tracking, etc) at the gateway level. To that end I've set up a big blacklist on unbound(8), and force all traffic on 53 to my own server via pf. So now I'm interested in setting up some monitoring to see what else might be getting by. I figured a transparent proxy would be a good way to go about that. Or, is there a better option I've not thought of? |
|
||||
![]() Quote:
Quote:
|
|
|||
![]()
Yep, that's how I've set it up.
certs: Code:
/etc/ssl/ca.crt /etc/ssl/127.0.0.1:8443.crt /etc/ssl/private/ca.key /etc/ssl/private/127.0.0.1:8443.key Code:
http protocol httpfilter { return error match request label "URL filtered!" block request quick url "example.com/" value "*" } http protocol tlsfilter { return error match request label "URL filtered!" block request quick url "example.com/" value "*" tls ca key "/etc/ssl/private/ca.key" password "password" tls ca cert "/etc/ssl/ca.crt" } relay httpproxy { listen on 127.0.0.1 port 8080 protocol httpfilter forward to destination } relay tlsproxy { listen on 127.0.0.1 port 8443 tls protocol tlsfilter forward with tls to destination } Code:
pass in quick log on $int_ifs inet proto { tcp udp } from $wired_if:network to port 53 rdr-to $wired_if:0 pass in log on $int_ifs inet proto tcp from $wired_if:network to port www divert-to localhost port 8080 pass in log on $int_ifs inet proto tcp from $wired_if:network to port https divert-to localhost port 8443 Last edited by beavers; 14th February 2019 at 03:35 PM. |
|
|||
![]()
Is there some trick I'm missing to get things rewritten so that the cert appears to a browser to be valid?
|
|
|||
![]()
Yeah, that's definitely what's happening. How would I get a cert that's CA-approved for a host on a private IP? Hoping to avoid having to import the cert manually on each and every browser that crosses my network.
|
|
||||
![]()
One way might be via letsencrypt.org, a free certificate service operated by the ISRG. It requires you to have an on-the-Internet web server to obtain the certificate and key, and is designed to renew automatically. See the acme-client(1) man page.
Once you have the cert and key acquired at your public web server, you may be able to copy the pair to your private server, replacing it every with every 60-90 day renewal. However I expect you would also require a split-horizon DNS, so that the private server resolves correctly for those browsers using it. |
|
||||
![]()
Well, in reading up on relayd this evening in preparation for initial testing, I have learned that this is what most organizations that use TLS inspection tools actually do. They distribute their private CA certificates to all clients.
|
|
||||
![]()
I've tested TLS acceleration. Not much to accelerate, as http(8) was listening on a loopback address on the same test system. TLS inspection works fine. However password prompts from the back end web server pop up a cleartext warning, as the back end server was using cleartext. I may be able to remove this with header modification, which would mean more testing.
I'm able to move my key pair from system to system, as long as the IP address resolves at the calling client system (such as with an /etc/hosts entry or a non-authoritative DNS server). I can uses my key pair with relayd. My CA will confirm OCSP queries issued by the browser, because the certificate is valid. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gnome keeps logging me out - screen res? | jwood | OpenBSD General | 4 | 20th April 2018 02:40 AM |
Doas has logging? | cpaulette | OpenBSD General | 1 | 13th March 2016 10:24 AM |
dnsspoof logging issue | joostvgh | OpenBSD Security | 5 | 19th January 2010 12:04 AM |
pflog not logging. | bsdnewbie999 | OpenBSD General | 9 | 13th March 2009 11:19 PM |
spamd logging question | roundkat | OpenBSD General | 10 | 11th June 2008 01:27 PM |