Skip to content

Ruby script that checks the end-of-security support dates for various software products by fetching data from https://endoflife.date. It compares those dates to the current date and sends email notifications via Gmail when products are approaching or have recently passed their end-of-security date.

Notifications You must be signed in to change notification settings

baurzhaan/end-of-sec

Repository files navigation

end-of-sec

A simple Ruby script that checks the end of security support dates for various software by fetching data from endoflife.date. It helps developers and sysadmins stay up to date on which software versions are still receiving security patches.

It sends notifications via email using a Gmail account configured with an app password, following the instructions: Setting up app passwords.

Installation

Clone the repository:

git clone https://github.com/your-username/end-of-sec.git
cd end-of-sec

Make sure the following files are present in the project folder:

  • end-of-sec.rb — the script itself
  • gmail_email_settings.env — Gmail credentials and configuration
  • products.csv — list of products to check, one per line

Usage

Run it with ruby end-of-sec.rb from the command line.

You can also run it from a cron job (see the crontab.txt.example)

Requirements

  • Ruby 3.x or newer (It may work with Ruby 2.x, but hasn’t been tested.)
  • Ruby standard & external libraries:
    • date
    • csv
    • httparty – for making HTTP requests
    • mail – for sending emails
  • Internet connection.

Required Files

These files must be present in the same folder as the script:

  • gmail_email_settings.env – contains Gmail credentials and config for sending email notifications (see the gmail_email_settings.env.example).
  • products.csv – list of products to check, one per line. The file is provided with the script. Uncomment the product lines which you want to get notified about.

Email Configuration File (gmail_email_settings.env)

This file stores Gmail account credentials and settings used by the script to send notification emails.

Variable Description
EMAIL_SMTP_SERVER SMTP server address
EMAIL_SMTP_SERVER_PORT SMTP server port
EMAIL_SMTP_SERVER_DOMAIN SMTP domain
EMAIL_AUTHENTICATION_TYPE Authentication method
EMAIL_CONTENT_TYPE Email content type and encoding
EMAIL_USERNAME Gmail account username (email address)
EMAIL_PASSWORD Gmail app password (not your regular password)
EMAIL_SUBJECT Subject line for the notification email
EMAIL_RECIPIENTS Comma-separated list of recipient email addresses
EMAIL_ALERT_DAYS_BEFORE Days before security support ends to trigger a notification
EMAIL_ALERT_DAYS_AFTER Days after security support ends to trigger a notification

Normally, you only need to modify these variables:

  • EMAIL_USERNAME — Gmail account username (email address)
  • EMAIL_PASSWORD — Gmail app password (not your regular password)
  • EMAIL_RECIPIENTS — Comma-separated list of recipient email addresses
  • EMAIL_ALERT_DAYS_BEFORE — Days before security support ends to trigger a notification
  • EMAIL_ALERT_DAYS_AFTER — Days after security support ends to trigger a notification

⚠️ Keep this file secure and never commit it to public repositories. Especially keep your password secure and avoid committing it publicly.

Keeping the Product List Up to Date

To ensure you're checking the latest data, you can recreate the products.csv file by running the create_products.csv.rb script.

Probably you would want to run it periodically (e.g., once every 7–10 days) using a cron job or other task scheduler.

Important

Make sure to uncomment the product lines you want notifications for.

Example:

ruby update_products_file.rb

License

This project is licensed under the MIT License.

Credits

Data provided by endoflife.date.

This script was created as part of a personal learning project to explore Ruby programming.

Proposals & Contributions

Feel free to open an Issue or start a Discussion if you have ideas for improvements or new features!

About

Ruby script that checks the end-of-security support dates for various software products by fetching data from https://endoflife.date. It compares those dates to the current date and sends email notifications via Gmail when products are approaching or have recently passed their end-of-security date.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages