Blockchain has recently sparked interest in both the technological and business firms. The Internet of Things's (IoT) core principle emerged due to the connectivity of several new technologies, including wireless technology, the Internet, embedded automation systems, and micro-electromechanical devices. Manufacturing environments and operations have been successfully converted by implementing recent advanced technology like Cloud Computing (CC), Cyber-Physical System (CSP), Information and Communication Technologies (ICT) and Enterprise Model, and other technological innovations into the fourth industrial revolution referred to as Industry 4.0. Data management is defined as the process of accumulation in order to make better business decisions, and process, secure and store information about a company. In the incipient model, there are interconnected contrivances and Machine-to-Machine (M2M) interactions, and transaction data are stored on the Blockchain. Security is a challenging aspect that must be punctiliously considered during the design and development phases of a CSP. In this research article, we proposed a Secure and Distributed Framework for Resource Management (SDFRM) in Industry 4.0 environments within a distributed and collaborative Industry 4.0 system, the dynamic and trust-based Distributed Management Framework (DMF) of shared resource access. Such issues are focused by taking into account of the traditional characteristics of IoT/Industrial Internet of Things’ (IIoT)-predicated environments, an SDFRM in Industry 4.0 environments within a distributed and collaborative Industry 4.0 system. Also, to ensure strong privacy over the procedures associated with Access Control (AC), a privacy-preserving method is proposed and integrated into the DMF. The proposed DMF, based on blockchain technology and peer-to-peer networks, allows dynamic access management and system governance without using third parties who could be attacked. We worked hard to design and implement the proposal to demonstrate its viability and evaluate its performance. Our proposal outperforms the Multichain Blockchain in terms of successful storage transactions with an achieved average throughput of 98.15%.