Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve On-chain monitoring section #56

Open
mattaereal opened this issue Aug 24, 2024 · 1 comment
Open

Improve On-chain monitoring section #56

mattaereal opened this issue Aug 24, 2024 · 1 comment
Labels
collab Content suggestion or request modification Update or content modification request

Comments

@mattaereal
Copy link
Collaborator

What content are you looking to modify or update?

On-chain monitoring category.

Why do you think this update or modification is needed?

It actually does not explain much.

Can you justify your argument and provide additional resources

I'd suggest using something similar to this below:

On-Chain Monitoring Security Guideline

1. Objective

  • To establish a framework for monitoring on-chain activities, detecting anomalies, and responding to potential threats using open-source tools.

2. Key Principles

  • Transparency: Utilize open-source tools to ensure transparency and community-driven improvements.
  • Real-time Monitoring: Implement real-time monitoring to detect and respond to threats as quickly as possible.
  • Automation: Leverage automation to handle repetitive tasks and reduce human error.
  • Scalability: Ensure the monitoring setup can scale with the growth of the blockchain network.

3. Monitoring Tools

  • 1. BlockScout

    • Purpose: Blockchain explorer that provides detailed information about transactions, blocks, addresses, and tokens on Ethereum-based networks.
    • Features:
      • Track transactions, blocks, and token transfers.
      • Monitor contract events and logs.
      • Customizable alerts for specific activities.
    • Setup: Deploy BlockScout for your specific blockchain network and configure alerts for critical activities.
    • GitHub: BlockScout Repository
  • 2. Etherscan API (for Ethereum)

    • Purpose: API provided by Etherscan for querying on-chain data, transaction history, and contract events.
    • Features:
      • Retrieve information about transactions, blocks, and addresses.
      • Monitor ERC-20/ERC-721 token transfers and events.
      • Set up automated alerts for suspicious activity.
    • Setup: Integrate the Etherscan API with your monitoring system to track specific addresses or contracts.
    • Documentation: Etherscan API Documentation
  • 3. Tenderly

    • Purpose: An open-source tool for Ethereum contract monitoring, debugging, and analytics.
    • Features:
      • Real-time monitoring of smart contracts.
      • Debugging tools to trace transactions and events.
      • Analytics to visualize contract interactions and performance.
    • Setup: Configure Tenderly to monitor specific contracts and set up alerts for unexpected behavior.
    • GitHub: Tenderly GitHub Repository
  • 4. Prometheus and Grafana

    • Purpose: Monitoring and alerting toolkit (Prometheus) with a visualization dashboard (Grafana).
    • Features:
      • Collect metrics from blockchain nodes and network status.
      • Custom dashboards for visualizing on-chain data.
      • Alerts based on predefined thresholds (e.g., large transaction volumes).
    • Setup: Integrate Prometheus with your blockchain nodes and use Grafana to visualize and monitor key metrics.
    • GitHub: Prometheus | Grafana
  • 5. OpenZeppelin Defender

    • Purpose: Secure operations for Ethereum smart contracts, including monitoring, upgrading, and managing permissions.
    • Features:
      • Monitor contract interactions and receive alerts for suspicious activities.
      • Automate responses to specific events (e.g., pause a contract).
      • Integrated with Etherscan and Tenderly for seamless monitoring.
    • Setup: Deploy OpenZeppelin Defender to manage and monitor your smart contracts securely.
    • GitHub: OpenZeppelin Defender

4. Monitoring Strategies

  • Transaction Monitoring:

    • Monitor large transactions, unusual token transfers, and unexpected contract interactions.
    • Set up alerts for transactions that meet specific criteria (e.g., large value transfers, multiple transactions in quick succession).
  • Contract Event Monitoring:

    • Track contract events such as minting, burning, and approval actions.
    • Monitor for unexpected contract behavior, such as unauthorized access or code execution.
  • Node and Network Monitoring:

    • Use Prometheus to collect metrics from blockchain nodes, such as block propagation times, node performance, and network latency.
    • Set up Grafana dashboards to visualize network health and identify anomalies.
  • Security Alerts and Incident Response:

    • Configure alerts to notify relevant teams immediately when suspicious activity is detected.
    • Establish an incident response plan that includes steps for contract pausing, multisig approval, and communication with stakeholders.

5. Implementation Steps

  • Step 1: Tool Selection

    • Choose the tools that best fit your blockchain network and monitoring needs.
  • Step 2: Setup and Configuration

    • Deploy and configure the selected tools according to your network and security requirements.
    • Customize alerting rules, dashboards, and monitoring parameters.
  • Step 3: Continuous Monitoring

    • Regularly review and update monitoring parameters as the network evolves.
    • Ensure that alerts are actionable and that response procedures are tested regularly.
  • Step 4: Regular Audits

    • Conduct periodic audits of your monitoring setup to ensure it remains effective against emerging threats.
    • Update and refine the monitoring strategy based on audit findings and new security developments.

6. Best Practices

  • Start Simple, Scale Gradually: Begin with basic monitoring setups and expand as you identify more complex needs.
  • Automate Responses: Where possible, automate responses to certain types of alerts to reduce response time.
  • Collaborate with the Community: Engage with the open-source community to stay updated on new tools, features, and best practices.
  • Document Everything: Maintain comprehensive documentation for your monitoring setup, including configurations, alert rules, and response protocols.

7. Conclusion

  • Effective on-chain monitoring is crucial for maintaining the security and integrity of blockchain networks. By leveraging open-source tools and following the guidelines outlined above, you can establish a robust monitoring framework that helps detect and respond to potential threats in real-time.
@mattaereal mattaereal added collab Content suggestion or request modification Update or content modification request labels Aug 24, 2024
@LouisTsai-Csie
Copy link

Maybe we can add forta bot in the monitoring section as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collab Content suggestion or request modification Update or content modification request
Projects
None yet
Development

No branches or pull requests

2 participants