Safe Events
A session token on every event of your resources, without touching their code.
#What it is
With the guard installed in a resource, every TriggerServerEvent of that resource carries a session token. An executor or menu firing the event from outside the script has no token and gets blocked. The guard also rate-limits events, rejects invalid arguments and protects exports.
Note
The token secret is not in the code: the server creates a new key for every player in every session.
#Install the guard in every resource
FXServer doesn't let a resource write into others, so the guard is installed with the server stopped, using the installer shipped with BlackShield:
- Windows:
blackshield/tools/instalar-guard.bat(double click) - Linux:
sh blackshield/tools/instalar-guard.sh
Choose 1) Install. It adds one line to each resource's fxmanifest.lua and keeps a copy of the original (fxmanifest.lua.drsbak):
shared_script '@blackshield/lib/shared.lua' -- core lib2) Remove restores everything. If the folder has another name, the line uses that name (see Resource name); lines from older versions (@blackshield/guard/…) are replaced automatically. Then start the server and check in the console:
acguard status#Modes
Start in learn for a few days, then switch to enforce:
acsafe list # events that arrived without a token
acsafe exempt learned # learned events become exceptions
acsafe mode enforce # block and detect| Mode | What it does |
|---|---|
learn | Only logs events without a token |
enforce | Blocks and detects ("Event without token") |
off | Disabled |
#Honeypots
BlackShield registers honeypot events with names menus usually fire. A honeypot is only mounted if its owning resource doesn't exist and no resource on your server uses that event — it never catches a legitimate event.
Something unclear? Open a ticket.