-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCP gcloud bulk-export as an audit trail #1981
Comments
Is this not runnable by members of the auditor group? What resources does this support? How is this different than gcloud supporting tf as an output format? |
I wasn't aware that gcloud supported tf as an output format. Do you have any links to docs? My bit of searching didn't seem to pull up anything. I was able to get terraformer to work, however with DNS and get quite few errors:
I was able to dump a few other items, but may need to re-run it for each region we have resources in:
Not sure if the output is ready for public consumption. So I created a private repo and invited @ameukam @spiffxp and @dims to review before I make public. https://github.com/ii/k8s-infra-terraformer-dump (invites can be accepted by visiting https://github.com/ii/k8s-infra-terraformer-dump/invitations) |
List of supported Resources: https://github.com/GoogleCloudPlatform/terraformer/blob/master/docs/gcp.md |
@hh You can check the bulk export with gcloud here : https://cloud.google.com/sdk/gcloud/reference/alpha/resource-config/bulk-export. |
Thank you @ameukam
|
|
I'm not sure what the iam permission we need here. |
Terraformer has been running against k8s for 8 plus hours, still not finished. |
#2010 should give you |
Is there something still outstanding to get permissions for gcloud bulk-export ?#1981 (comment) |
I don't recognize this organization ID. We use
|
I was using project and not organization id This worked:
gcloud organizations list
|
To run bulk export on individual projects I need permissions to enable the cloudasset api. I can do this on sandbox, but not on individual projects. For example:
From what I can see auditors should have the ability to view cloudassets, but I do not have the permissions to enable them. |
/assign @bernokl |
/retitle GCP gcloud bulk-export as an audit trail |
I think you can enable and use it against your project. I suspect it doesn't need to be enabled in all projects you want to target |
We have it working against the sandbox. What we are wanting is to use it as a replacement for https://github.com/kubernetes/k8s.io/blob/main/audit/audit-gcp.sh. |
Right. Do you have a sample PR that does this? You are not blocked. Gcloud has a billing project flag that can be used to signify which project you want to charge the service to, which could be your project for dev purposes. Otherwise it depends on who is invoking it and what their active project is. Service accounts default to the project they live in |
Thank you, here is an example of what an export would look like.
and got |
I did test running the export specifying the billing-project:
But still get permission denied:
In the console I see: |
I'll need to read more about this command. I'm not sure we want this service enabled in every target project |
/area infra/auditing |
Update. From my brief exploration bulk-export is a very accurate depiction of our project. This is not a comment on further exploration of dangers of enabling serviceusage I understand security needs to be the first concern. Just sharing exciting findings. |
My invite for https://github.com/ii/k8s-infra-dump/tree/main/resource-config-bulk-export expired, if you get a chance to resend I can take more of a look |
Resent. Sorry for the delay, let me know if you still have issues |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Terraformer to dump files from existing infrastructure to support K8s Infra Migration
Terraformer can be used to "reverse Terraform" existing infrastructure as part of the Migration of K8s Infrastructure.
To achieve this a person with full access to the relevant infrastructure is needed to run it for us
The text was updated successfully, but these errors were encountered: