Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -4
src/streamlit_app.py
CHANGED
|
@@ -249,7 +249,7 @@ with st.sidebar:
|
|
| 249 |
|
| 250 |
# === 1. 批量分析檔案 (支援多種格式) ===
|
| 251 |
batch_uploaded_file = st.file_uploader(
|
| 252 |
-
"1️⃣ 上傳 **Log
|
| 253 |
type=['json', 'csv', 'txt', 'log'], # <--- 這裡增加了 'log'
|
| 254 |
key="batch_uploader",
|
| 255 |
help="支援 JSON (Array), CSV (含標題), TXT/LOG (視為 W3C 或一般 Log)"
|
|
@@ -265,7 +265,7 @@ with st.sidebar:
|
|
| 265 |
|
| 266 |
st.subheader("💡 批量分析指令")
|
| 267 |
analysis_prompt = st.text_area(
|
| 268 |
-
"針對每個 Log
|
| 269 |
value="You are a security expert tasked with analyzing logs related to Initial Access, Establish Foothold & Reconnaissance, Lateral Movement, Targeting & Data Exfiltration, Malware Deployment & Execution and Ransom & Negotiation. Respond with a clear, structured analysis using the following mandatory sections: \n\n- Priority: Provide the overall priority level. (Answer High-risk detected!, Medium-risk detected!, or Normal-Behavior detected! only) \n- Explanation: If this log is not normal behavior, explain the potential impact and why this specific log requires attention. If not, **omit the explanation section**. \n- Action Plan: If this log is not normal behavior, What should be the immediate steps to address this specific log? If not, **omit the action plan section**.",
|
| 270 |
height=200
|
| 271 |
)
|
|
@@ -680,7 +680,7 @@ if st.session_state.get("batch_results") and isinstance(st.session_state.batch_r
|
|
| 680 |
with report_container:
|
| 681 |
# 顯示 High-Risk 報告的下載按鈕 (改為 CSV 邏輯)
|
| 682 |
if high_risk_items:
|
| 683 |
-
st.success(f"✅ 檢測到 {len(high_risk_items)} 條高風險 Log
|
| 684 |
|
| 685 |
# --- 構建 CSV 內容 ---
|
| 686 |
csv_output = io.StringIO()
|
|
@@ -799,5 +799,5 @@ if st.session_state.get("batch_results") and isinstance(st.session_state.batch_r
|
|
| 799 |
st.markdown(download_url, unsafe_allow_html=True)
|
| 800 |
|
| 801 |
else:
|
| 802 |
-
st.info("👍 未檢測到任何標註為 High-risk detected 的 Log
|
| 803 |
|
|
|
|
| 249 |
|
| 250 |
# === 1. 批量分析檔案 (支援多種格式) ===
|
| 251 |
batch_uploaded_file = st.file_uploader(
|
| 252 |
+
"1️⃣ 上傳 **Log 檔案** (用於批量分析)",
|
| 253 |
type=['json', 'csv', 'txt', 'log'], # <--- 這裡增加了 'log'
|
| 254 |
key="batch_uploader",
|
| 255 |
help="支援 JSON (Array), CSV (含標題), TXT/LOG (視為 W3C 或一般 Log)"
|
|
|
|
| 265 |
|
| 266 |
st.subheader("💡 批量分析指令")
|
| 267 |
analysis_prompt = st.text_area(
|
| 268 |
+
"針對每個 Log 執行的指令",
|
| 269 |
value="You are a security expert tasked with analyzing logs related to Initial Access, Establish Foothold & Reconnaissance, Lateral Movement, Targeting & Data Exfiltration, Malware Deployment & Execution and Ransom & Negotiation. Respond with a clear, structured analysis using the following mandatory sections: \n\n- Priority: Provide the overall priority level. (Answer High-risk detected!, Medium-risk detected!, or Normal-Behavior detected! only) \n- Explanation: If this log is not normal behavior, explain the potential impact and why this specific log requires attention. If not, **omit the explanation section**. \n- Action Plan: If this log is not normal behavior, What should be the immediate steps to address this specific log? If not, **omit the action plan section**.",
|
| 270 |
height=200
|
| 271 |
)
|
|
|
|
| 680 |
with report_container:
|
| 681 |
# 顯示 High-Risk 報告的下載按鈕 (改為 CSV 邏輯)
|
| 682 |
if high_risk_items:
|
| 683 |
+
st.success(f"✅ 檢測到 {len(high_risk_items)} 條高風險 Log。")
|
| 684 |
|
| 685 |
# --- 構建 CSV 內容 ---
|
| 686 |
csv_output = io.StringIO()
|
|
|
|
| 799 |
st.markdown(download_url, unsafe_allow_html=True)
|
| 800 |
|
| 801 |
else:
|
| 802 |
+
st.info("👍 未檢測到任何標註為 High-risk detected 的 Log。")
|
| 803 |
|