The German government has proposed draft legislation that would exclude ethical hacking from criminal prosecution.