google / google/mcp-security

Support for service account impersonation

Open
#250 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
528
Forks
141
Avg merge
3d 2h
Merged PRs (30d)
6

Description

In secops/server.py (lines 71-75):
```
service_account_path = os.getenv("SECOPS_SA_PATH")
if service_account_path:
client = SecOpsClient(service_account_path=service_account_path)
else:
client = SecOpsClient()
```

However there is an issue in my case as I'm running the agent in EKS and using the cloudrole which does the cross communication with GCP and impersonate the service account created for communicating with Google SecOps SIEM.

I think to get this working we need to update the code like below to include impersonation scenarios

```
impersonate_sa = os.getenv("GCP_IMPERSONATE_SERVICE_ACCOUNT")
service_account_path = os.getenv("SECOPS_SA_PATH")

if impersonate_sa:
client = SecOpsClient(impersonate_service_account=impersonate_sa)
elif service_account_path:
client = SecOpsClient(service_account_path=service_account_path)
else:
client = SecOpsClient()
```

Currently I created an override for my instance. However I think it is better to include here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.