fix: add authorization checks to admin-level CBA server events#95
Conversation
CBA server events can be triggered by any client via CBA_fnc_serverEvent. This adds access control to prevent unauthorized players from controlling recording (record, pause, exportData) or setting focus ranges (setFocusStart, setFocusEnd). Authorization allows: - Server-local execution (remoteExecutedOwner == 0) for mission scripts - Clients with OCAP admin controls (Arma server admins or players in OCAP_administratorList) Data recording events (customEvent, counterEvent) remain unrestricted as they are designed to be called from any mission script.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the security posture of admin-level server events by introducing robust authorization checks. It prevents unauthorized clients from triggering sensitive actions such as recording control or data export, ensuring that only server-local scripts or authenticated administrators can execute these commands. Additionally, it includes new documentation outlining the design and implementation plan for an upcoming feature that will allow mission makers to define focus ranges directly via script. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces important authorization checks for several admin-level CBA server events, effectively addressing a potential security vulnerability. The implementation is clean and robust, correctly distinguishing between server-local and remote calls, and leveraging an existing admin control flag for remote callers. The checks are consistently applied to all relevant events (record, pause, exportData, setFocusStart, setFocusEnd) while correctly leaving other events unrestricted. The code is well-written and handles edge cases like disconnected players gracefully. The pull request also includes new design and implementation plan documents for the script-side focus feature, providing context for some of the secured events. Overall, the changes are excellent and I have no suggestions for improvement.
Summary
remoteExecutedOwner+OCAP_hasAdminControlsauthorization checks to 5 admin-level CBA server events:record,pause,exportData,setFocusStart,setFocusEndremoteExecutedOwner == 0) always allowedOCAP_administratorList)customEvent,counterEvent) remain unrestricted — designed to be called from any mission scriptContext
CBA_fnc_serverEventcan be called from any client, meaning any player could trigger admin actions like stopping recording or forcing an export. This adds access control using the existingOCAP_hasAdminControlsvariable already managed byfnc_adminUIcontrol.sqf.Test plan
remoteExecutedOwner == 0) can still call all eventsCBA_fnc_serverEvent) still work for Arma adminscustomEventandcounterEventremain callable by any client