My iPhone asks me to confirm my 6-digit password if I want to continue using ICloud.
appears under my name and iCloud account in Settings.
is this legit? Thought my iCloud password is a different one.
Yes, it's legitimate. In addition to your Apple ID password, various other measures are used in securing your account and data. In fact, if you have more than one Apple device, one will sometimes require you to enter the passcode for another.