NadiaBedhiafi commited on
Commit
1bc626f
·
verified ·
1 Parent(s): 71513f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -11,6 +11,12 @@ from transformers import pipeline
11
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
12
  #client = InferenceClient("google/gemma-1.1-7b-it")
13
 
 
 
 
 
 
 
14
 
15
  @spaces.GPU
16
  def respond(
@@ -49,6 +55,8 @@ def respond(
49
  prompt = """
50
  You are a cybersecurity analyst skilled in interpreting various types of logs resulting from different cyberattacks, including phishing, malware, advanced persistent threats, denial-of-service (DoS) and distributed denial-of-service (DDoS) attacks, man-in-the-middle (MitM) attacks, SQL injection attacks, and zero-day exploits. Using the following types of logs—login failures, event logs, firewall logs, and brute force logs—analyze the data and provide an interpretation of the analysis in English.
51
 
 
 
52
  Indicators to investigate:
53
 
54
  1. Multiple IP addresses signing in to the same account within a short period (e.g., 5 or more IPs in one hour).
@@ -68,7 +76,7 @@ Types of Indicators of Compromise (IOC) to consider:
68
  - Network Indicators: Irregular network traffic or connection patterns.
69
  - Behavioral Indicators: Activities that deviate from normal patterns.
70
 
71
- Response: Provide a detailed analysis and interpretation of the observed logs, focusing on identifying and explaining any potential security threats or breaches.
72
  """
73
 
74
  demo = gr.ChatInterface(
 
11
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
12
  #client = InferenceClient("google/gemma-1.1-7b-it")
13
 
14
+ def clean_string(input_string):
15
+
16
+ characters_to_remove = [',', '/', ':', '"',';','|','-','_']
17
+ cleaned_string = ''.join(char for char in input_string if char not in characters_to_remove)
18
+
19
+ return cleaned_string
20
 
21
  @spaces.GPU
22
  def respond(
 
55
  prompt = """
56
  You are a cybersecurity analyst skilled in interpreting various types of logs resulting from different cyberattacks, including phishing, malware, advanced persistent threats, denial-of-service (DoS) and distributed denial-of-service (DDoS) attacks, man-in-the-middle (MitM) attacks, SQL injection attacks, and zero-day exploits. Using the following types of logs—login failures, event logs, firewall logs, and brute force logs—analyze the data and provide an interpretation of the analysis in English.
57
 
58
+ **Important:** Do not use any information outside of the input provided. Focus solely on the data and indicators given in this prompt.
59
+
60
  Indicators to investigate:
61
 
62
  1. Multiple IP addresses signing in to the same account within a short period (e.g., 5 or more IPs in one hour).
 
76
  - Network Indicators: Irregular network traffic or connection patterns.
77
  - Behavioral Indicators: Activities that deviate from normal patterns.
78
 
79
+ Response: Provide a detailed analysis and interpretation of the observed logs, focusing on identifying and explaining only potential security threats or breaches. Ensure that your analysis is based solely on the information and indicators provided in this prompt.
80
  """
81
 
82
  demo = gr.ChatInterface(