5

Our GCP organization is a mess. I want to organize projects into folders, and delete "abandoned" projects. How can I find out who created a given GCP project?

3 Answers 3

11

Provided that the project was created less than 400 days ago, you can find the project's creator via Stackdriver Logging. This command can quickly look up that information:

gcloud logging read --project [PROJECT] \
  --order=asc --limit=1 \
  --format='table(protoPayload.methodName, protoPayload.authenticationInfo.principalEmail)'

This should give output like:

METHOD_NAME    PRINCIPAL_EMAIL
CreateProject  [email protected]

If METHOD_NAME is not CreateProject, then something went wrong (most likely the project was created more than 400 days ago) and you should ignore PRINCIPAL_EMAIL.

3

I found this link finally BUT still not sure how to filter it down to create project yet. it doesn't seem by project is there

https://console.cloud.google.com/home/activity

ok, it took me a while, but once. you are on that page, on the top, switch to your Organization and it shows the audit for the org.

No need to apply any filters that I saw like in the other answer so I am confused by that one. Anyways, I hope this helps someone.

0

Stackdriver cloud audit logs. Filter by Google Project, the very first will be a CreateProject event with an auth principal.

However, this may not be the person advocating for the project. Ownership may have changed hands, or this might be a generic service account.

There is no substitute for project owners claiming what they are responsible for. Enforce this by setting a policy that projects without suitable metadata will be shut down and eventually deleted. With processes appropriate to your organization, such as requiring all people with project approve authority to confirm they reviewed the list, to archiving one last backup before deletion.

1
  • 1
    that goes to documentation that sends me down a rabbit hole. anyone have a more 'one click' answer or 2? (I know if I search a year later, I will land on this question so would be good to get a quick link answer). I will keep trying through docs but haven't gotten anywhere fast. Apr 3, 2020 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .