Castle is found in the Contingency Plan DLC.
Castle 2.0 is found in the Contingency Plan DLC.
Castle is somewhat weaker than Rubiks since it only affects one device. Like Rubiks, it can be mitigated by hacking other devices first; on the other hand, triggering Castle early in a mission is often fine because of the chance it hits a device you don't need to hack. Even if Castle does hit a device you need to hack, you should be fine as long as you have an efficient way break high firewalls such as Hammer, Parasite 2.0 or high-tier Buster Chips.
As Castle 2.0 raises firewalls on 10 devices, is more likely to hit critical devices. To prepare for Castle 2.0, you will want at least one efficient high-firewall breaker, and high-tier Buster Chips. You can use Cloaking Rigs to get past high-firewall cameras without hacking, or Oracle to hack them efficiently. You can break firewalls on magnetically reinforced devices using EMP Packs, or with Dr. Xu's Subdermal Tools and a Stim IV. If you don't have much good equipment, save it for the most important devices, especially the non-optional Redundant Power Relay.