Security attacks at the physical layer, in the form of radio jamming for denial of service, are an increasing threat in the Industry 4.0 scenarios. In this paper, we consider the problem of jamming detection in 5G-and-beyond communication systems and propose a defense mechanism based on pseudo-random blanking of subcarriers with orthogonal frequency division multiplexing (OFDM). We then design a detector by applying the generalized likelihood ratio test (GLRT) on those subcarriers. We finally evaluate the performance of the proposed technique against a smart jammer, which is pursuing one of the following objectives: maximize stealthiness, minimize spectral efficiency (SE) with mobile broadband (MBB) type of traffic, and maximize block error rate (BLER) with ultra-reliable low-latency communications (URLLC). Numerical results show that a smart jammer a) needs to compromise between missed detection (MD) probability and SE reduction with MBB and b) can achieve low detectability and high system performance degradation with URLLC only if it has sufficiently high power.