def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("EventID", default="") == 4657,
                    event.deep_get("ObjectName", default="").endswith(
                        "\\SOFTWARE\\Microsoft\\.NETFramework"
                    ),
                    event.deep_get("ObjectValueName", default="") == "ETWEnabled",
                    event.deep_get("NewValue", default="") == 0,
                ]
            ),
            all(
                [
                    event.deep_get("EventID", default="") == 4657,
                    "\\Environment" in event.deep_get("ObjectName", default=""),
                    event.deep_get("ObjectValueName", default="")
                    in ["COMPlus_ETWEnabled", "COMPlus_ETWFlags"],
                    event.deep_get("NewValue", default="") == 0,
                ]
            ),
        ]
    ):
        return True
    return False
