Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds project suricata #2533

Merged
merged 4 commits into from
Mar 27, 2020
Merged

Adds project suricata #2533

merged 4 commits into from
Mar 27, 2020

Conversation

catenacyber
Copy link
Contributor

Asked in #624

The code is not yet merged in suricata main repository cf OISF/suricata#3914

MSAN is not yet enabled because of Rust and C interactions cf #2145 (comment)

@victorjulien could you ack ?

cc @kcc as you seemed interested in rust targets

@catenacyber
Copy link
Contributor Author

Travis seems to fail because my corpus building bash magic is too verbose...

For instance, we have a corpus of about 50 000 rules and it gets computed with
cat *.rules | while read l; do echo $l > corpus/$i.rule; i=$((i+1)); done
https://github.com/google/oss-fuzz/pull/2533/files#diff-7507477856b797ccae1de19abe792c2bR64

What should we do about it ?

@inferno-chromium
Copy link
Collaborator

Can you redirect that output to >/dev/null. Log output is good to be readable. For future build breaks, it will make debugging harder with such big logs.

@catenacyber
Copy link
Contributor Author

Just like that ?

@inferno-chromium
Copy link
Collaborator

Just like that ?

You can verify locally with infra/helper.py.

@catenacyber
Copy link
Contributor Author

You can verify locally with infra/helper.py.

Yes, it is running...

@catenacyber
Copy link
Contributor Author

This does not seem to work.
Actually, the command cat *.rules | while read l; do echo $l > corpus/$i.rule; i=$((i+1)); done does not print any output.
But it executes many subcommands that get logged :

+ echo alert tcp '$HOME_NET' any '->' '$EXTERNAL_NET' 23 '(msg:"ET' EXPLOIT Zollard PHP Exploit Telnet 'Outbound";' 'flow:to_server,established;' 'content:"/var/run/.zollard/";' 'reference:url,deependresearch.org/2013/12/hey-zollard-leave-my-internet-of-things.html;' 'classtype:attempted-user;' 'sid:2017800;' 'rev:2;' metadata:created_at 2013_12_04, updated_at '2013_12_04;)'
+ i=15343
+ read l
+ echo
+ i=15344
+ read l
+ echo alert tcp '$EXTERNAL_NET' any '->' '$HOME_NET' 23 '(msg:"ET' EXPLOIT Zollard PHP Exploit Telnet 'Inbound";' 'flow:to_server,established;' 'content:"/var/run/.zollard/";' 'reference:url,deependresearch.org/2013/12/hey-zollard-leave-my-internet-of-things.html;' 'classtype:attempted-user;' 'sid:2017799;' 'rev:2;' metadata:created_at 2013_12_04, updated_at '2013_12_04;)'
+ i=15345
+ read l
+ echo
+ i=15346
+ read l

So, I am trying something else

Copy link
Contributor

@Dor1s Dor1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good, but I don't see @victorjulien on the upstream contributors page: https://github.com/OISF/suricata/graphs/contributors

I do see Victor at this page though: https://github.com/orgs/OISF/people

So awaiting on the confirmation :)

@@ -0,0 +1,34 @@
# Copyright 2018 Google Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2019

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the other files as well :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


# build corpuses
# default configuration file
zip -r $OUT/fuzz_confyamlloadstring_seed_corpus.zip suricata.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is suricata.yaml a directory? If not, are there any other potential seed inputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is suricata.yaml a directory?

No this is a single file (the default configuration)
I do not think of other available inputs...

@catenacyber
Copy link
Contributor Author

I don't see @victorjulien on the upstream contributors page: https://github.com/OISF/suricata/graphs/contributors

He is the main contributor but as his profile says https://github.com/inliniac moved to https://github.com/victorjulien

@victorjulien
Copy link

Please hold on this. I would like to make sure we have the necessary support merged in our git repo first. Also, due to team availability over the summer, it would work a lot better for us to start this in the fall.

@TravisBuddy
Copy link

Hey @catenacyber,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: ecffb3d0-53b8-11ea-b4ca-9b1f8367601b

@catenacyber
Copy link
Contributor Author

@victorjulien could you approve this now that we merged the fuzz targets in upstream Suricata repository ? Thanks :-)

@catenacyber
Copy link
Contributor Author

Still needs OISF/suricata#4732 before merging

@victorjulien
Copy link

I have just merged OISF/suricata#4732, so upstream is ready.

Approved from the Suricata project.

@TravisBuddy
Copy link

Travis tests have failed

Hey @catenacyber,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 96181f70-6ff7-11ea-8e1c-9749656638a8

@TravisBuddy
Copy link

Hey @catenacyber,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: c76e4060-6ffa-11ea-8e1c-9749656638a8

@Dor1s Dor1s merged commit 522e7dc into google:master Mar 27, 2020
@catenacyber
Copy link
Contributor Author

Thanks @Dor1s

The language is actually C and Rust
How does this new attribute matter ?

@Dor1s
Copy link
Contributor

Dor1s commented Mar 27, 2020

C or C++ doesn't matter, we use C++ by default as libFuzzer is C++ and is linked in :) I think fuzz targets are written in C, so Rust value is not really applicable here?

@Dor1s
Copy link
Contributor

Dor1s commented Mar 27, 2020

How does this new attribute matter ?

As of now it just skips coverage job for non C/C++ projects, but in future it will guide other pieces of OSS-Fuzz such as bad build checks, srcmap generation, and others. See #3297 and #3477 if you're curious to learn more :)

@catenacyber
Copy link
Contributor Author

I think fuzz targets are written in C, so Rust value is not really applicable here?

I do not know. The C fuzz targets call Rust code at some points

As of now it just skips coverage job for non C/C++ projects

Hope you have time to review #3142 soon ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants