Sign inSign up

trmatts143/network-tester

By trmatts143

•Updated 5 months ago

A Python program that tests network connectivity and latency to any host or IP address.

Image
Networking
0

374

trmatts143/network-tester repository overview

⁠Docker Repository Overview: network-testing

ā šŸ“Œ Purpose

The network-testing repository provides a Python-based tool for performing network diagnostics such as DNS resolution, ICMP ping, and TCP port connectivity checks. It is packaged with a Docker container image based on Amazon Linux 2023, enabling portable, secure, and reproducible execution across environments.


ā šŸ›  Application Features

The core application (network_tester.py) offers:

  • DNS Resolution Testing: Validates hostname resolution, measures response times, and reports errors.
  • Ping Testing: ICMP connectivity with detailed statistics:
    • Successful/failed packet counts
    • Packet loss percentage
    • Min/Max/Average latency
  • TCP Connection Testing:
    • Port-specific connectivity checks
    • HTTP/HTTPS status code detection (80, 443, 8080, 8443)
    • SSL/TLS verification for HTTPS
  • Security Hardened:
    • Input validation against command injection
    • Path traversal protection for output files
  • Cross-platform: Works on Windows, Linux, and macOS.
  • Detailed Reporting: Results saved as timestamped text files in output/.

ā šŸ“¦ Container Image

The Docker image is designed for containerized network testing and includes:

  • Base Image: Amazon Linux 2023
  • Bundled Tool: network_tester.py
  • Included Utilities:
    • ping, traceroute, nslookup, dig
    • netstat, ip, tcpdump
    • nc (ncat), telnet
    • wget, curl

This makes the container suitable for both automated testing and interactive troubleshooting.


ā šŸš€ Usage Examples

⁠Build the Image
docker build -t network-tester:latest .
⁠Run Basic Test
docker run --rm network-tester:latest google.com
⁠Custom Ports
docker run --rm network-tester:latest google.com -p 80 443 8080
⁠Custom Ping Count
docker run --rm network-tester:latest google.com -c 10
⁠Save Results to Host
docker run --rm -v $(pwd)/results:/app/output network-tester:latest google.com
⁠Interactive Shell
docker run --rm -it --entrypoint /bin/bash network-tester:latest
⁠Kubernetes Deployment
apiVersion: v1
kind: Pod
metadata:
  name: network-tester
spec:
  containers:
  - name: network-tester
    image: network-tester:latest
    command: ["python3", "/app/network_tester.py"]
    args: ["google.com", "-p", "80", "443"]

ā šŸ”’ Security Features

  • Hostname validation to prevent injection attacks.
  • Sanitized output filenames to block directory traversal.
  • Resource limits on ping counts and port ranges.
  • SSL/TLS certificate verification for HTTPS connections.

In summary:
This repository delivers a secure, container-ready network testing tool with built-in diagnostics and bundled utilities. The Docker image ensures portability across environments, supports interactive and automated workflows, and integrates seamlessly with registries like Docker Hub and Amazon ECR.

ā šŸ‘‰ Full source code and documentation available at: bludrgn311/python-network-testing⁠

Tag summary

Content type

Image

Digest

sha256:6b0a4a0f5…

Size

87.5 MB

Last updated

5 months ago

docker pull trmatts143/network-tester