That is a trim and it does come off with clips but has nothing to do with the water going in your car.
If this is the case , take the trim off and apply that special silicon used for glass installations ( black colour ) around and let it dry.
If however there is no rust on your bonnet, try this !
You know the rubber seal thats on the body of the car and goes around the whole rear hatch opening ?
Well, at the point where the lock is for the rear hatch, pull that rubber up and out and check for rust there !
I dont think you got away with it
Water can also go in if that rubber seal is craked at a point or if its flattened .
Last water may have gone in the car from the rear windscreen wiper rubbers !
I'm afraid there's only one way of finding out where the water comes from :
Lock yourself in the boot of the car and have someone hose you down to see where it leaks