Hi @Peter ,
First question:
From a technical perspective, are shared mailboxes protected by Defender for O365, even if they haven't assigned a Defender license?
From the context in the Licensing terms section of Microsoft Defender for Office 365 service description, yes, they are.
Second Question:
From a license perspective, is it ok to just have Defender for O365 licenses for the shared mailboxes?
Yes. It's ok to just have the Defender for O365 licenses for shared mailboxes if you don't need to use the shared mailbox in any way that needs an Exchange Online license. (See this link for scenarios that require an Exchange Online license for shared mailbox.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.