Cisco PSIRT is a web-based application that takes advantage of the Cisco PSIRT OpenVuln RESTful API to search for CVEs, show all its data, and related information from other sites, not only to easily identify the CVE and its workarounds (if provided) but also to get all possible solutions at one place and to be up to date with any security vulnerability.
This web app is your Google's search engine but for Cisco CVEs.
Important
On Mar 2, 2023, certain changes were made to the Cisco API console which will make all applications created prior to Mar 1, 2023 deprecated by Sep 30, 2023. More detailed instructions can be found here.
These changes are already applied to the code in this repo.
Disabled in development
)Tested on:
$ git clone https://github.com/Tes3awy/PSIRT.git
$ cd PSIRT
$ python3 -m venv .venv --upgrade-deps
$ source .venv/bin/activate
$ python3 -m pip install wheel
$ python3 -m pip install -r requirement.txt
config.py
next to wsgi.py
.$ cd PSIRT
$ touch config.py
$ sudo nano config.py
To be able to use PSI, you must register a Cisco API console application to get both CLIENT_ID
and CLIENT_SECRET
. And to register a Cisco PSIRT OpenVuln API application on Cisco API Console:
Service
.Client Credentials
.Cisco PSIRT openVuln API
.Register
.Copy both KEY
and CLIENT_ID
to config.py
config.py
.class Config(object): APP_ENV = "development" DEBUG = True TESTING = False BASE_URL = "https://apix.cisco.com/security/advisories/v2" # New URL CLIENT_ID = "<KEY>" # Key From https://apiconsole.cisco.com/apps/myapps CLIENT_SECRET = "<YOUR_CISCO_CLIENT_SECRET>" # CLIENT SECRET From https://apiconsole.cisco.com/apps/myapps # You can run: python -c 'import secrets; print(secrets.token_hex())' twice to get two secret keys for the following secret keys. SECRET_KEY = "<A_SECRET_KEY>" WTF_CSRF_SECRET_KEY = "<A_SECRET_KEY_FOR_WTF_FORMS>" RATELIMIT_STORAGE_URI = "memory://" class ProductionConfig(Config): APP_ENV = "production" DEBUG = False RATELIMIT_STORAGE_URI = "redis://localhost:6379" # Change to MongoDB or Memcached depending on your choice RATELIMIT_STRATEGY = "fixed-window" RATELIMIT_KEY_PREFIX = "PSI" RATELIMIT_IN_MEMORY_FALLBACK_ENABLED = True
$ cd PSIRT
$ flask run
You should get the development webserver up and running:
$ flask run -p 8080 -h 0.0.0.0
* Serving Flask app 'run.py'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8080
* Running on http://xxx.xxx.x.x:8080
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: xxx-xxx-xxx
localhost:8080/main
in your browser and you are ready to use the application.To deploy PSI in a production environment
Change the following line in psiapp/__init__.py
... def create_app(config_class=ProductionConfig): # this line app = Flask(__name__) ...
You can build and run the application in a Docker container
Config
with ProductionConfig
at line 19 in psiapp/__init__.py
$ cd PSIRT $ docker build --progress=plain --no-cache -t psirt:latest . $ docker run -d -p 80:80 --name psi psirt
localhost:80/main
(port 80 this time which is the default port for HTTP) in your browser and you are ready to use your production-ready dockerized application.You might want to create an virtual machine instead of a docker container. You can easily deploy the application as I have added Vagrantfile
, setup.sh
, nginx.conf
, supervisor.conf
which you can use to instantly deploy your application in an Ubuntu VM.
All you need have is Vagrant installed on your machine, and then run the following command.
Make sure you are using
ProductionConfig
in the__init__.py
script. (Can be done at any time)
$ cd PSIRT
$ vagrant up --provider vmware_desktop
If you are using VMware as your provider, make sure you have the VMware Utility
Once Vagrant finishes installation, you will get an IP address displayed in the terminal. Open that IP in you browser.
<output_truncated> default: Restarted supervisord default: 192.168.64.134
You can also deploy the app on Virtualbox. Run
vagrant up --provider virtualbox
instead
os - version
search form.Date Range
search form.Important
Some versions of Python (such as 3.10.x), may; or may not; raise
an ssl.SSLError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1131)
exception. It's crucial to handle this error in a proper way since it is considered a critical security and audit breaks for a Man-in-the-Middle attack if handled incorrectly.
You can carefully add the following line at the very bottom of
/etc/ssl/openssl.cnf
[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=2
Options = UnsafeLegacyRenegotiation # This line
And restart the webserver. This change will be removed if openssl is upgraded. Do it at your own risks!
Code provided as-is. No warranty implied or included. Use the code for production at your own risk.
Owner
Contributors
Categories
Products
Application Centric Infrastructure (ACI)PSIRTProgramming Languages
PythonJavaScriptHTMLLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community