pabloem commented on code in PR #39177:
URL: https://github.com/apache/beam/pull/39177#discussion_r3786090828
##########
infra/enforcement/account_keys.py:
##########
@@ -316,18 +317,17 @@ def check_compliance(self) -> List[str]:
msg = f"Service account '{service_account}' is not declared in
the service account keys file."
compliance_issues.append(msg)
self.logger.warning(msg)
- else:
iam_keys =
self._get_user_managed_keys_from_iam(service_account)
- if iam_keys:
- secret_name =
f"{self._denormalize_account_email(service_account)}-key"
- legal_keys = []
- if secret_name in managed_secrets:
- legal_keys =
self._get_verified_keys_from_secret_manager(secret_name)
- unmanaged_keys = set(iam_keys) - set(legal_keys)
- for unmanaged_key in unmanaged_keys:
- msg = f"SECURITY ALERT: Unmanaged key
'{unmanaged_key}' detected on account '{service_account}'. This key was created
outside of Beam's service account management system. "
- compliance_issues.append(msg)
- self.logger.warning(msg)
+ if iam_keys:
Review Comment:
there could be an undefined variable here. How do we fix?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]