Skip to content

Commit

Permalink
Make enumeration diagnostig messages more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
eliecharra committed Aug 18, 2022
1 parent a1a4d70 commit 1ad43c0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions enumeration/remote/alerts/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ func NewRemoteAccessDeniedAlert(provider string, scanErr *remoteerror.ResourceSc
switch scanningPhase {
case EnumerationPhase:
message = fmt.Sprintf(
"Ignoring %s from drift calculation: Listing %s is forbidden: %s",
"An error occured listing %s: listing %s is forbidden: %s",
scanErr.Resource(),
scanErr.ListedTypeError(),
scanErr.RootCause().Error(),
)
case DetailsFetchingPhase:
message = fmt.Sprintf(
"Ignoring %s from drift calculation: Reading details of %s is forbidden: %s",
"An error occured listing %s: reading details of %s is forbidden: %s",
scanErr.Resource(),
scanErr.ListedTypeError(),
scanErr.RootCause().Error(),
)
default:
message = fmt.Sprintf(
"Ignoring %s from drift calculation: %s",
"An error occured listing %s: %s",
scanErr.Resource(),
scanErr.RootCause().Error(),
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/scan/output/testdata/output.html
Original file line number Diff line number Diff line change
Expand Up @@ -681,17 +681,17 @@ <h2>Jun 10, 2021</h2>

<li data-kind="resource-alerts" class="resource-item">

<span>Ignoring aws_vpc from drift calculation: Listing aws_vpc is forbidden: dummy error</span>
<span>An error occured listing aws_vpc: listing aws_vpc is forbidden: dummy error</span>
</li>

<li data-kind="resource-alerts" class="resource-item">

<span>Ignoring aws_sqs from drift calculation: Listing aws_sqs is forbidden: dummy error</span>
<span>An error occured listing aws_sqs: listing aws_sqs is forbidden: dummy error</span>
</li>

<li data-kind="resource-alerts" class="resource-item">

<span>Ignoring aws_sns from drift calculation: Listing aws_sns is forbidden: dummy error</span>
<span>An error occured listing aws_sns: listing aws_sns is forbidden: dummy error</span>
</li>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"alerts": {
"": [
{
"message": "Ignoring aws_vpc from drift calculation: Listing aws_vpc is forbidden: dummy error"
"message": "An error occured listing aws_vpc: listing aws_vpc is forbidden: dummy error"
},
{
"message": "Ignoring aws_sqs from drift calculation: Listing aws_sqs is forbidden: dummy error"
"message": "An error occured listing aws_sqs: listing aws_sqs is forbidden: dummy error"
},
{
"message": "Ignoring aws_sns from drift calculation: Listing aws_sns is forbidden: dummy error"
"message": "An error occured listing aws_sns: listing aws_sns is forbidden: dummy error"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Found 0 resource(s)
- 0% coverage
Congrats! Your infrastructure is fully in sync.
Ignoring aws_vpc from drift calculation: Listing aws_vpc is forbidden: dummy error
Ignoring aws_sqs from drift calculation: Listing aws_sqs is forbidden: dummy error
Ignoring aws_sns from drift calculation: Listing aws_sns is forbidden: dummy error
An error occured listing aws_vpc: listing aws_vpc is forbidden: dummy error
An error occured listing aws_sqs: listing aws_sqs is forbidden: dummy error
An error occured listing aws_sns: listing aws_sns is forbidden: dummy error

It seems that we got access denied exceptions while listing resources.
The latest minimal read-only IAM policy for driftctl is always available here, please update yours: https://docs.driftctl.com/aws/policy
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"alerts": {
"": [
{
"message": "Ignoring github_team from drift calculation: Listing github_team is forbidden: dummy error"
"message": "An error occured listing github_team: listing github_team is forbidden: dummy error"
},
{
"message": "Ignoring github_team_membership from drift calculation: Listing github_team is forbidden: dummy error"
"message": "An error occured listing github_team_membership: listing github_team is forbidden: dummy error"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Found 0 resource(s)
- 0% coverage
Congrats! Your infrastructure is fully in sync.
Ignoring github_team from drift calculation: Listing github_team is forbidden: dummy error
Ignoring github_team_membership from drift calculation: Listing github_team is forbidden: dummy error
An error occured listing github_team: listing github_team is forbidden: dummy error
An error occured listing github_team_membership: listing github_team is forbidden: dummy error

It seems that we got access denied exceptions while listing resources.
Please be sure that your Github token has the right permissions, check the last up-to-date documentation there: https://docs.driftctl.com/github/policy

0 comments on commit 1ad43c0

Please sign in to comment.