Skip to content

Commit

Permalink
Restricts service check for type=LoadBalancer only
Browse files Browse the repository at this point in the history
Service of type=LoadBalancer are the only where TLS/SSL annotations make sense. This patch avoids false-negatives for services of other ttypes.
  • Loading branch information
caruccio authored Oct 3, 2023
1 parent f5fab1f commit e435c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hardeneks/namespace_based/security/network_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def check(self, namespaced_resources: NamespacedResources):
offenders = []
for service in namespaced_resources.services:
annotations = service.metadata.annotations
if annotations:
if service.spec.type == 'LoadBalancer' and annotations:
ssl_cert = (
"service.beta.kubernetes.io/aws-load-balancer-ssl-cert"
in annotations
Expand Down

0 comments on commit e435c78

Please sign in to comment.