Despite deep learning based intelligent diagnosis has become an essential means of perceiving the health status of rotating machinery, existing diagnostic models struggle to efficiently extract domain-invariant representations for cross-domain tasks in the absence of source domain data due to the limitations of imbalanced machine fault data, the various scenarios, as well as privacy protection in industrial applications. In order to solve these issues, we innovatively propose a source-free cross-domain fault diagnosis algorithm for rotating machinery using the Siamese framework (SCSF). Specifically, a deep residual shrinkage network with parallel spatial and channel-wise attention mechanisms (DRSN-SCW) is used for feature extraction to suppress background noise. In addition, pre-trained feature extraction networks and classifiers use only source domains based on the Siamese framework for end-to-end representation learning to address the problem of fault diagnosis of category-imbalanced data at the feature representation level. Finally, for cross-domain scenarios where the target domain does not have access to source domain data during training, we use a prototype-based pseudo-labeling strategy as well as impose consistency and diversity constraints on the classifier outputs to improve the diagnostic performance of unlabeled target domains. Extensive experiments conducted on the Spectra Quest mechanical fault dataset and the Case Western Reserve University rolling bearing dataset validate the effectiveness of the SCSF. The code is available at .