def rule(event):
    if all(
        [
            any(
                [
                    "ntds_capi_" in event.deep_get("TargetFilename", default=""),
                    "ntds_legacy_" in event.deep_get("TargetFilename", default=""),
                    "ntds_unknown_" in event.deep_get("TargetFilename", default=""),
                ]
            ),
            any(
                [
                    event.deep_get("TargetFilename", default="").endswith(".cer"),
                    event.deep_get("TargetFilename", default="").endswith(".key"),
                    event.deep_get("TargetFilename", default="").endswith(".pfx"),
                    event.deep_get("TargetFilename", default="").endswith(".pvk"),
                ]
            ),
        ]
    ):
        return True
    return False
