def rule(event):
    if all(
        [
            "chown root" in event.deep_get("CommandLine", default=""),
            any(
                [
                    " chmod u+s" in event.deep_get("CommandLine", default=""),
                    " chmod g+s" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
