Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Import required libraries
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import pandas as pd
|
| 4 |
+
|
| 5 |
+
def main():
|
| 6 |
+
# Application title
|
| 7 |
+
st.title("Vulnerability Management Dashboard")
|
| 8 |
+
|
| 9 |
+
# File uploader allows user to add their own CSV
|
| 10 |
+
uploaded_file = st.file_uploader("Upload your vulnerability scan result (CSV format)", type="csv")
|
| 11 |
+
|
| 12 |
+
if uploaded_file is not None:
|
| 13 |
+
# Use pandas to read the CSV file
|
| 14 |
+
df = pd.read_csv(uploaded_file)
|
| 15 |
+
|
| 16 |
+
# Display the DataFrame. This could be replaced with a more sophisticated approach.
|
| 17 |
+
st.dataframe(df)
|
| 18 |
+
|
| 19 |
+
# Example: Display vulnerabilities by severity if your CSV contains a 'Severity' column
|
| 20 |
+
if 'Severity' in df.columns:
|
| 21 |
+
st.subheader("Vulnerabilities by Severity")
|
| 22 |
+
severity_count = df['Severity'].value_counts()
|
| 23 |
+
st.bar_chart(severity_count)
|
| 24 |
+
|
| 25 |
+
# Add more features like filtering based on columns, detailed analysis, etc.
|
| 26 |
+
|
| 27 |
+
if __name__ == "__main__":
|
| 28 |
+
main()
|