We extend a well-known D-brane construction of the AdS/dCFT correspondence to non-abelian defects. We focus on the bulk side of the correspondence and show that there exists a regime of parameters in which the low-energy description consists of two approximately decoupled sectors. The two sectors are gravity in the ambient spacetime, and a six-dimensional supersymmetric Yang-Mills theory. The Yang-Mills theory is defined on a rigid AdS4 S2 background and admits sixteen supersymmetries. We also consider a one-parameter deformation that gives rise to a family of Yang-Mills theories on asymptotically AdS4 S2 spacetimes, which are invariant under eight supersymmetries. With future holographic applications in mind, we analyze the vacuum structure and perturbative spectrum of the Yang-Mills theory on AdS4 S2, as well as systems of BPS equations for finite-energy solitons. Finally, we demonstrate that the classical Yang-Mills theory has a consistent truncation on the two-sphere, resulting in maximally supersymmetric Yang-Mills on AdS4.