Skip to content

Support for service account impersonation #250

@rahulgk-mettle

Description

@rahulgk-mettle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions