import json


def rule(event):
    if all(
        [
            any(
                [
                    "${jndi:ldap:/" in json.dumps(event.to_dict()),
                    "${jndi:rmi:/" in json.dumps(event.to_dict()),
                    "${jndi:ldaps:/" in json.dumps(event.to_dict()),
                    "${jndi:dns:/" in json.dumps(event.to_dict()),
                    "/$%7bjndi:" in json.dumps(event.to_dict()),
                    "%24%7bjndi:" in json.dumps(event.to_dict()),
                    "$%7Bjndi:" in json.dumps(event.to_dict()),
                    "%2524%257Bjndi" in json.dumps(event.to_dict()),
                    "%2F%252524%25257Bjndi%3A" in json.dumps(event.to_dict()),
                    "${jndi:${lower:" in json.dumps(event.to_dict()),
                    "${::-j}${" in json.dumps(event.to_dict()),
                    "${jndi:nis" in json.dumps(event.to_dict()),
                    "${jndi:nds" in json.dumps(event.to_dict()),
                    "${jndi:corba" in json.dumps(event.to_dict()),
                    "${jndi:iiop" in json.dumps(event.to_dict()),
                    "Reference Class Name: foo" in json.dumps(event.to_dict()),
                    "${${env:BARFOO:-j}" in json.dumps(event.to_dict()),
                    "${::-l}${::-d}${::-a}${::-p}" in json.dumps(event.to_dict()),
                    "${base64:JHtqbmRp" in json.dumps(event.to_dict()),
                    "${${env:ENV_NAME:-j}ndi${env:ENV_NAME:-:}$" in json.dumps(event.to_dict()),
                    "${${lower:j}ndi:" in json.dumps(event.to_dict()),
                    "${${upper:j}ndi:" in json.dumps(event.to_dict()),
                    "${${::-j}${::-n}${::-d}${::-i}:" in json.dumps(event.to_dict()),
                ]
            ),
            not any(
                [
                    "w.nessus.org/nessus" in json.dumps(event.to_dict()),
                    "/nessus}" in json.dumps(event.to_dict()),
                ]
            ),
        ]
    ):
        return True
    return False
