Commit graph

11 commits

Author SHA1 Message Date
David Fifield
c124e8c643 In server, treat a client IP address of 0.0.0.0 as missing.
Some proxies currently send ?client_ip=0.0.0.0 because of an error in
how they attempt to grep the address from the client's SDP. That's
inflating our "%d/%d connections had client_ip" logs. Instead, treat
these cases as if the IP address were absent.
https://bugs.torproject.org/33157
https://bugs.torproject.org/33385
2020-02-22 16:13:17 -07:00
David Fifield
20ac2029fd Have websocketconn.New return a pointer.
This makes the return type satisfy the io.ReadWriteCloser interface
directly.
2020-01-30 10:18:23 -07:00
David Fifield
e47dd5e2b4 Remove some redundancy in websocketconn naming.
Rename websocketconn.WebSocketConn to websocketconn.Conn, and
       websocketconn.NewWebSocketConn to websocketconn.New

Following the guidelines at
https://blog.golang.org/package-names#TOC_3%2e
2020-01-30 10:18:23 -07:00
Cecylia Bocovich
dabdd847ce Expanded snowflake server tests
Now tests the proxy and initServer functionalities. The tests use the
same websocket library as the server and proxy-go implementations.
2019-12-06 11:28:41 -05:00
Cecylia Bocovich
49042511a3 Refactored server log scrubber into package
The server log scrubbing code from ticket #21304 is now refactored into
a safelog package, along with the appropriate tests
2019-04-11 14:43:59 -04:00
Cecylia Bocovich
611cb889c5 Made regular expressions more precise
Modified regular expressions to not scrub fingerprints, but catch all
instances of IPv4 and IPv6 addresses. Expanded test cases with those
suggested by dcf.
2019-03-25 15:06:17 -04:00
Cecylia Bocovich
c6a4a4191f Modified log scrubber to handle split lines
Log scrubber now scrubs addresses even in the case where they are split
across calls to the scrubber's output io.Writer.

Added test cases to test that the writer behaves correctly across split
lines.
2019-03-25 15:06:08 -04:00
Cecylia Bocovich
1ea467c4cf Restructured scrubbing code and tests
It is now more readable, and the regexp's are only compiled once
2019-03-25 15:05:58 -04:00
Cecylia Bocovich
5bc8817028 Simplified log scrubber
IPv6 regexes didn't need to be that precise, added more tests for
edge-cases.
2019-03-25 15:05:47 -04:00
Cecylia Bocovich
f586a4bab8 Sanitize IP addresses from server log output
Added a scrubber that takes all logging output to the standard logger
and passes through a series of regular expressions to replace IP
addresses with safe strings (e.g., X.X.X.X:443).

Ensure server logs to stdout are also scrubbed
2019-03-25 15:05:31 -04:00
David Fifield
1ef6211c6c Rough tests for the clientAddr function. 2017-10-17 22:13:56 -07:00