abcxyz / abcxyz/guardian

[IAM drift] Resources in `DELETE_REQUESTED` state should be filtered out

オープン
#334 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Go
スター
26
フォーク
7
平均マージ
1日 1時間
マージ済み PR(30日)
1

説明

### TL;DR

Context for https://github.com/abcxyz/guardian/blob/main/pkg/commands/drift/drift.go#L194.

Currently, `asset.SearchAllIamPolicies` will include IAM policies bound to resources that are soft-deleted (state=`DELETE_REQUESTED`) and these are identified as drift. These are false-positives and should be filtered out.

**Initial approach**
1. Get all soft-deleted projects/folders with `asset.SearchAllResources`
2. Exclude them using a query for `asset.SearchAllIamPolicies`.

However, I found that `asset.SearchAllIamPolicies` does not support negated queries, which makes it infeasible to exclude projects/folders in `DELETE_REQUESTED` state from the API response.

**A hacky alternative**
1. `SearchAllResources` for folders/projects in `state:DELETE_REQUESTED`
2. Append these resources to the driftignore hierarchy graph so they will be filtered out using the driftignore approach

While the alternative could work, the best solution is if we can apply the filter in the `SearchAllIamPolicies` request, which doesn't seem to be possible at the moment.

### Expected behavior

_No response_

### Observed behavior

_No response_

### Environment Details

All

### Additional information

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。