The 36-year-old, who has recently returned from a stint in Australia with Melbourne City, will join manager Pat Fenlon’s side for the remainder of this year and the 2016 season.
Duff made 100 appearances for the Republic of Ireland which included appearances at the World Cup in 2002 and European Championship in 2012.
The former Blackburn, Newcastle and Fulham winger won the Premier League twice with Chelsea under manager Jose Mourinho.
Shamrock Rovers thanked sponsors Pepper Ireland and Hyundai Ireland “for their kind support in enabling the club to make this signing.”
Duff told www.shamrockrovers.ie: “I am very excited to have signed for the club. It’s great to have it all finalised and now I’m just really looking forward to getting back on the pitch.
“I am still out with a bit of an injury, but I should be ready to get back training fully before the end of the month. After that I will be very keen to get back playing regularly.
“I have always said that I wanted to come back and play in Ireland and I am very grateful to Pat and the club for giving me the chance to do that. Not only do I get the chance to come back and play, but I get to do it at the biggest club in the country.
“I am as excited about this move as I have been about any in my career, be that Newcastle, Chelsea or any other. I left Ireland 20 years ago to go and make a career as a footballer and so now it’s great to be back.
“And I am definitely not just here to see out my time as a player; I intend to make a positive contribution to Shamrock Rovers and to the league.”