PHP 8.3.31
Preview: hosting_smart_advice_api.py Size: 624 B
/proc/self/root/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/myimunify/advice/hosting_smart_advice_api.py

import json
import logging

from defence360agent.utils import CheckRunError, check_run

logger = logging.getLogger(__name__)

EXECUTABLE = "cl-hosting-smart-advice"
APP_NAME = "imunify"


async def sync_advices(advices):
    payload = json.dumps(advices)
    try:
        out = await check_run(
            [EXECUTABLE, "sync", "--app", APP_NAME, "--json", payload]
        )
    except CheckRunError as e:
        logger.warning(
            "Failed to sync advices with `cl-hosting-smart-advice`: %s", e
        )
        return False
    else:
        result = json.loads(out)
        return result.get("success", False)

Directory Contents

Dirs: 1 × Files: 4

Name Size Perms Modified Actions
- drwxr-xr-x 2026-06-08 20:23:14
Edit Download
6.20 KB lrw-r--r-- 2026-05-26 21:20:44
Edit Download
1.74 KB lrw-r--r-- 2026-05-26 21:20:44
Edit Download
624 B lrw-r--r-- 2026-05-26 21:20:44
Edit Download
0 B lrw-r--r-- 2026-05-26 21:20:44
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).