-
Notifications
You must be signed in to change notification settings - Fork 828
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
audit: redo organizations, storage-api and add container/clusters, logging, monitoring #2102
Conversation
ca29784
to
b46e46e
Compare
/hold |
608cb26
to
94903bb
Compare
Fix a few bugs that were introduced by the last PR: - prevent bq from aborting audit script early - fix leftover variable name from refactor - avoid importing infra/gcp/lib.sh since it automatically looks for yq, which is not in the image used by the job that runs this script
This is mostly a straight copy-paste of the bash-script embedded in the ci-k8sio-audit job defined in: - repo: https://github.com/kubernetes/test-infra - sha: 624c7344bdb56bd25e119a8b1ccc284939861938 - file: config/jobs/kubernetes/wg-k8s-infra/trusted/wg-k8s-infra-trusted.yaml Added boilerplate header, comments up top, and put line breaks in between each block of code beginning with an echo statement
Export to audit/organizations/kubernetes.io/... Add a migrate_audit_format function that commits a migration from old format to new. Hoping this makes it easier to follow changes during review
include migration code to move to new format
Try to make bucket auditing faster by avoiding multiple gsutil calls for each possible setting; only make them if they're not the default setting. Add support for auditing lifecycle and retention configurations if present.
94903bb
to
1f47041
Compare
/hold |
/hold cancel |
It might also be easier to instead merge #2103 which will close this out as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cpanato, spiffxp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is part of a series of PRs:
Now that #2099 has deployed, the audit job should be able to export more resources. Take a crack at
logging
andmonitoring
with this PR.Makes the following layout changes / resource additions by service type
organizations
:org_kubenetes.io
toorganizations/kubernetes.io
organizations/kubernetes.io/description.json
containers
:projects/{project}/services/container/clusters.txt
projects/{project}/sevices/container/clusters/{cluster}.json
logging
:projects/{project}/services/logging/logs.json
projects/{project}/services/logging/metrics.json
projects/{project}/services/logging/sinks.json
monitoring
:projects/{project}/services/monitoring/dashboards/{dashboard}.json
storage-api
:gsutil
calls by listing buckets, avoiding specific configurations unless presentprojects/{project}/buckets/{bucket}/metadata.txt
projects/{project}/buckets/{bucket}/logging.json
(if configured)projects/{project}/buckets/{bucket}/lifecycle.json
(if configured)projects/{project}/buckets/{bucket}/retention.json
(if configured)projects/{project}/buckets/{bucket}/bucketpolicyonly.txt
(now redundant givenmetadata.txt
)projects/{project}/buckets/{bucket}/cors.txt
(now redundant givenmetadata.txt
)projects/{project}/buckets/{bucket}/logging.txt
(now redundant givenlogging.json
,metadata.txt
)The actual migration to the new format is in followup PR #2103