def rule(event):
    if all(
        [
            "Set-MpPreference" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "-LowThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-ModerateThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-HighThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-SevereThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-ltdefac " in event.deep_get("CommandLine", default=""),
                    "-mtdefac " in event.deep_get("CommandLine", default=""),
                    "-htdefac " in event.deep_get("CommandLine", default=""),
                    "-stdefac " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "Allow" in event.deep_get("CommandLine", default=""),
                    "6" in event.deep_get("CommandLine", default=""),
                    "NoAction" in event.deep_get("CommandLine", default=""),
                    "9" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
