Pay to Pose
If you encounter a member of the Cuban military, you can walk up to them and make small talk. It’s not illegal for local residents or foreign travelers to chit-chat with the people who swore their lives to protect their country. However, as soon as you ask for a selfie, things can get pretty awkward pretty quickly.
You’re going to have to pay the soldier a few bucks (hopefully American currency) if you want a selfie with one. That’s pretty much how they make a living since their paychecks aren’t the heftiest. As for taking pictures of government buildings, that’s a non-negotiable no-no.