You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@warble.apache.org by hu...@apache.org on 2018/06/26 00:34:34 UTC

[incubator-warble-node] 01/02: ensure only client user can read/write the PEM

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-warble-node.git

commit 4767c7044f09585963fde27ef43bb61232540d2a
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Jun 25 19:18:14 2018 -0500

    ensure only client user can read/write the PEM
---
 node.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/node.py b/node.py
index 5550c92..4a0a222 100644
--- a/node.py
+++ b/node.py
@@ -23,6 +23,7 @@ _VERSION = '0.1.0'
 # Basic imports
 import os
 import sys
+import stat
 import ruamel.yaml
 import requests
 import datetime
@@ -85,6 +86,7 @@ if __name__ == "__main__":
         with open(keypath, "wb") as f:
             f.write(privpem)
             f.close()
+        os.chmod(keypath, stat.S_IWUSR|stat.S_IREAD) # chmod 600, only user can read/write
         print("Key pair successfully generated and saved!")
 
     # Unit test mode?


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@warble.apache.org
For additional commands, e-mail: commits-help@warble.apache.org