Skip to content

Commit

Permalink
squid: ssl bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
samcday committed Jul 2, 2024
1 parent 5f82790 commit ebb8f10
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 4 deletions.
11 changes: 9 additions & 2 deletions ignition/base.bu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ passwd:
- systemd-journal
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFwawprQXEkGl38Q7T0PNseL0vpoyr4TbATMkEaZJTWQ
storage:
files:
- path: /etc/squid/ca.pem
overwrite: true
contents:
# cryptme
inline: ENC[AES256_GCM,data:IlOWwFg+G7/Bx+8w0TOAcCZGaIEApzKQItxW94ZFXaqS+RoLbWzQmowllmYHpxPu2NrIJHa4eg0VO2waCkjo3dOCcKIrT1VWkXNnGPJWV1Uk45D6e3VaQv3E5pFpw5xh3HPNmeASXbFkiC8LGD1rz02JEDp54TovAnlOFwz+5YYFJdKwgPnG0FeCYbxW27S0XBNPCde73jlIHwYHni6flJyUVB0y28/l/w5oRPimFhxwkznLucpBpeDNIblpAY7ZnShOhKqwEHAtYz4dZ3NCn3SWjFhB9kzWK+QNluce/GVGIuWnCN54xZQKYbpOTtBt90ekLmDz06OFuVXdDLHctFztzbYct4S8Mj9ZJsdM6+v1ocwLjDaeZTpnvw2zG/m8XeSWbyL/Xt46Lrm476bz/aOLSw7lR/xhWFBs19epn8rOV+iHesmKNwTDglHq+4Ht0bRCW/qjlSWxIvODkNyd1vL+epRyE0gkXG7J7Vku4EBuQXyE9yg4tnhIZ2LAm9vYWxKlDfUYDuk2hjOPAgq6ktqbzH/E5N3Gr4K8KVqZVVX5AY55L9Pm+jx3ZUeWAhoQtL7iHupJbIgIRr2hWxxtVhX9gg69d6Llan6XByoVGdBGzZrkisAlu16/KZYYVvdiOVCTLlLimrchGSagAip7cILaJEvzeBnWOBUP2sIMwLaR/KozwLRp4+SYD4umBGY5BIdge1lnw9UL+qrCE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k=,tag:0ZwVW6nvSZ0xrkjrUqmWUA==,type:str]
systemd:
units:
- name: init-rebase.service
Expand Down Expand Up @@ -60,8 +67,8 @@ sops:
Z1BrNWZudm5VV3R3SzdFSDB2VzdERHcK6iFxAbKL16w2H/lD12R5SKsQ82M8dESk
nn0/+f/sSy32vZX3W+8pSHVWRw9YnNOHRhD8tzipvE16DPhLRP4iZw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-07-02T10:52:32Z"
mac: ENC[AES256_GCM,data:Ue7ambVpjlMCJ7ybL/f48krKGxgVJrzostdLxM1GFflLbe0U1fE4typcUu/QBD4GW/XfAbgAdMGIjB/COgMeWbwO/BQi+vaOJrf4Vn82ky1ZaRTp7CXmlE7sTT1vsuzlglwHfJQphT0h+9fckxoPCKw6ap/AzOz+pkbxS9d3Nx8=,iv:uUxrApdoRTAllTTBY22+q44BK0qd2+OkMLDo1wEcV1o=,tag:f0o2UiG+8No4EE01VGWXHQ==,type:str]
lastmodified: "2024-07-02T14:32:05Z"
mac: ENC[AES256_GCM,data:nW0oSrlXTaUE86J+/DUMsGTtxBjGMJR7YsKCOMfMTsAf/iFPCUeari/BSmif+lPB95gQ99LK5rviUDV3z3e+vS51Btj39Xkw1r3UDW24G3wFGDhAbKE9InjPaWoOUYDtoRuFaGaqrBwnyMeZufUHCIBLNBpA8RkV4HLj5lg/NPM=,iv:ApRLJXeoRbaiXvtzKfcAsmI+3ZPXr2T+TyRMS6wNYfQ=,tag:zDbffvr/bLbacRIhBd898g==,type:str]
pgp: []
encrypted_comment_regex: cryptme
version: 3.9.0
2 changes: 0 additions & 2 deletions node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ COPY usr/ /usr
RUN chmod 700 /etc/kubeadm.conf.d && \
ostree container commit

RUN echo 'include /etc/squid/conf.d/*.conf' >> /etc/squid/squid.conf

# enable services
RUN systemctl enable \
containerd.service \
Expand Down
1 change: 1 addition & 0 deletions node/etc/squid/conf.d/ssl-bump.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssl_bump bump all
88 changes: 88 additions & 0 deletions node/etc/squid/squid.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# This default configuration only allows localhost requests because a more
# permissive Squid installation could introduce new attack vectors into the
# network by proxying external TCP connections to unprotected services.
http_access allow localhost

# The two deny rules below are unnecessary in this default configuration
# because they are followed by a "deny all" rule. However, they may become
# critically important when you start allowing external requests below them.

# Protect web applications running on the same server as Squid. They often
# assume that only local users can access them at "localhost" ports.
http_access deny to_localhost

# Protect cloud servers that provide local users with sensitive info about
# their server via certain well-known link-local (a.k.a. APIPA) addresses.
http_access deny to_linklocal

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# For example, to allow access from your local networks, you may uncomment the
# following rule (and/or add rules that match your definition of "local"):
# http_access allow localnet

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128 ssl-bump \
cert=/etc/squid/ca.pem \
generate-host-certificates=on dynamic_cert_mem_cache_size=4MB

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

include /etc/squid/conf.d/*.conf

0 comments on commit ebb8f10

Please sign in to comment.