The White House is supporting Israel against Hamas but has tried to contain the conflict out of concern for sparking a broader war in the Middle East, even as various fighters, aided by Iran, have carried out attacks on U.S. forces and others in opposition to Israel.