You would put screws through the bottom of the box into the ledge. If the ledge is brick or cement you would need to use masonry anchors. I’d recommend securing the wooden window box and then dropping in a plastic liner or pots if the window box doesn’t come with one. That way you can remove the plants and soil easily if needed to check/fix the attachments.