CodeMode / app.py
awacke1's picture
Create app.py
528fd6b verified
raw
history blame
3.18 kB
import streamlit as st
import pandas as pd
import subprocess
# Create the data
data = {
"Reference": ["Motlagh et al.", "Divakaran et al.", "Yao et al.", "Yigit et al.", "Coelho et al.", "Novelli et al.", "LLM4Security"],
"Year": [2024, 2024, 2023, 2024, 2024, 2024, 2024],
"Scope": ["Security application", "Security application", "Security application, Security of LLM", "Security application, Security of LLM", "Security application", "Security application", "Security application"],
"Dimensions": ["Task", "Task", "Model, Task", "Task", "Task, Domain specific technique", "Task, Model, Domain specific technique", "Model, Task, Domain specific technique, Data"],
"Time frame": ["2022-2023", "2020-2024", "2019-2024", "2020-2024", "2021-2023", "2020-2024", "2020-2024"],
"Papers": ["Not specified", "Not specified", 281, "Not specified", 19, "Not specified", 127]
}
# Streamlit UI
st.title("πŸ”’ LLMs for Cyber Security: State-of-the-Art Surveys")
st.write("This app is based on the paper: [Large Language Models for Cyber Security](https://arxiv.org/pdf/2405.04760v3). It showcases LLMs in the cybersecurity landscape.")
# Display the table
df = pd.DataFrame(data)
st.write(df)
# Mermaid graph visualization for LLM in security
mermaid_code = '''
graph TD;
A[LLMs in Security] --> B[Security Application]
B --> C[Task]
B --> D[Model]
D --> E[Domain-Specific Techniques]
E --> F[Data]
'''
st.subheader("πŸ›‘οΈ Security Model Visualization with Mermaid")
st.markdown(f"```mermaid\n{mermaid_code}\n```")
# Scrollable content for additional insights
st.markdown("""
<style>
.scrollable-content {
height: 200px;
overflow-y: scroll;
}
</style>
<div class="scrollable-content">
<h3>Scroll Through for More Insights:</h3>
<ul>
<li>2022-2023: Not specified by Motlagh et al.</li>
<li>2020-2024: Yigit and Divakaran focusing on tasks and models.</li>
<li>Coelho introduces domain-specific techniques from 2021 to 2023.</li>
</ul>
</div>
""", unsafe_allow_html=True)
# Simulate running a security audit using pip-audit
st.subheader("πŸ” Run Python Dependency Security Audit")
# Define a button for auditing
if st.button('Run pip-audit for Security Check'):
with st.spinner('Running security audit...'):
result = subprocess.run(['pip-audit'], capture_output=True, text=True)
st.code(result.stdout)
# AI Tips for Reducing Security Risks with Pair Programming
st.subheader("πŸ€– AI Pair Programming: Security Recommendations")
st.markdown("""
- **Reduce Code Complexity**: AI can recommend code simplification strategies.
- **Minimize Attack Surface**: AI can simulate attacks and highlight vulnerable points.
- **Automate Security Scans**: Use tools like `pip-audit` for continuous CVE checks.
""")
# Add Azure deployment details (not operational in this demo)
st.subheader("Azure Deployment Information")
st.write("""
- **Azure Container Apps**: Easily deploy and scale your app with Azure Container Apps.
- **Azure Container Registry**: Store and manage container images.
- **Cosmos DB**: Use Cosmos DB to store security audit results and logs.
""")