Unit test for impersonation
We currently do not cover SA impersonation with unit tests.
Hi @mshudrak , Could you guide me on this topic ? Could you explanation little bit more on this ?
hi @mshudrak , Can you elloborate please?
Sorry for the long response. Well, this is not a simple issue. As you can see I removed "good first issue" tag on Jan 18 since it requires editor access on test-gcp-project. However, if you really want to play with it you can setup your own GCP project. What we basically need is to setup GCP service account that can impersonate other accounts and write unit test for that.
More info: https://cloud.google.com/iam/docs/impersonating-service-accounts, https://medium.com/@tanujbolisetty/gcp-impersonate-service-accounts-36eaa247f87c Corresponding code: https://github.com/google/gcp_scanner/blob/main/src/gcp_scanner/credsdb.py#L294