Skip to content

Implement security logging for various events - #19

Merged
Adammatthiesen merged 2 commits into
mainfrom
security-logging
Oct 19, 2026
Merged

Adammatthiesen merged 2 commits into
mainfrom
security-logging

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request introduces a comprehensive security logging system to the Global Ban mod, allowing important administrative and player actions to be logged for audit and monitoring purposes. The changes add a configurable security log feature, ensure that key events (such as punishing/unpunishing players, configuration reloads, and login attempts) are logged, and provide structured log messages for each action. Additionally, the configuration now allows enabling or disabling security logging.

Security logging feature:

  • Added a new securityLoggingEnabled configuration option in ServerConfig, defaulting to enabled, to control whether security logs are recorded. [1] [2]
  • Introduced the securityLog(String message) method in GlobalBanCommon to centralize security log creation, respecting the config flag.

Security log integration for key events:

  • Updated event handler methods to call .logSecurity() on event objects, ensuring that punishments, unpunishments, and clear punishment actions are logged with detailed messages. [1] [2] [3] [4]
  • Added security log calls to command actions such as reload, force sync, import, and list punishments, logging the player and action performed. [1] [2] [3] [4]
  • Added security log when a player views punishment details in the menu.

Event and record enhancements for logging:

  • Implemented .logSecurity() and toSecurityLogString() methods in event records (PunishPlayerEvent, UnPunishPlayerEvent, ClearPunishmentEvent, CanPlayerLogin.Post) to generate structured log messages for each event type. [1] [2] [3] [4] [5]

Other improvements:

  • Improved startup and shutdown logging for the mod. [1] [2]
  • Updated API sync log messages to include an [API SYNC] prefix for clarity. [1] [2]

These changes provide robust auditing capabilities, making it easier for server administrators to monitor important actions and improve overall security.

@Adammatthiesen
Adammatthiesen marked this pull request as ready for review October 19, 2026 05:08
@Adammatthiesen
Adammatthiesen merged commit 3783e43 into main Oct 19, 2026
1 check passed
@Adammatthiesen
Adammatthiesen deleted the security-logging branch October 19, 2026 05:08
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.

1 participant