feat(inventory): Add ESET Antivirus inventory support across macOS, Linux, and Windows - #1212
Merged
g-bougard merged 29 commits intoJul 31, 2026
Merged
Conversation
- Implement MacOS::AntiVirus::ESET submodule to detect ESET Endpoint Security and ESET Endpoint Antivirus bundles in /Applications
- Add launchctl (com.eset.protection), daemon binary (startd), and settings.json (RTFSEnabled) validation for accurate ENABLED status reporting on macOS
- Update MacOS::License and Linux::AntiVirus::EEA to extract ESET Public ID into LICENSEINFOS and harmonize product names by removing OS suffixes ('for macOS/Linux/Windows') to match SOFTWARES inventory
- Add dynamic product name fallback resolution from bundle path when Product name is omitted from lic status output
- Enhance Win32::License to query 64-bit registry hive first before falling back to Wow6432Node
- Add comprehensive unit tests and mock resources for ESET inventory across all supported platforms
- Implement MacOS::AntiVirus::ESET submodule to detect ESET Endpoint Security and ESET Endpoint Antivirus bundles in /Applications
- Add launchctl (com.eset.protection), daemon binary (startd), and settings.json (RTFSEnabled) validation for accurate ENABLED status reporting on macOS
- Update MacOS::License and Linux::AntiVirus::EEA to extract ESET Public ID into LICENSEINFOS and harmonize product names by removing OS suffixes ('for macOS/Linux/Windows') to match SOFTWARES inventory
- Add dynamic product name fallback resolution from bundle path when Product name is omitted from lic status output
- Enhance Win32::License to query 64-bit registry hive first before falling back to Wow6432Node
- Add comprehensive unit tests and mock resources for ESET inventory across all supported platforms
…t/glpi-agent into feat-antivirus-eset
g-bougard
requested changes
Jul 30, 2026
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
eduardomozart
commented
Jul 30, 2026
eduardomozart
left a comment
Contributor
Author
There was a problem hiding this comment.
I've just pushed a new commit to address your points:
Linux License Segregation & %params
- Reverted the
%paramsinjection inLinux::AntiVirus::EEA::_getEEAInfoto keep it clean, relying just onlogger. - Completely separated the ESET License logic from the AntiVirus inventory. I've created a dedicated
Linux::Licensemodule and aLinux::License::EEAsubmodule, mirroring the architecture you suggested.
Windows Refactoring
- Added
InstallDirto the mocked registry.regfile (with proper UTF-16LE encoding) soermm.execorrectly dynamically resolves its install path during the inventory sweep. - Removed the manual
SOFTWARE/ESET/...nested hash traversal inWin32::Licensethat was polluting the core code. It now relies cleanly on the leaf node passed directly fromloadRegistryDumpduring test mocks.
macOS Polish & Fixes
- Implemented your suggested parsing loop using
empty($line)fromGLPI::Agent::Toolsacross both the Linux and macOS license parser loops. - Fixed a bug where
lic -statuswas accidentally passed instead oflic --status, restoring the proper extraction of the "Expiration Date". - Fixed a bug where
getAllLineswas mutating the%paramsarguments incorrectly, ensuringENABLEDparses active protection properly again.
General Cleanup
- Addressed all trailing whitespaces, duplicate variable declarations, and syntax issues. The full test suite (
t/03var.t,t/07whitespaces.t, and all unit tests) is passing completely green locally.
g-bougard
requested changes
Jul 31, 2026
g-bougard
left a comment
Member
There was a problem hiding this comment.
here we are also next to a merge.
I still see few required optimization and syntax quirks to fix.
Can check my comments ?
Thank you
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
g-bougard
requested changes
Jul 31, 2026
g-bougard
left a comment
Member
There was a problem hiding this comment.
Test is failing on windows. It seems you made a mistake on _test_date in macos eset av test.
Check my comments below.
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
Co-authored-by: Guillaume Bougard <gbougard@teclib.com>
… InstallDir When the ESET InstallDir registry key is not available, the code now falls back to %ProgramFiles% and %ProgramFiles(x86)% environment variables before using the hardcoded C:\Program Files path. This handles cases where ESET is installed on a non-default drive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Overview
This pull request introduces comprehensive inventory and license detection support for ESET Endpoint Security and ESET Endpoint Antivirus across macOS, Linux, and Windows. It also harmonizes product naming across all three operating systems to ensure consistent inventory reporting entries on GLPI Server.
🚀 Key Changes
🍎 macOS Support (New & Enhanced)
MacOS::AntiVirus::ESET):/Applications/.ENABLED): Verifies active protection by combining two reliable checks:GLPI::Agent::XMLto read/Library/LaunchDaemons/com.eset.protection.plist, extract the daemon execution binary (startd), and verify it is running in process lists viagetProcesses. If the plist cannot be read, it safely falls back to checking$basepath/startd./Library/Application Support/ESET/Security/var/confd/settings.jsonusingCpanel::JSON::XSto verify that real-time file system protection (RTFSEnabled) is active (ce_val == 1).lic --statusand calculates an up-to-date heuristic by evaluating detection engine modules fromupd --list-modules.[ "$basepath/upd", "--list-modules" ]) to prevent shell word splitting on bundle paths containing spaces.Product name:is omitted from command outputs.MacOS::License):Public IDfromlic --statusand populates theLICENSEINFOSinventory section.🐧 Linux & 🪟 Windows Support
MacOS::License,Linux::AntiVirus::EEA): Automatically strips OS-specific product suffixes (e.g.," for macOS"," for Linux"," for Windows") when creatingLICENSEINFOSentries. This ensures the license name exactly matches theSOFTWARESinventory and its Windows counterpart.Win32::License): Updated registry traversal to prioritize native 64-bit registry paths (HKLM\SOFTWARE\...) before falling back toWow6432Nodewhen querying ESET license GUIDs and Publisher data.🧪 Testing & Verification
All unit test suites and mock resources have been updated and verified across isolated environments without warnings:
t/tasks/inventory/macos/antivirus/eset.t— Verifies ESET macOS inventory parsing, plist XML handling, JSON settings evaluation, and dynamic bundle fallbacks.t/tasks/inventory/macos/license-eset.t— Verifies macOS ESET license extraction and suffix stripping.t/tasks/inventory/linux/antivirus/eea.t— Verifies Linux EEA inventory and license suffix stripping.t/tasks/inventory/windows/license.t— Verifies Windows 64-bit/32-bit registry license lookup.