Code Monkey home page Code Monkey logo

kev-push's Introduction

kev-push

This crate builds a binary that will compare CISA's current KEV Catalog to a locally cached copy and send a Pushover notification if there is a new update. macOS users will also receive a desktop notification.

You can, say, put it in a cron job to check at some regularity and be notified whenever there is a new addition to the catalog.

At first launch, the program will cache the current KEV JSON. Subsequent launches will then compare the current catalog served from CISA's site with the cached one and both update the local cache and fire off a notification.

On macOS and linux, XDG_CACHE_HOME is used as the base cache directory, so the cache file is at ~/.cache/kev-cache/kev.json.

On Windows the base cache directory is %LOCALAPPDATA%, so the cache file is at (C:\\Users\\%USERNAME%\\AppData\\Local\\kev-cache\\kev.json).

Why?

This is intended to be more of an example crate than something you'd really want to use since you could replicate the functionality in a very small shell script.

Things it demonstrates:

  • Simple binary crate error handling (bubbling up to main()) with anyhow.
  • Using reqwest in blocking mode directly.
  • Using a third-party REST API crate (pushover) with environment variables.
  • JSON [de]serialization (via serde_derive) from URLs and files.
  • Platform/target-specific features, including common platform directories and (macOS notifications.
  • Customized rustfmt defaults.
  • A fairly comprehensive justfile, including recipes for:
    • (macOS) creating and code-signing universal binaries
    • SBOM + dependency graph creation
    • generating crate docs to docs/ for easy GH pages usage

Installation

cargo install --git https://github.com/hrbrmstr/kev-push --branch batman

Building (release)

Assuming you use Just:

git clone [email protected]:hrbrmstr/kev-push && \
	cd kev-push && \
	just release

Dependencies

deps

kev-push's People

Contributors

hrbrmstr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sec-js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.