Security is a main issue for adoption of cloud computing. NFV and SDN can be used to efficiently coordinate different network security functionality in the network. To squeeze the best out of network capabilities, there is a need for algorithms for optimal placement of the security functionality in the cloud infrastructure. Classical placement algorithms are not scalable due to the large number of flows to be considered and complexity of interactions in these networks. To address the issue, this paper presents an optimization framework, namely OCDO, that provides adequate and scalable network security provisioning and deployment in the cloud. Also described is a prototype implementation of the framework integrated into an open source cloud framework, i.e. Open stack.