Skip to content

Commit

Permalink
Merge pull request #545 from lidofinance/broken-desc
Browse files Browse the repository at this point in the history
fix: missed protocol field for finding object
  • Loading branch information
sergeyWh1te authored May 23, 2024
2 parents e1bfad1 + 33a15bc commit 6f3298c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ethereum-steth/src/services/gate-seal/GateSeal.srv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-DEFAULT-EXPIRED')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
this.logger.info(elapsedTime(`[${this.name}.initialize]`, start) + `on block ${currentBlock}`)
Expand Down Expand Up @@ -91,6 +92,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-DEFAULT-WITHOUT-ROLE')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -134,6 +136,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-DEFAULT-EXPIRED')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand Down Expand Up @@ -168,6 +171,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-DEFAULT-EXPIRED')
f.setSeverity(Finding.Severity.HIGH)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')

this.cache.setLastNoPauseRoleAlertTimestamp(currentBlockTimestamp)
}
Expand Down Expand Up @@ -202,6 +206,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-IS-EXPIRED')
f.setSeverity(Finding.Severity.HIGH)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')

out.push(f)

Expand All @@ -216,6 +221,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-IS-ABOUT-TO-BE-EXPIRED')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')
out.push(f)

this.cache.setLastExpiryGateSealAlertTimestamp(currentBlockTimestamp)
Expand Down Expand Up @@ -263,6 +269,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-IS-SEALED')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
} catch (e) {
Expand Down Expand Up @@ -297,6 +304,7 @@ export class GateSealSrv {
f.setAlertid('GATE-SEAL-NEW-ONE-CREATED')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
this.gateSealAddress = gate_seal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export class StethOperationSrv {
f.setAlertid('LIDO-INVARIANT-ERROR')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

findings.push(f)
}
Expand Down Expand Up @@ -309,6 +310,7 @@ export class StethOperationSrv {
f.setAlertid('BUFFERED-ETH-DRAIN')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -352,7 +354,8 @@ export class StethOperationSrv {
)
.setAlertid('HUGE-DEPOSITABLE-ETH')
.setSeverity(Finding.Severity.HIGH)
.setType(Finding.FindingType.SUSPICIOUS),
.setType(Finding.FindingType.SUSPICIOUS)
.setProtocol('ethereum'),
)

this.cache.setLastReportedDepositableEthTimestamp(blockTimestamp)
Expand All @@ -374,6 +377,7 @@ export class StethOperationSrv {
f.setAlertid('HIGH-DEPOSITABLE-ETH')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')
out.push(f)

this.cache.setLastReportedDepositableEthTimestamp(blockTimestamp)
Expand Down Expand Up @@ -411,6 +415,7 @@ export class StethOperationSrv {
f.setAlertid('LOW-DEPOSIT-EXECUTOR-BALANCE')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')
out.push(f)
}
}
Expand Down Expand Up @@ -446,6 +451,7 @@ export class StethOperationSrv {
f.setAlertid('LOW-STAKING-LIMIT')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')
out.push(f)

this.cache.setLastReportedStakingLimit10Timestamp(currentBlockTimestamp)
Expand All @@ -463,6 +469,7 @@ export class StethOperationSrv {
f.setAlertid('LOW-STAKING-LIMIT')
f.setSeverity(Finding.Severity.INFO)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')
out.push(f)

this.cache.setLastReportedStakingLimit30Timestamp(currentBlockTimestamp)
Expand Down
7 changes: 7 additions & 0 deletions ethereum-steth/src/services/vault/Vault.srv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export class VaultSrv {
f.setAlertid('WITHDRAWAL-VAULT-BALANCE-CHANGE')
f.setSeverity(Finding.Severity.INFO)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -219,6 +220,7 @@ export class VaultSrv {
f.setAlertid('EL-VAULT-BALANCE-CHANGE')
f.setSeverity(Finding.Severity.INFO)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -255,6 +257,7 @@ export class VaultSrv {
f.setAlertid('WITHDRAWAL-VAULT-BALANCE-DRAIN')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand All @@ -276,6 +279,7 @@ export class VaultSrv {
f.setAlertid('WITHDRAWAL-VAULT-BALANCE-DRAIN')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -312,6 +316,7 @@ export class VaultSrv {
f.setAlertid('EL-VAULT-BALANCE-DRAIN')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand All @@ -333,6 +338,7 @@ export class VaultSrv {
f.setAlertid('EL-VAULT-BALANCE-DRAIN')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down Expand Up @@ -361,6 +367,7 @@ export class VaultSrv {
f.setAlertid('BURNER-SHARES-TRANSFER')
f.setSeverity(Finding.Severity.HIGH)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)
}
Expand Down
10 changes: 10 additions & 0 deletions ethereum-steth/src/services/withdrawals/Withdrawals.srv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-UNFINALIZED-QUEUE-AND-STAKE-LIMIT')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

findings.push(f)

Expand Down Expand Up @@ -366,6 +367,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-BIG-UNFINALIZED-QUEUE')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand All @@ -391,6 +393,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-LONG-UNFINALIZED-QUEUE')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand Down Expand Up @@ -494,6 +497,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-UNCLAIMED-REQUESTS')
f.setSeverity(Finding.Severity.INFO)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)

Expand Down Expand Up @@ -523,6 +527,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-UNCLAIMED-REQUESTS-MORE-THAN-BALANCE')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.SUSPICIOUS)
f.setProtocol('ethereum')

out.push(f)

Expand All @@ -549,6 +554,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-BUNKER-ENABLED')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')

out.push(f)

Expand All @@ -570,6 +576,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-BUNKER-DISABLED')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand Down Expand Up @@ -633,6 +640,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-BIG-WITHDRAWAL-REQUEST-BATCH')
f.setSeverity(Finding.Severity.INFO)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)
}
Expand All @@ -652,6 +660,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-BIG-WITHDRAWAL-REQUEST-AFTER-REBASE')
f.setSeverity(Finding.Severity.MEDIUM)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand Down Expand Up @@ -768,6 +777,7 @@ export class WithdrawalsSrv {
f.setAlertid('WITHDRAWALS-CLAIMED-AMOUNT-MORE-THAN-REQUESTED')
f.setSeverity(Finding.Severity.CRITICAL)
f.setType(Finding.FindingType.INFORMATION)
f.setProtocol('ethereum')

out.push(f)

Expand Down
2 changes: 2 additions & 0 deletions ethereum-steth/src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function networkAlert(err: Error, name: string, desc: string): Finding {
f.setAlertid(NetworkErrorFinding)
f.setSeverity(Finding.Severity.UNKNOWN)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')

const m = f.getMetadataMap()
m.set('stack', `${err.stack}`)
Expand All @@ -25,6 +26,7 @@ export function dbAlert(err: Error, name: string, desc: string): Finding {
f.setAlertid('DB-ERROR')
f.setSeverity(Finding.Severity.UNKNOWN)
f.setType(Finding.FindingType.DEGRADED)
f.setProtocol('ethereum')

const m = f.getMetadataMap()
m.set('stack', `${err.stack}`)
Expand Down

0 comments on commit 6f3298c

Please sign in to comment.