def rule(event):
    if all(
        [
            event.deep_get("TargetFilename", default="").endswith(".lnk"),
            any(
                [
                    ".doc." in event.deep_get("TargetFilename", default=""),
                    ".docx." in event.deep_get("TargetFilename", default=""),
                    ".jpg." in event.deep_get("TargetFilename", default=""),
                    ".pdf." in event.deep_get("TargetFilename", default=""),
                    ".ppt." in event.deep_get("TargetFilename", default=""),
                    ".pptx." in event.deep_get("TargetFilename", default=""),
                    ".xls." in event.deep_get("TargetFilename", default=""),
                    ".xlsx." in event.deep_get("TargetFilename", default=""),
                ]
            ),
            not "\\AppData\\Roaming\\Microsoft\\Windows\\Recent\\"
            in event.deep_get("TargetFilename", default=""),
            not any(
                [
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\excel.exe"),
                                    event.deep_get("Image", default="").endswith("\\powerpnt.exe"),
                                    event.deep_get("Image", default="").endswith("\\winword.exe"),
                                ]
                            ),
                            "\\AppData\\Roaming\\Microsoft\\Office\\Recent\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\excel.exe"),
                            "\\AppData\\Roaming\\Microsoft\\Excel"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\powerpnt.exe"),
                            "\\AppData\\Roaming\\Microsoft\\PowerPoint"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\winword.exe"),
                            "\\AppData\\Roaming\\Microsoft\\Word"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
