Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class of prototype

L4 Transporter

Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class of prototype

Hi guys,

 

I'm dealing with a issue new to me, but perhaps somebody else has already resolved it. I built a new local IPv4 prototype based on the malwaredomainlist.ip. The configuration is:

 

age_out:
  default: null
  sudden_death: true
attributes:
  confidence: 95
  share_level: green
  type: IPv4
interval: 300
indicator:
  regex: ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})
  transform: \1
source_name: ag_log
url: http://xxx/static/log.txt

 

The point is, I only get the "__str__ returned non-string (TypeError)" error when I commit my configuration with the new node included, as shown the figure 1. The structure of the url mined is shown in figure 2. May be I'm wrong, but the miner is not being able to deal with the url mined, or the indicators mined. Am I wrong?

 

Thank you  in advanced.

Best regards.

 

L5 Sessionator

Re: Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class

@danilo.souza,

 

could you, please, take a look at the engine log (/opt/minemeld/log/minemeld-engine.log) and look for corresponding error messages?

 

Share them in the discussion to try identify the root cause.

 

But, in the meanwhile, you could try this alternative regex and template:

 

indicator:
  regex: .*((\s)+([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})).*
  transform: \3
L4 Transporter

Re: Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class

Hi @xhoms

 

I created a new prototype based in the regex you sent, but I got the same behaviour. I'm adding a figure with the  extract of the log related with this node specifically. Do you see anything relevant? I don't. May be certificate in the URL mined?

 

Best regards.

L5 Sessionator

Re: Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class

@danilo.souza, something is preventing MineMeld from successfully reaching the URL providing the feed. Could you, please, run the shell command curl <URL> from the OS hosting MineMeld to verify you can reach the feed?

L4 Transporter

Re: Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class

Hi @xhoms,

 

I think I was right. The problem seems to be with the certificate. Look what I get (figure) running the shell command curl <URL>. My machine doesn't belive in the certificate chain. Is it?

 

Best regards.

 

L5 Sessionator

Re: Getting "__str__ returned non-string (TypeError)" for a minemeld.ft.http.HttpFT class

You're right. MineMeld is not trusting the certificate of your feed. The Python engine MineMeld relies on has its own certificate store. So, if you want to import the certificate chain of your feed then you must import it onto Python's trust store (not your host trust certificate store).

 

Another option is to set the "verify_cert" class configuration attribute to false.

 

Both options explained bu Luigi in the following response https://live.paloaltonetworks.com/t5/MineMeld-Discussions/Minemeld-SSL-Certificates/m-p/113561/highl...

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!