def rule(event):
    if all(
        [
            "\\shell\\SentinelOneScan\\command\\" in event.deep_get("TargetObject", default=""),
            not any(
                [
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Details", default="").startswith(
                                        "C:\\Program Files\\SentinelOne\\Sentinel Agent"
                                    ),
                                    event.deep_get("Details", default="").startswith(
                                        "C:\\Program Files (x86)\\SentinelOne\\Sentinel Agent"
                                    ),
                                ]
                            ),
                            "\\SentinelScanFromContextMenu.exe"
                            in event.deep_get("Details", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("Image", default="").endswith(
                                "C:\\Program Files\\SentinelOne\\"
                            ),
                            event.deep_get("Image", default="").endswith(
                                "C:\\Program Files (x86)\\SentinelOne\\"
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
