Motivated by recent developments in string theory, we study the structure of boundary conditions in arbitrary conformal field theories. A boundary condition is specified by two types of data: first, a consistent collection of reflection coefficients for bulk fields on the disk; and second, a choice of an automorphism ω of the fusion rules that preserves conformal weights and can be implemented on the spaces of chiral blocks. Non-trivial automorphisms ω correspond to D-brane configurations for arbitrary conformal field theories. The choice of the fusion rule automorphism ω amounts to fixing the dimension and certain global topological features of the D-brane world volume and the background gauge field on it. We present evidence that for fixed choice of ω the boundary conditions are classified as the irreducible representations of some commutative associative algebra, a generalization of the fusion rule algebra. Each of these irreducible representations corresponds to a choice of the moduli for the world volume of the D-brane and the moduli of the flat connection on it.