REDROOM
PHP 7.4.33
Path:
Logout
Edit File
Size: 2.34 KB
Close
/home/godevadmin/public_html/upload_images/home/000~ROOT~000/lib/fm-agent/countermeasures/plugins/CountermeasureScriptHelper.py
Text
Base64
""" FortiMonitor Countermeasure script helper - base class to allow easy setup of standalone scripts to run as a countermeasure. Copyright 2023 Fortinet, Inc. All Rights Reserved. fm-ops@fortinet.com To use, create a subclass of CountermeasureScriptHelper and define the following properties: - name - A human-readable name for the countermeasure - textkey - A unique textkey describing the countermeasure - command: The command line to execute - description: Optional longer description of what the plugin does - capture_output: True or False value of whether to report the full output of the script For example: class TmpUsageCountermeasure(CountermeasureScriptHelper): name = "/tmp disk usage" textkey = "disk.tmp_usage" description = "Get the total usage of hte /tmp partition" command = "df -u /tmp" capture_output = True """ from CountermeasurePlugin import CountermeasurePlugin class CountermeasureScriptHelper(CountermeasurePlugin): wall_announce_delay = None max_frequency = None max_runtime = None sudo_requirements = [] author = "support@panopta.com" # The command to execute as part of the countermeasure - needs to be overridden in inheriting classes command = None # Whether to capture the output of the script and report as the result of the countermeasure capture_output = True def validate(self): problems = [] if self.name == "Base Countermeasure": problems.append("Missing name definition") if self.textkey == "base": problems.append("Missing textkey definition") if self.command is None: problems.append("Missing command definition") if self.capture_output not in (True, False): problems.append("Invalid value for capture_output") return problems and ", ".join(problems) or None def run(self): if self.command is None: self.log.error( "No command specified for %s Countermeasure" % self.__class__.__name__ ) return return_code, output = self.execute(self.command) if self.capture_output: self.save_text_output(output) else: self.save_text_output( "Completed execution of %s Countermeasure" % self.__class__.__name__ ) self.save_return_code(return_code)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CountermeasureLogHelper.py
2.32 KB
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CountermeasurePlugin.py
3.66 KB
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CountermeasureScriptHelper.py
2.34 KB
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
disk_cm.py
656 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dmesg.py
626 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
netstat.py
637 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
reboot.py
844 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sample.py
1.88 KB
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ServiceRestartHelper.py
4.87 KB
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
top.py
800 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
users_cm.py
648 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
vmstat.py
601 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
598 B
lrw-r--r--
2025-06-18 20:44:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).