Skip to content

Commit

Permalink
Fixed OCI error (RedHatProductSecurity#134)
Browse files Browse the repository at this point in the history
* fixed the OCI permission error while creating /home/zap/.ZAP/policies
  • Loading branch information
jeremychoi authored Sep 22, 2023
1 parent 46a9e68 commit 6a51f6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scanners/zap/zap_podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def __init__(self, config, ident="zap"):
"Zap",
("workdir", self._create_temp_dir("workdir"), "/zap/results"),
("scripts", f"{MODULE_DIR}/scripts", "/zap/scripts"),
("policies", f"{MODULE_DIR}/policies", "/home/zap/.ZAP/policies/"),
("zaphomedir", self._create_temp_dir("zaphomedir"), "/home/zap/.ZAP"),
)
self.zap_home = self.path_map.zaphomedir.host_path
Expand All @@ -83,6 +82,9 @@ def setup(self):
if self.state != State.UNCONFIGURED:
raise RuntimeError(f"ZAP setup encounter an unexpected state: {self.state}")

# copy policy files so that they will be available in the container
shutil.copytree(f"{MODULE_DIR}/policies", f"{self.zap_home}/policies")

self._setup_podman_cli()

super().setup()
Expand Down

0 comments on commit 6a51f6a

Please sign in to comment.