Not to get all historical on you, but if you worked for IBM in the 1930s-1940s you may have worked on something that was used to perpitrate a holocaust. Was that ethical? I don’t think so.
That said, it’s very easy to abstract yourself away from the harm. To tell yourself you’re not the one who builds the landmines, you just maintain the coffee machine at the landmine factory. But that’s just lying to yourself. An honest and deep appraisal of what you’re work is helping make happen is required to decide if your job is ethical or not.