Skip to content

Commit

Permalink
refactor: Fix insecure yaml load method
Browse files Browse the repository at this point in the history
  • Loading branch information
dorukozturk committed Jan 11, 2023
1 parent 7ce36a6 commit 8d8809e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hardeneks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _config_callback(value: str):

with open(value, "r") as f:
try:
yaml.load(f, Loader=yaml.FullLoader)
yaml.safe_load(f)
except yaml.YAMLError as exc:
raise typer.BadParameter(exc)

Expand Down Expand Up @@ -73,7 +73,7 @@ def _load_kube_config():
tmp_config = tempfile.NamedTemporaryFile().name

with open(kube_config_orig, "r") as fd:
kubeconfig = yaml.load(fd, Loader=yaml.FullLoader)
kubeconfig = yaml.safe_load(fd)
for cluster in kubeconfig["clusters"]:
cluster["cluster"]["insecure-skip-tls-verify"] = True
with open(tmp_config, "w") as fd:
Expand Down

0 comments on commit 8d8809e

Please sign in to comment.