Skip to content

audit: add check-audit-pr.sh#2120

Merged
k8s-ci-robot merged 1 commit intokubernetes:mainfrom
spiffxp:audit-check
Jun 4, 2021
Merged

audit: add check-audit-pr.sh#2120
k8s-ci-robot merged 1 commit intokubernetes:mainfrom
spiffxp:audit-check

Conversation

@spiffxp
Copy link
Copy Markdown
Contributor

@spiffxp spiffxp commented Jun 2, 2021

A bunch of bash to try and categorize or triage audit pr changes against
policies, triage known policy violations, or special cases. Takes a pass
through any modified or untracked files according to git, and commits any
that are recognized. The goal is to have 0 files left by the end

  • check_buckets:
    • storage class is standard
    • location type is multi-region
    • location constraint buckets have location in name
    • lifecycle is one of well-known cases
    • logging is one of well-known cases
    • retention is one of well-known cases (or triage)
    • triage: ACLs are present
  • check_compute:
    • placeholder
  • check_container:
    • cluster is one of clusters defined by infra/gcp/clusters
  • check_iam_in_projects:
    • placeholder
  • check_logging
    • triage: empty metrics.json
    • triage: noisy logs changes in k8s-infra-e2e-* projects
    • expected audit logs are present
  • check_monitoring
    • dashboards exist for k8s-infra-prow-build
  • check_organization:
    • description is present
    • roles match definition in infra/gcp/roles

Things to consider for followup:

  • check deletions
  • check all audit files not just those in git-status
  • add support for
    • iam.json changes
    • custom project iam role changes
    • service-account/ changes
    • services/compute/project-infa.json
  • not bash

I used this to review #2094

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 2, 2021
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the area/audit Audit of project resources, audit followup issues, code in audit/ label Jun 2, 2021
@k8s-ci-robot k8s-ci-robot requested review from nikhita and thockin June 2, 2021 19:00
@k8s-ci-robot k8s-ci-robot added wg/k8s-infra approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 2, 2021
A bunch of bash to try and categorize or triage audit pr changes against
policies, triage known policy violations, or special cases. Takes a pass
through any modified or untracked files according to git, and commits any
that are recognized. The goal is to have 0 files left by the end

- check_buckets:
  - storage class is standard
  - location type is multi-region
  - location constraint buckets have location in name
  - lifecycle is one of well-known cases
  - logging is one of well-known cases
  - retention is one of well-known cases (or triage)
  - triage: ACLs are present
- check_compute:
  - placeholder
- check_container:
  - cluster is one of clusters defined by infra/gcp/clusters
- check_iam_in_projects:
  - placeholder
- check_logging
  - triage: empty metrics.json
  - triage: noisy logs changes in k8s-infra-e2e-* projects
  - expected audit logs are present
- check_monitoring
  - dashboards exist for k8s-infra-prow-build
- check_organization:
  - description is present
  - roles match definition in infra/gcp/roles

Things to consider for followup:

- check deletions
- check all audit files not just those in git-status
- add support for
  - iam.json changes
  - custom project iam role changes
  - service-account/ changes
  - services/compute/project-infa.json
- not bash
@ameukam
Copy link
Copy Markdown
Member

ameukam commented Jun 3, 2021

/lgtm
/hold
Remove hold when ready.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2021
@spiffxp
Copy link
Copy Markdown
Contributor Author

spiffxp commented Jun 4, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit b4fa48e into kubernetes:main Jun 4, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jun 4, 2021
@spiffxp spiffxp deleted the audit-check branch June 4, 2021 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/audit Audit of project resources, audit followup issues, code in audit/ cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants