TL;DR
A novel about a female spaceship captain where her empire is at war. Her empire follows a moral codes, they don't attack, just defend.
They are losing the war and their enemy is on the verge of securing an alliance that could mean the end of her empire.
Her planet got attacked, her relatives have been executed because of her position on the fleet.
She decides to set aside those moral codes and do anything to avenge her planet and win the war. She plots a conspiracy to frame her empire's enemies of spying on their new allies.
She releases a dangerous criminal, trades away equipment from her ship and gives powerful weapons as payments to execute her plan.
I'm looking for a novel, where the protagonist is a female spaceship captain (or second in command), she lives in a spaceship, where the resources are limited and there's a lack of food/good food and equipments.
She's from (let's call it Empire 1) and their enemies are Empire 2 while Empire 3 is neutral.
One of the problems that face her Empire is that they have a very ideal ethic and moral codes, they don't even attack their enemy, they just defend.
And it was going fine so far, but now the tides are turning and they starting to become in a vulnerable situation, also it seems that's there's an alliance is set to happen between Empire 2 and Empire 3, (which obliviously will make a bad situation much worse).
The protagonist is not in a good place herself, her girlfriend left her and she's having a drinking problem, she starts doubting the pragmatism of these moral codes and wonders if there's away a round them. To her surprise, she realizes that some of her superiors, while believing in this ethic codes, they are not strict as they once were, which make her realize the severity of her empire situation.
The tipping point was when her planet got attacked, and (with the exception of the people who manage to fly/run away) all it's population got killed, her relatives (she don't have immediate family) were executed because of who she is (a captain at Empire 1 fleet).
She starts plotting a scheme where she try to frame (a high ranking member) of Empire 3 of being a traitor and a spy for Empire 2 (probably not someone in particular, just that Empire 2 have one).
She starts gathering resources and individuals to make this plot works, without her supervisors or subordinate knowing. For example, she releases a dangerous/known criminal into her custody to help set (a money trail?) between the one she's framing and Empire 2, to get some equipment she needs, she trade stuff from her ship (air filters may be), She gives criminals/rebels a powerful weapons as a payment for other stuff she needs.
Things obviously don't go smoothly, for example, the prisoner in her custody try to escape and kill people in his attempt.
In the end (I remember vaguely) when she meets a prominent member from Empire 3 in an isolated place/planet, to deliver this "evidence" to him, things go wrong, he somehow knows it's fake. He and his men try to arrest her and arrest whom with her.
They fight (with weapons), the prominent member is losing, so he flee with his ship (a small personal one). She follows him and destroys his ship (she's also in a small ship, alone).
She returns, get drunk, find that her ex girlfriend returned to help her with her problems (drinking and may be work related), but the protagonist is in despair, thinking it's to late and expecting her plot to be uncovered and she'll end up in jail.
In the morning, soldiers wake her up, tell her that she's needed at her superior's office. He informs her that there was a major development. A high ranking member from Empire 3's ship has been destroyed, there were some "evidence" that he was working with Empire 2 (not sure of the details) and it looks like Empire 3 might responds harshly against Empire 2.
It's a relatively new novel (definitely from no longer than 10 years), it wasn't especially good, but I like it. The main character name might have been "Kate".
The predominant question throw the novel was "will you go against your ethics in order to win, or will you stick with them no matter what, even if it means losing?