Skip to content

Conversation

@JefeThePug
Copy link
Contributor

FEATURE/ Bot message listener to prevent users from sending executable or zipped files in message attachments.

FEATURE/ Bot message listener to prevent users from sending executable or zipped files in message attachments.
@Peregrine05
Copy link
Contributor

I think that this should be handled manually on a per-instance basis. Otherwise, this would be blocking all useful files for the slight possibility of malware (which has never even occurred, as far as I remember).

Copy link
Collaborator

@Xarlos89 Xarlos89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple, effective, and a great security feature.

I'd only add more permanent logging in the mod channel, and then it's great.

async def on_message(self, message):
for attachment in message.attachments:
print(f"content type: {attachment.content_type}")
if attachment.content_type in [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Love the idea of blocking lots of different file types, As most of these are not really necessary.

),
delete_after=10,
)
logger.info(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it's good that we log this on the server, but perhaps we should have a more permanent log in the moderation logs to let us know what user, and what file was being uploaded. I'm not sure it would be necessary to actually log the file itself, but if it's a link, that would be useful to know about false positives / positive positives.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add permanent logging here in Mod Logs

@Xarlos89
Copy link
Collaborator

I think that this should be handled manually on a per-instance basis. Otherwise, this would be blocking all useful files for the slight possibility of malware (which has never even occurred, as far as I remember).

As it's configurable, I'd say it's a useful feature. We would almost never allow a random .exe, or ZIP file to be present. We should log the file being removed, and see what false positives come up.
With security it should always be deny default, and let allow what is necessary.

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.

4 participants