Automod - Commonly Flagged Words - Sensitive Information
To improve the safety and privacy in Discord, it would be beneficial to add pre-set patterns to the Automod - Commonly Flagged Words feature, which would automatically detect and block sensitive information from being shared on the platform. This would simplify the process for users and help prevent the accidental sharing of sensitive data such as E-mail addresses, IP addresses, phone numbers, social security numbers, and physical addresses and other types of sensitive information.
While I've manually implemented some regular expressions to accomplish this task, not all users are familiar with regular expressions, and there may be flaws in the ones I've created.
Those are mine:
- E-mail: (^|\s)[a-zA-Z0-9-_\.]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-_]{2,4}\b
- IPv4: ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
- Credit Card numbers: \b(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11})\b
-
SSNs: \b[0-9]{3}-[0-9]{2}-[0-9]{4}\b
Those may not work as expected:
- Addresses (1): ^\d+\s+([a-zA-Z]+|[a-zA-Z]+\s[a-zA-Z]+)\s+(street|st|avenue|ave|road|rd|boulevard|blvd|lane|ln|drive|dr|court|ct|circle|cir|way|pl|place)\.?\s*((apt|apartment|ste|suite|#)\s*[0-9a-zA-Z-]+)?\s*,?\s*([a-zA-Z]+\s*){2}\s*\d{5}(-\d{4})?$
- Addresses (2): ^\s*\d+\s*(?:(?:[a-zA-Z]{2,}\b\.?)|(?:[a-zA-Z]{2,}\s[a-zA-Z]{2,}\b\.?))\s*(?:\d{1,2}[a-zA-Z]{2})?\s*$
-
I love this idea!
0 -

Great regex lol
Totally an IP address. Also local IPv4's cannot be accessed from the outside so that should be included in the regex.
Adding to this, what even is dangerous about sending an IPv4 address on Discord?
Whenever you visit a website or use a service online you throw your IP address in every direction...0 -

Doesn't match :)0 -
The email regex does match emails. Try it out on https://rustexp.lpil.uk/ which is the tester Discord provides themselves.
But that's exactly why this feature needs to be implemented.
Cause as I quote "and there may be flaws in the ones I've created"0
Zaloguj się, aby dodać komentarz.
Komentarze
Komentarze: 4