Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable vulnerability and relevancy scans in Helm configurations acro… #569

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests_scripts/helm/base_network_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def __init__(self, test_obj=None, backend=None, kubernetes_obj=None, test_driver
super(BaseNetworkPolicy, self).__init__(test_driver=test_driver, test_obj=test_obj, backend=backend,
kubernetes_obj=kubernetes_obj)

self.helm_kwargs = {
"capabilities.vulnerabilityScan": "disable",
"capabilities.relevancy": "disable"
}

def validate_basic_metadata(self, actual_obj, expected_obj, namespace):
"""
Validate basic metadata of the object
Expand Down
7 changes: 6 additions & 1 deletion tests_scripts/helm/ks_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ def __init__(self, test_obj=None, backend=None, kubernetes_obj=None, test_driver
super(ScanWithKubescapeAsServiceTest, self).__init__(test_obj=test_obj, backend=backend,
kubernetes_obj=kubernetes_obj, test_driver=test_driver)

self.helm_kwargs = {
"capabilities.vulnerabilityScan": "disable",
"capabilities.relevancy": "disable"
}

def start(self):
assert self.backend != None;
f'the test {self.test_driver.test_name} must run with backend'
Expand All @@ -467,7 +472,7 @@ def start(self):
# 2.1 add and update armo in repo
self.add_and_upgrade_armo_to_repo()
# 2.2 install armo helm-chart
self.install_armo_helm_chart()
self.install_armo_helm_chart(helm_kwargs=self.helm_kwargs)
# 1.3 verify installation
self.verify_running_pods(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, timeout=240)

Expand Down
3 changes: 3 additions & 0 deletions tests_scripts/helm/network_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def start(self):

helm_kwargs = self.test_obj.get_arg("helm_kwargs")

if self.helm_kwargs is not None:
helm_kwargs.update(self.helm_kwargs)

Logger.logger.info('1. Install armo helm-chart')
self.add_and_upgrade_armo_to_repo()
self.install_armo_helm_chart(helm_kwargs=helm_kwargs)
Expand Down
3 changes: 2 additions & 1 deletion tests_scripts/helm/smart_remediation.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def __init__(
)

self.helm_kwargs = {
"capabilities.relevancy": "enable",
"capabilities.vulnerabilityScan": "disable",
"capabilities.relevancy": "disable",
"capabilities.configurationScan": "enable",
"capabilities.continuousScan": "disable",
"capabilities.nodeScan": "disable",
Expand Down
8 changes: 7 additions & 1 deletion tests_scripts/helm/vuln_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,12 @@ def __init__(self, test_obj=None, backend=None, kubernetes_obj=None, test_driver
self.expected_layers = self.create_vulnerabilities_expected_results(
expected_results=self.test_obj.kwargs['expected_layers'])

self.helm_kwargs = {
"capabilities.vulnerabilityScan": "disable",
"capabilities.relevancy": "disable"
}


def start(self):
# create registry scan cronjob and check
# update both cronjob schedule and depth (in configmap)
Expand All @@ -811,7 +817,7 @@ def start(self):
Logger.logger.info(f'using helm branch from test definition: {helm_branch}')
self.helm_branch = helm_branch

cluster, namespace = self.setup_helm_chart()
cluster, namespace = self.setup_helm_chart(helm_kwargs=self.helm_kwargs)
secret_data, registry = self.setup_phase(cluster, namespace)
Logger.logger.info('applying registry secret')
self.apply_registry_secret(secret_data)
Expand Down
Loading