Ferrules are used to attach the casing to its mounting points. They are typically made of metal or plastic and have mounting features allowing them to be securely attached to a mating surface.
Ferrules give axial and torsional support to the casing. Without the ferrule the casing would just float on top of the rotating shaft, being free to rotate somewhat with the shaft due to the friction between the shaft and casing. The ferrule prevents this from happening.
Also, the ferrules can be used to create and environmental seal, keeping moisture, dirt, and dust out of the inside of the casing and away from the flexible shaft. Ferrules can be simple slip fits or more involved machined parts that screw into their mating points.
Here are some of the more popular configurations:
Flange (two & three holes)