Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically redact sensitive information from log files #1

Open
jellysquid3 opened this issue Aug 6, 2021 · 5 comments
Open

Automatically redact sensitive information from log files #1

jellysquid3 opened this issue Aug 6, 2021 · 5 comments
Labels
area: bots Issue is about automation via bots on Discord and GitHub good first issue Good for newcomers

Comments

@jellysquid3
Copy link
Member

Sometimes, users will upload JVM crash logs, and these unfortunately contain the full list of arguments passed to the Java process. This can include the user's access token, which could allow malicious actors to play the game under their account for a short while.

We should either improve our issue reporting process to explain how to redact this information manually, or otherwise set up a small bot with our GitHub/Discord to automatically scan crash logs for sensitive information.

An example of the access token being leaked through the JVM crash log can be found below.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000001a1c254ba80, pid=12692, tid=14452
#
...[snipped]...
Command Line: -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump [..snipped..] --uuid 6307f1759b8c4e00bda5e6a989e624c4 --accessToken d2h5ZGlkeW91dHJ5dG9yZXZlcnNldGhpcw...
@jellysquid3 jellysquid3 added good first issue Good for newcomers area: bots Issue is about automation via bots on Discord and GitHub labels Aug 6, 2021
@AnalogCyan
Copy link

AnalogCyan commented Aug 7, 2021

On the Discord side of things, it would be fairly easy to implement the functionality of auto-redacting --accessToken strings in a bot with discord.py by doing something along these lines (assuming the log is sent as text and not a file):

if "--accessToken" in message.content:
	msg = message.content
	await message.delete()
	matches = [i for i, x in enumerate(msg) if x == "--accessToken"]
	for match in matches:
		msg[match+1] = "[REDACTED]"
	[...]

@CatThingy
Copy link

If there isn't a pre-existing bot that you would prefer this functionality to be added to, I've implemented this in a bot that can also repeat canned responses.

@derspyy
Copy link

derspyy commented May 14, 2023

is this still needed?

@derspyy
Copy link

derspyy commented May 15, 2023

made a simple discord bot: derspyy/accesstoken-redact-bot.

@derspyy
Copy link

derspyy commented May 23, 2023

regarding a github integration, you can edit a comment and delete the edit history, but i don't know if a bot can do it through the rest api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bots Issue is about automation via bots on Discord and GitHub good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants