def rule(event):
    if all(
        [
            event.deep_get("TargetFilename", default="").endswith(".pfx"),
            not any(
                [
                    all(
                        [
                            event.deep_get("Image", default="")
                            in [
                                "C:\\Program Files\\Microsoft OneDrive\\OneDrive.exe",
                                "C:\\Program Files (x86)\\Microsoft OneDrive\\OneDrive.exe",
                            ],
                            event.deep_get("TargetFilename", default="").endswith(
                                "\\OneDrive\\CodeSigning.pfx"
                            ),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("TargetFilename", default="").startswith(
                                "C:\\Program Files (x86)\\Microsoft Visual Studio\\"
                            ),
                            event.deep_get("TargetFilename", default="").startswith(
                                "C:\\Program Files\\Microsoft Visual Studio\\"
                            ),
                        ]
                    ),
                    event.deep_get("TargetFilename", default="").startswith(
                        "C:\\Program Files\\CMake\\"
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
