As a synonym:
* Shelter: A harbor can be a place of shelter for ships.
* Refuge: A harbor can be a place of refuge from danger or storms.
* Hold: You can "harbor" a thought or feeling, meaning to hold onto it.
As an antonym:
* Expose: To harbor a secret is to keep it hidden, the opposite of exposing it.
* Reject: To harbor a thought or feeling is to accept it, the opposite of rejecting it.
To understand the meaning of "harbor" in a specific context, you need to consider the surrounding words and the overall meaning of the sentence.