This paper investigates the physical-layer security (PLS) aspects of the uplink cooperative non-orthogonal multiple access (NOMA) system in the context of two user scenario. More specifically, this work employs device-to-device (D2D) pair users (i.e., , and ) to further improve the spectral efficiency (SE) of the proposed cooperative uplink NOMA (CU-NOMA) system. One D2D user acts as a decode-and-forward relay, improving the performance of both the cell-edge user (CU) and another D2D user i.e., (). We analyze the secrecy performance of CU and D2 under perfect and imperfect successive interference cancellation (SIC), and optimizes power allocation (PA) to boost the performance. The proposed CU-NOMA system is evaluated in terms of its performance metrics like ergodic secrecy capacity (ESC), ergodic secrecy sum capacity (ESSC), non-zero secrecy capacity (NSC), effective secrecy throughput (EST), and secrecy outage probability (SOP) under the presence of an external eavesdropper (Eav). In addition, this work derives the closed-form analytical expressions of ESC, NSC, EST, and SOP metrics for both CU and under perfect SIC (pSIC) and imperfect (ipSIC) cases in order to characterize the secrecy performance of the proposed secure CU-NOMA network. Further, the outcomes of the simulations are shown as evidence for both the validation of the mathematical analysis and the performance of the method being suggested. The simulation result analysis of this work infers that the secrecy performance of CU-NOMA system with optimal PA exhibits superior performance than that of the fixed PA scheme.