Dictionary.com
Thesaurus.com

rap someone's knuckles

Idioms  
  1. Reprimand, as in If I'd seen John take that last piece of cake, I'd have rapped his knuckles. This term transfers a physical punishment to a verbal one. [Late 1600s]