The Environment Agency has secured a court order preventing access to an illegal waste site on an area of outstanding natural beauty.