Well, here in SoCA we know about earthquake security! I would fasten it to studs with angle brackets on top where they cannot be seen. If it is too low for that, put them inside under the cabinet top. Do the same to the sides near the bottom. A quake can make the bottom walk out away from the wall even if it doesn't fall over.
Make sure the brackets are fastened well to the bookcase. If you cannot get screws into substantial wood, then use machine screws and nuts through the top.