diff --git a/doc/html/howtoe.html b/doc/html/howtoe.html index 9d49696..5921ccf 100644 --- a/doc/html/howtoe.html +++ b/doc/html/howtoe.html @@ -32,6 +32,7 @@
+ SNI proxy can be used to transparently redirect any TLS traffic with external router or local redirection rules. It can also be used + to extract hostnames from TLS to use in ACLs in combination with SOCKS or HTTP(s) proxy and/or Transparent plugin. It can also be used to require TLS or mTLS between services. TLS hadshake contains no + port information, if tlspr is used as a standalone service, destination port may be either detected with Transparent plugin or configured with -P option (default 443). +
+ -c option is used to specify level of TLS check: +
+0 (default) - allow non-TLS traffic +1 - require TLS, only check client HELLO packet +2 - require TLS, check both client and server HELLO +3 - require TLS, check server send certificate (not compatible with TLS 1.3) +4 - require mutual TLS, check server send certificate request and client sends certificate (not compatible with TLS 1.3) ++
+configuration examples: +1. port 1443 may be used to redirect traffic to destination port 143). SNI is used to find destination host +
+tlspr -p1443 -P443 -c1 ++2. used as parent tls to detect destination hostname from TLS in socks +
+allow * * * 80 +parent 1000 http 0.0.0.0 0 +allow * * * * CONNECT +parent 1000 tls 0.0.0.0 0 +deny * * some.not.allowed.host +allow * +socks +
diff --git a/doc/html/howtor.html b/doc/html/howtor.html index 3cdee45..abb7f37 100644 --- a/doc/html/howtor.html +++ b/doc/html/howtor.html @@ -33,6 +33,7 @@
+ + SNI proxy может быть использовать для транспарентного перенаправления любого TLS трафика (например HTTPS) на внешнем маршрутизаторе + или локальными правилами. Так же можно использовать его для извлечения имени хоста из TLS хендшейка с целью логгирования или использования в ACL. + Еще одна задача которую может решать модуль - требование наличия TLS или mTLS (mutual TLS). + Если tlspr используется как отдельный сервис без исползования плагина Transparent, то необходимо задать порт назначения через опцию -T (по умолчанию 443), + т.к. TLS хендшейк не содержит информации о порте назначения. +
+ -c контролирует уровень требования к TLS: +
+0 (по умолчанию) - пропустить трафик без TLS +1 - требовать TLS, проверять наличие client HELLO +2 - требовать TLS, проверять наличие client и server HELLO +3 - требовать TLS, проверять наличие серверного сертификата (не совместим с TLS 1.3+) +4 - требовать взаимный (mutual) TLS, проверять что сервер запрашивает сертификат и клиент его отправляет (не совместим с TLS 1.3+) ++
+примеры конфигурации: +1. Порт 1443 можно использовать для перенаправления в него HTTPS трафика по порту 443 (например с внешнего маршрутизатора) +
+tlspr -p1443 -P443 -c1 ++2. tlspr используется как родительский прокси в SOCKS чтобы обнаруживать реальный hostname назначения (даже если запрашивается подклюение по IP адресу) +
+allow * * * 80 +parent 1000 http 0.0.0.0 0 +allow * * * * CONNECT +parent 1000 tls 0.0.0.0 0 +deny * * some.not.allowed.host +allow * +socks ++ +
Во-первых, для ограничения доступа необходимо указать внутренний интерфейс, diff --git a/man/3proxy.cfg.3 b/man/3proxy.cfg.3 index cdeef48..042da67 100644 --- a/man/3proxy.cfg.3 +++ b/man/3proxy.cfg.3 @@ -80,9 +80,18 @@ HTTP/HTTPS proxy (default port 3128) .B socks SOCKS 4/4.5/5 proxy (default port 1080) .br +.B tlspr +SNI proxy (destination address is taken from TLS handshake), may be used to redirect any TLS-based traffic +.br +.B auto +Proxy with protocol autoselection between proxy / socks / tlspr +.br .B pop3p POP3 proxy (default port 110) .br +.B smtpp +SMTP proxy (default port 25) +.br .B ftppr FTP proxy (default port 21) .br diff --git a/man/tlspr.8 b/man/tlspr.8 new file mode 100644 index 0000000..1974254 --- /dev/null +++ b/man/tlspr.8 @@ -0,0 +1,86 @@ +.TH tlspr "8" "May 2024" "3proxy 0.9" "Universal proxy server" +.SH NAME +.B tlspr +\- SNI proxy gateway service +.SH SYNOPSIS +.BR "tlspr " [ -d ][ -a ] +.IB \fR[ -l \fR[ \fR[ @ \fR] logfile \fR]] +.IB \fR[ -p listening_port\fR] +.IB \fR[ -P destination_port\fR] +.IB \fR[ -c tls_check_level\fR] +.IB \fR[ -i internal_ip\fR] +.IB \fR[ -e external_ip\fR] +.SH DESCRIPTION +.B proxy +is SNI gateway service (destination host is taken from TLS handshake). Destination port must be specified via -P option (or it may be detected with Transparent plugin). +.SH OPTIONS +.TP +.B -I +Inetd mode. Standalone service only. +.TP +.B -d +Daemonise. Detach service from console and run in the background. +.TP +.B -t +Be silenT. Do not log start/stop/accept error records. +.TP +.B -u +Never ask for username authentication +.TP +.B -e +External address. IP address of interface proxy should initiate connections +from. +By default system will deside which address to use in accordance +with routing table. +.TP +.B -i +Internal address. IP address proxy accepts connections to. +By default connection to any interface is accepted. It\'s usually unsafe. +.TP +.B -a +Anonymous. Hide information about client. +.TP +.B -a1 +Anonymous. Show fake information about client. +.TP +.B -p +listening_port. Port proxy listens for incoming connections. Default is 1443. +.TP +.B -P +destination_port. Port to establish outgoing connections. One is required unless Transparent plugin is not used because TLS handshake does not contain port information. Default is 443. +.TP +.B -c +TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to pass, 1 - require TLS, only check client HELLO packet, 2 - require TLS, check both client and server HELLO, 3 - require TLS, check server send certificate (not compatible with TLS 1.3), 4 - require mutual TLS, check server send certificate request and client sends certificate (not compatible with TLS 1.3) +.TP +.B -l +Log. By default logging is to stdout. If +.I logfile +is specified logging is to file. Under Unix, if +.RI \' @ \' +preceeds +.IR logfile , +syslog is used for logging. +.TP +.B -S +Increase or decrease stack size. You may want to try something like -S8192 if you experience 3proxy +crashes. +.SH CLIENTS +You should use client with HTTP proxy support or configure router to redirect +HTTP traffic to proxy (transparent proxy). Configure client to connect to +.I internal_ip +and +.IR port . +HTTPS support allows to use almost any TCP based protocol. If you need to +limit clients, use +.BR 3proxy (8) +instead. +.SH BUGS +Report all bugs to +.BR 3proxy@3proxy.org +.SH SEE ALSO +3proxy(8), ftppr(8), proxy(8), socks(8), pop3p(8), smtpp(8), tcppm(8), udppm(8), syslogd(8), +.br +https://3proxy.org/ +.SH AUTHORS +3proxy is designed by Vladimir 3APA3A Dubrovin +.RI ( 3proxy@3proxy.org )