Giter Club home page Giter Club logo

cve-bot's Introduction

CVE-BOT

Get notified about new CVEs right in your Discord server!

CVE Alert example

Bot usage

Invite the bot

Invite the bot to your Discord server using this link: https://discord.com/api/oauth2/authorize?client_id=1147880351901962300&permissions=2048&scope=bot%20applications.commands, if you choose to self host the bot, the link will be print to the stdout once the bot have started.

Required Discord permissions

All commands requires the user running them to have the "Administrator" permission, and all of them returns an ephemeral message that can only be seen by the user who ran it.

The bot needs the "Send Message" permission in channels with active subscriptions in order to send new alerts.

Subscribing to vendors and products

Use the commands /subscribe products or /subscribe vendor in the channel where you wish to receive alerts about new CVEs, you can specify multiple entries at once by separating them with a comma, and get some help with the built-in autocompletion.

subscribe products command example

Unsubscribing from vendors and products

To stop receiving alerts about a vendor or product in a channel, run in the channel the command /unsubscribe products or /unsubscribe vendor and specify the entries, you can specify multiple entries at once by separating them with a comma, and get some help with the built-in autocompletion.

unsubscribe vendor command example

You can also unsubscribe from all vendors or products at once by entering an asterisk (*)

unsubscribe from all vendors example

Changing the frontend URL

You can change at any time the base URL used for linking CVE IDs, vendor and products, remember that these changes will only take affect on new alerts. You can also specify a channel to change the URL only in the specified channel.

set opencve frontend command example

The bot will confirm the change, and will also provide a URL for you to test this new URL.

set opencve frontend command  output example

See current settings

Use the command /see-settings commands to see all the settings of your server, like the set OpenCVE frontend URL server-wide or for specific channels, and subscribed vendors and products . Settings page of subscribed products of a channel

Remember that there might be multiple pages and you can navigate them with the arrow buttons, these buttons will stop working 24 hours after not using them.

Additional considerations

If your Discord server is public, you may want to limit the visibility of the channel used to notify new CVEs, as a malicious user could actively watch for new CVEs affecting your software to exploit them.

Hover the channel with the mouse and click on the gear wheel icon.

Channel in the channel list of a Discord server with the mouse hovering the channel settings icon

Now click on the "Permissions" tab on the left side menu.

left side menu of a channel settings page with the permissions tab selected

And now toggle on the private channel. Private channel toggle toggled on

Finally, click the "Add members or roles" button, and check the roles or individual members you want to allow to see the CVEs, once you are done, you may click the "Done" button.

Role and members selector dialog

Self-host the bot (with docker)

Prerequisites

Download

Clone the repository (or download and extract it if you don't have git), and change directory to it

git clone [email protected]:eduardozgz/cve-bot.git
cd cve-bot

Configuration

Create a .env file (or you can copy it directly from .env.example) or set the environment variables to configure the bot

Variable Description
DISCORD_TOKEN The token of your discord bot
GUILD_TO_DEPLOY_APPLICATION_COMMANDS For development purposes, the Discord server ID where slash commands will be redeployed more quickly than globally, you can leave this blank
OPENCVE_DATABASE_URL The database URL of the OpenCVE's database instance
OPENCVE_DEFAULT_FRONTEND Base URL used to provide links to CVEs, vendors and products, defaults to https://www.opencve.io
DATABASE_URL The database URL where the bot's persistent configurations will be stored, it can be the same as OPENCVE_DATABASE_URL but changing the database name (e.g: postgres://opencve:opencve@opencve-postgres-instance/opencve -> postgres://opencve:opencve@opencve-postgres-instance/cve-bot)
POSTGRES_USER If you choose to deploy the database later with the provided docker-compose files, set here the username that will be used for storing the bot's persistent configurations, it can be anything like cve-bot
POSTGRES_PASSWORD If you choose to deploy the database later with the provided docker-compose files, set here the password that will be used for storing the bot's persistent configurations, it can be anything, but choose a secure password! If you choose to deploy the database later with the provided docker-compose files, set here the database name that will be used for storing the bot's persistent configurations, it can be anything like cve-bot

Run the bot

docker compose up -d

cve-bot's People

Contributors

eduardozgz avatar

Stargazers

Dvir avatar

Watchers

 avatar

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.