def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") in [4657, 4656, 4663],
            any(
                [
                    "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\microphone\\NonPackaged"
                    in event.deep_get("ObjectName", default=""),
                    "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\webcam\\NonPackaged"
                    in event.deep_get("ObjectName", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
