Skip to content

Commit 69de59f

Browse files
committed
private_key: rw only for owner
1 parent 8861406 commit 69de59f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

job_executor/adapter/fs/private_keys_directory.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ def create(self) -> bool:
1414
return False
1515

1616
def save_private_key(self, microdata_private_key_pem: bytes) -> None:
17-
with open(self._get_private_key_location(), "wb") as file:
17+
fd = os.open(
18+
self._get_private_key_location(),
19+
os.O_CREAT | os.O_WRONLY | os.O_EXCL,
20+
0o600,
21+
)
22+
with os.fdopen(fd, "wb") as file:
1823
file.write(microdata_private_key_pem)
1924

2025
def clean_up(self) -> bool:

0 commit comments

Comments
 (0)