Least Privilege
The general setup described in the installation section is suitable for most servers. However, it does come with drawbacks:
- Granting the ADMINISTRATORpermission violates the concept of least privilege, which is important for server security, especially for a security-focused bot.
- With no roles higher than the shield bot's role, only the server owner can make rate limit and bot whitelist changes. This choice comes from the desire to mitigate the damage potential of a rogue admin, but if you want a group of trusted individuals to be able to make configuration changes to the bot, you will need to keep the shield role below their role.
To address the first point, we suggest taking a look at all commands and features of Shield that you intend to use, and only grant those permissions to the bot. Every feature and slash commands is documented with the exact permissions that the command requires. As a general rule, we recommend granting at least the following permissions:
- ATTACH_FILESfor server exports
- BAN_MEMBERSfor rate limit remediation and certain slash commands
- KICK_MEMBERSfor bot protection
- MANAGE_GUILD_EXPRESSIONSto edit and delete emojis
- MANAGE_ROLESfor rate limit remediation and certain slash commands
- VIEW_AUDIT_LOGto pick up rate limit events
Addressing the second point is as easy as moving the shield role down. Be careful as these users will be able to bypass the protection that Shield provides.