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

README/help: add info on IPS mode tests creation - v1 #1955

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Or to run a single test:

- Create a directory that is the name of the new test.

If you want a test to run in IPS mode, add `ips` to the test name
this will make `--simulate-ips` command-line argument be passed when
the test is run.

- Copy a single pcap file into the test directory. It must end in
".pcap".

Expand Down Expand Up @@ -200,6 +204,8 @@ directory.

positional arguments:
<test-name> Name of the test folder
Add `ips` to the test name if you want it to run in IPS mode
the test is run.
Comment on lines +207 to +208
Copy link
Member

Choose a reason for hiding this comment

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

nits:

  1. I'm realizing this README output is quite mature than the actual help output of the script. Maybe we should make it consistent. wdyt?
  2. Help outputs are generally supposed to be one liners w minimal info. Should such additional info stay in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nits:

1. I'm realizing this README output is quite mature than the actual help output of the script. Maybe we should make it consistent. wdyt?

Agreed!

2. Help outputs are generally supposed to be one liners w minimal info. Should such additional info stay in the docs?

I still think that this info should be outputted when we have the help, as I can imagine people would often first refer to the help output before going to the documentation. I can try to make it more concise, somehow, then.

<pcap-file> Path to the PCAP file

optional arguments:
Expand Down Expand Up @@ -252,6 +258,15 @@ newer:
--rules ../suricata-verify/tests/no-payload-output/test.rules test-02 input.pcap
```

#### Example 3

Create a Suricata-verify test named ``ips-drop-rule`` that will run over a pcap file
called ``input.pcap``, match its traffic against the rules in the ``ips-test.rules``
file and will have Suricata run the test in IPS mode:
```
../suricata-verify/createst.py --rules ../Documents/ips-test.rules ips-drop-rule input.pcap
```

#### Add Required Features

```
Expand Down
2 changes: 1 addition & 1 deletion createst.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def parse_args():
description="Create tests with a given PCAP. Execute the script"
" from a valid Suricata source directory.")
parser.add_argument("test-name", metavar="<test-name>",
help="Name of the test folder")
help="Name of the test folder. Add `ips` to the test name if you want it to run in IPS mode.")
parser.add_argument("pcap", metavar="<pcap-file>",
help="Path to the PCAP file")
parser.add_argument("--rules", metavar="<rules>",
Expand Down
Loading