Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -4
src/streamlit_app.py
CHANGED
|
@@ -266,7 +266,7 @@ with st.sidebar:
|
|
| 266 |
st.subheader("💡 批量分析指令")
|
| 267 |
analysis_prompt = st.text_area(
|
| 268 |
"針對每個 Log/Alert 執行的指令",
|
| 269 |
-
value="You are a security expert
|
| 270 |
height=200
|
| 271 |
)
|
| 272 |
st.markdown("此指令將對檔案中的**每一個 Log 條目**執行一次獨立分析 (使用 **IP 關聯視窗**)。")
|
|
@@ -604,20 +604,20 @@ if st.session_state.execute_batch_analysis and 'json_data_for_batch' in st.sessi
|
|
| 604 |
is_high = any(x in response.lower() for x in ['high-risk detected!'])
|
| 605 |
is_medium = any(x in response.lower() for x in ['medium-risk detected!'])
|
| 606 |
if is_high:
|
| 607 |
-
st.subheader(f"Log
|
| 608 |
with st.expander("序列內容 (JSON Format)"):
|
| 609 |
st.code(item["sequence_analyzed"], language='json')
|
| 610 |
st.error(item['analysis_result'])
|
| 611 |
st.markdown("---")
|
| 612 |
|
| 613 |
elif is_medium:
|
| 614 |
-
st.subheader(f"Log
|
| 615 |
with st.expander("序列內容 (JSON Format)"):
|
| 616 |
st.code(item["sequence_analyzed"], language='json')
|
| 617 |
st.warning(item['analysis_result'])
|
| 618 |
st.markdown("---")
|
| 619 |
else:
|
| 620 |
-
st.subheader(f"Log
|
| 621 |
with st.expander("序列內容 (JSON Format)"):
|
| 622 |
st.code(item["sequence_analyzed"], language='json')
|
| 623 |
st.info(item['analysis_result'])
|
|
|
|
| 266 |
st.subheader("💡 批量分析指令")
|
| 267 |
analysis_prompt = st.text_area(
|
| 268 |
"針對每個 Log/Alert 執行的指令",
|
| 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 |
)
|
| 272 |
st.markdown("此指令將對檔案中的**每一個 Log 條目**執行一次獨立分析 (使用 **IP 關聯視窗**)。")
|
|
|
|
| 604 |
is_high = any(x in response.lower() for x in ['high-risk detected!'])
|
| 605 |
is_medium = any(x in response.lower() for x in ['medium-risk detected!'])
|
| 606 |
if is_high:
|
| 607 |
+
st.subheader(f"Log #{item['log_id']} (HIGH RISK DETECTED)")
|
| 608 |
with st.expander("序列內容 (JSON Format)"):
|
| 609 |
st.code(item["sequence_analyzed"], language='json')
|
| 610 |
st.error(item['analysis_result'])
|
| 611 |
st.markdown("---")
|
| 612 |
|
| 613 |
elif is_medium:
|
| 614 |
+
st.subheader(f"Log #{item['log_id']} (MEDIUM RISK DETECTED)")
|
| 615 |
with st.expander("序列內容 (JSON Format)"):
|
| 616 |
st.code(item["sequence_analyzed"], language='json')
|
| 617 |
st.warning(item['analysis_result'])
|
| 618 |
st.markdown("---")
|
| 619 |
else:
|
| 620 |
+
st.subheader(f"Log #{item['log_id']} (NORMAL BEHAVIOR DETECTED)")
|
| 621 |
with st.expander("序列內容 (JSON Format)"):
|
| 622 |
st.code(item["sequence_analyzed"], language='json')
|
| 623 |
st.info(item['analysis_result'])
|