Debian Codegraph @

notes/ssl_mitm

raw
1 The SSL MITM option allows https sites to be content checked.
2
3 The request from the client is intercepted, a spoofed certificate supplied for
4 the target site and an encrypted connection made back to the client.
5 A separate encrypted connection to the target server is set up. The resulting
6 http dencrypted stream is then filtered as normal.
7
8 Sites in the exception lists are treated in the same way as before
9 (i.e. NOT unencrypted) so sites dealing with sensistive information that should
10 not be intercepted (e.g. bank finance, account logins, etc) and other sites
11 deemed 'safe' can be made exempt from being examined.
12
13 Advantages are that the user gets a proper block page and full https urls are
14 logged, https urls can be whitelisted when site as a whole is banned and content
15 can be content checked.
16
17 Disavantages are that in order for MITM to be usable a private root CA
18 certificate has to be installed on each browser and that more processing power
19 is needed on the server in order to encrypt and unencrypt the traffic.
20
21 Note that full HTTPS MITM requires a lot more CPU power.
22
23 To set up MITM:
24
25 Configure and compile e2guardian with the --enable-sslmitm flag set
26
27 Before generating your certs and keys check that your openssl.conf file
28 has the following in the ca section:-
29
30 basicConstraints=critical,CA:TRUE
31
32 Generate your certicates and keys:-
33
34 Generate a key for the rootCA
35
36 openssl genrsa 4096 > private_root.pem
37
38 Generate the root CA certificate
39
40 openssl req -new -x509 -days 3650 -sha256 -key private_root.pem \
41 -out my_rootCA.crt
42
43 Create a DER format version of root certificate
44
45 openssl x509 -in my_rootCA.crt -outform DER -out my_rootCA.der
46
47 Generate a key for use with upstream SSL conections
48
49 openssl genrsa 4096 > private_cert.pem
50
51 Copy the my_rootCA.crt and my_rootCA.der to a web server so that your users
52 can download them.
53
54 Create a directory call generatedcerts to store the generated certificates:-
55 This directory must be writable by the e2guardian user
56
57 Assign cert and key paths in e2guardian.conf:-
58
59 cacertificatepath = '/usr/local/etc/e2guardian/my_rootCA.crt'
60 caprivatekeypath = '/usr/local/etc/e2guardian/private_root.pem'
61 certprivatekeypath = '/usr/local/etc/e2guardian/private_cert.pem'
62
63 generatedcertpath = '/usr/local/etc/e2guardian/generatedcerts'
64
65 Set enablessl = on in e2guardian.conf
66 Set sslmitm = on in e2guardianfx.conf
67
68 Load my_rootCA certificate on each browser.
69
70 On the browser Set both http proxy and https proxy to the same port
71 defined in the option filterports, if you use e2guardian as direct proxy.
72 The transparenthttpsport is only for transparent https proxying.