def rule(event):
    if any(
        [
            event.deep_get("Image", default="").endswith("/lastlog"),
            "'x:0:'" in event.deep_get("CommandLine", default=""),
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("/cat"),
                            event.deep_get("Image", default="").endswith("/ed"),
                            event.deep_get("Image", default="").endswith("/head"),
                            event.deep_get("Image", default="").endswith("/more"),
                            event.deep_get("Image", default="").endswith("/nano"),
                            event.deep_get("Image", default="").endswith("/tail"),
                            event.deep_get("Image", default="").endswith("/vi"),
                            event.deep_get("Image", default="").endswith("/vim"),
                            event.deep_get("Image", default="").endswith("/less"),
                            event.deep_get("Image", default="").endswith("/emacs"),
                            event.deep_get("Image", default="").endswith("/sqlite3"),
                            event.deep_get("Image", default="").endswith("/makemap"),
                        ]
                    ),
                    any(
                        [
                            "/etc/passwd" in event.deep_get("CommandLine", default=""),
                            "/etc/shadow" in event.deep_get("CommandLine", default=""),
                            "/etc/sudoers" in event.deep_get("CommandLine", default=""),
                            "/etc/spwd.db" in event.deep_get("CommandLine", default=""),
                            "/etc/pwd.db" in event.deep_get("CommandLine", default=""),
                            "/etc/master.passwd" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            event.deep_get("Image", default="").endswith("/id"),
            all(
                [
                    event.deep_get("Image", default="").endswith("/lsof"),
                    "-u" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
