Skip to content

hojmark/drift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

108 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Drift CLI

๐Ÿงช Alpha
Things are still being wired together. Your feedback helps!

Drift is a command-line tool that gives you confidence to change your network configuration and firewall rules, knowing youโ€™ll be alerted if your network drifts from its desired state. By comparing the actual network state to your declared state, Drift detects issues like unknown devices or unexpected subnet access, helping you maintain network integrity.

Scan command console output

Getting started

Linux ๐Ÿง

Install

curl -sSL https://raw.githubusercontent.com/hojmark/drift/refs/heads/main/install.sh | bash

If Drift is already installed, it will be updated to the latest version.

Then run

# Create a network spec using auto-discovery
drift init

# Scan and detect drift
drift scan -i

Windows ๐ŸชŸ

Important

If script execution is blocked, run powershell.exe -ExecutionPolicy Unrestricted before running the install command.

Install

irm https://raw.githubusercontent.com/hojmark/drift/refs/heads/main/install.ps1 | iex

If Drift is already installed, it will be updated to the latest version.

Then run

# Create a network spec using auto-discovery
drift init

# Scan and detect drift
drift scan -i

Container ๐Ÿ‹

# Scan the host network
docker run -it --rm --network host docker.io/hojmark/drift scan -i

๐ŸŒŸ Features

  • ๐Ÿ•ต๏ธ Drift Detection
    Detect mismatches between your declared and actual network state.

  • ๐Ÿ“„ Declarative
    Define your intended state in YAML. Generate a spec from your live network to get started quickly.

  • ๐Ÿ“ก Network Discovery
    Automatically detect devices and services, then use that information to define your desired state. Discover IP addresses, MAC addresses, and open ports.

  • ๐Ÿงฑ Subnet Access Detection (coming soon)
    Detects whether access between subnets is possible, highlighting potential firewall rule issues.

  • ๐Ÿ“ฆ CLI
    Manage everything from the command line โ€” interactively or in scripts โ€” with multiple output formats.

  • ๐ŸŒ Distributed Scanning (coming soon)
    Deploy agents across subnets for complete network visibility.

  • ๐Ÿ” Continuous Monitoring (coming soon)
    Automate scans and receive alerts when drift is detected.

  • ๐Ÿ›œ Wi-Fi Scanning (coming soon)
    Detect Wi-Fi networks and their properties โ€” including SSID, BSSID, signal strength, and encryption type โ€” and use that information to define your desired state.

โ“ FAQ

โ–ธ Is there any documentation?

Use --help on each command to explore functionality.

A user settings file can be created at ~/.config/drift/settings.json.

JSON Schemas are available to enable editor auto-completion and validation:

  • **Network spec schema **
    Add the yaml-language-server comment at the top of your spec file:
    # yaml-language-server: $schema=https://raw.githubusercontent.com/hojmark/drift/refs/heads/main/src/Spec/embedded_resources/schemas/drift-spec-v1-preview.schema.json
    network:
    ...
  • **User settings schema **
    Add the $schema property at the top of your settings file:
    {
      "$schema": "https://raw.githubusercontent.com/hojmark/drift/refs/heads/main/src/Cli.Settings/embedded_resources/schemas/drift-settings-v1-preview.schema.json",
      ...
    }

Thereโ€™s no official documentation site yet โ€” if you run into trouble, feel free to open a discussion.

โ–ธ What can be automatically discovered?

Drift can automatically discover devices (MAC, IPv4, hostname), open ports, and subnets. Due to the massive size of the IPv6 address space, full IPv6 scanning isnโ€™t feasible. However, you can still manually define IPv6 addresses for your known devices.

โ–ธ Is this useful for: my homelab?

Yes! Thatโ€™s exactly what I built it for. I'd love your feedback if you think anything could be improved. Being in alpha, I'm sure there's quite a bit!

โ–ธ Is this useful for: a business environment?

Probably! But Iโ€™d love to hear what you think.

Heads-up: make sure it's okay that you scan your company's network โ€” it could trigger intrusion detection systems.

โ–ธ Iโ€™d really like feature X!

Awesome! Please open an issue and Iโ€™ll make sure to consider it.

โ–ธ I think I found a bug?

Oops! Mind opening an issue, so I can take a look?

About

๐Ÿ“ก Drift CLI โ€” monitor network state drift

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors

Languages