GitHub リポジトリのスキャン結果を Firestore に保存するためのリポジトリ層を実装する。定期スキャンの実装に向けて、リポジトリの基本情報とブランチごとのスキャン結果を階層的に管理する。
- Firestore に以下のコレクション構造でデータを保存:
repo/{repoID}: リポジトリの基本情報(デフォルトブランチ、インストールID等)
| 78a79,81 | |
| > type StatusHistoryID string // UUID v7 typed string | |
| > type IncidentID string // typed string | |
| > | |
| 80,85c83,88 | |
| < ID string // 履歴ID | |
| < IncidentID string // インシデントID | |
| < Status IncidentStatus // 変更後のステータス | |
| < ChangedBy User // 変更実施者 | |
| < ChangedAt time.Time // 変更日時 |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "os" | |
| "cloud.google.com/go/bigquery" | |
| "cloud.google.com/go/bigquery/storage/apiv1/storagepb" | |
| mw "cloud.google.com/go/bigquery/storage/managedwriter" |
| package utils | |
| import ( | |
| "io" | |
| "os" | |
| "sync" | |
| "github.com/m-mizutani/goerr" | |
| "golang.org/x/exp/slog" | |
| ) |
| complete -c zenv -n '__fish_use_subcommand' -xa '(zenv secret list)' -d 'Secret' |
| package main | |
| import ( | |
| "errors" | |
| "github.com/m-mizutani/goerr" | |
| "github.com/rs/zerolog/log" | |
| ) | |
| type Request struct { |
Masayoshi Mizutani is a security engineer. In university, he was studying and researching about network-based intrusion detection system and malware analysis. After graduation, he worked for various projects, e.g. SIEM (Security Information & Event Manager) integration, SOC (Security Operation Centor) Analyst, building visualization system of security data and so on.