Skip to content

logstf: Scrub IPs from logs + use HTTPS#54

Merged
F2 merged 2 commits into
F2:masterfrom
Arie:master
Jul 2, 2026
Merged

logstf: Scrub IPs from logs + use HTTPS#54
F2 merged 2 commits into
F2:masterfrom
Arie:master

Conversation

@Arie

@Arie Arie commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Due to a recent incident, not directly related to logs.tf, I realized it could be nice to make these two small changes to the logs.tf uploader:

  • Redact IP addresses before uploading (mask last two octets)
  • Add cvar logstf_https to upload over HTTPS (default off)

- Redact IP addresses before uploading (mask last two octets)
- Add cvar logstf_https to upload over HTTPS (default off)
@F2

F2 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

I think a previous "upload extension" (SteamTools) didn't support https, and that's why we used http. But we don't use that anymore, and I assume both SteamWorks and cURL support https.

How about we always use https with no http fallback?

@Arie

Arie commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Yeah I'm all for enabling https by default, both curl and steamworks support it. I didn't enable it by default only because the curl extension might be too old for the logs.tf TLS version/crypto or a missing CA bundle. But for that second one, cert checking/verification is explicitly disabled on the curl path of the anyhttp functions anyway.

@F2

F2 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Made a few minor updates:

  • Upped the size of ipPattern from 128 to 256 because your regex pattern was more than 128 characters which failed the regex compilation during startup.
  • Prefer [0-9] over \d because at least in some regex languages \d can be other digit characters than the ones in [0-9]. I am not sure if that is the case in SourceMod, but no need to risk it.
  • Always uses HTTPS now.
  • I did some benchmarking to see if the regex had any negative effects, but it seems fine.

Let me know if you have any concerns before we complete the PR.

@Arie

Arie commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Sorry man, I must have messed up checking my latest regex, thought I did judging by git timestamps and my fork timestamp but I guess I didn't do it correctly.

Looks good to me for shipping.

@F2

F2 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

No worries! 😄 Your code changes were very robust so it didn't actually break anything, other than the IP scrubbing being skipped.

I tested that HTTPS upload works with both SteamWorks and curl on my machine, so we're good to go.

@F2 F2 changed the title logstf: Scrub IPs from logs, add HTTPS cvar logstf: Scrub IPs from logs + use HTTPS Jul 2, 2026
@F2
F2 merged commit 2be8d34 into F2:master Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants