How do I rotate player's hand to surface of ledge

So I have made a semi-functional ledge climbing system and the player grabs the ledge and such and can shimmy down them using the IK. However, I want the player to be able to grab on to slanted ledges with the hand rotating to the ledge. I have got it working for only one side of the 3d object using the “MakeRotFromX” but because it is the X axis it will only work on the one side of it. I was using the Transform(Modify) Bone node in the Animation Blueprint but if there is any other way to get this to work I am entirely fine with it :). I am a little bit stumped on the math behind it and would greatly appreciate any feedback I can get for my problem. Thank you!