Commit Graph

114 Commits (4175680a8a1c0dfaa491ee63d6e36c011d498473)

Author SHA1 Message Date
Jason Ish 5ebae1e8ed clang-format.sh: prefer clang-format-14
Add clang-format-14 as the preferred version, this is the default on
Ubuntu 22.04.
1 year ago
Philippe Antoine 0b6b015e26 output/alert: rewrite code for app-layer properties
Especially fix setup-app-layer script to not forget this part

This allows, for simple loggers, to have a unique definition
of the actual logging function with the jsonbuilder.
This way, alerts, files, and app-layer event can share the code
to output the same data.

Ticket: #3827
1 year ago
Victor Julien 8e5e9a289b scripts: fix bundle script spelling
Thanks to Josh Soref.
2 years ago
Victor Julien fe867a302c scripts: spelling 2 years ago
Juliana Fajardini dc71faaa8a scripts/clang: remove mention to rewrite-branch
Although we prefer that formatting changes (e.g. the ones made by
running clang) go in a different commit, our script error message was
still suggesting `rewrite-branch` as an option. Removed that and added
that the changes made by the script should go into a separate commit.
2 years ago
Philippe Antoine 6b9fce7728 app-layer: shorter code for proto string helpers 2 years ago
Philippe Antoine e1046239ea scripts: fix setup app layer for output
using rust nowadays.

Also remove useless code about files that do not need changes
anymore
2 years ago
Philippe Antoine 5b2605bdfe debug: use AppProtoToString
instead of recoding it.
This way, setup-app-layer.py needs to patch one file less
2 years ago
Jason Ish 76c71a9120 bundle.sh: allow a PR # to be specified
Allow pull requests (and merge requests) to be specified by using a
branch name like "pr/111" or "mr/222". This allows CI to use this
script as well, instead of multiple variations of the same thing.

Additonally allow the destination directory to be overridden with the
DESTDIR environment variable.
2 years ago
Shivani Bhardwaj 21edf136a5 scripts: fix app-layer-protos.c setup
After the changes in the script in 05e16820de, the file
app-layer-protos.c was to be modified properly iff it was left unformatted.
However, the file was also formatted as a part of the same commit making
the lines split which broke the output of the script. Fix that by
looking for another pattern and changing the lines following that.
2 years ago
Jason Ish 0bb4546af4 setup-app-layer: rustfmt new rust files 2 years ago
Jason Ish 0b2d0324e5 setup-app-layer: set copyright year to current year
Ticket: 4939
2 years ago
Jason Ish 05e16820de templates: clang format cleanups
Cleanup the trivial clang-formatting issues in templates.  Length of
protocol names may require clang-format after new protocol generation.
2 years ago
Jason Ish 712d80107f setup-app-layer: remove generator for C parsers
Ticket: 4939
2 years ago
Jason Ish 50a787a9a3 app-layer-template-rust: remove C app-layer stub
Remove the app-layer-PROTO stub for Rust based parsers.  It is no longer
needed as Rust parsers now contain the registration function in Rust.

Ticket: 4939
2 years ago
Philippe Antoine 62352ad030 src: fix remaining cppclean warnings 2 years ago
Jason Ish a5d66a7452 bundle.sh: comment line fixup
Accept lines that start with a hash, but not immediately followed by a
space as a comment as well.
3 years ago
Philippe Antoine e69e99f820 ci: checks include are necessary in github 3 years ago
Philippe Antoine 025b510cac detect: use generic integer functions for template2 3 years ago
Jason Ish cd42c33195 scripts/bundle: use git instead of tar.gz
To better fit with our current CI processes, use git to clone the
suricata-update and libhtp dependencies.  The requirements.txt file has
been modified to take a repo URL and a `-b` command line option for tag
or branch.

For the master branch we will use the libhtp 0.5.x branch and the
suricata-update master branch.

Also allows for repo and branch names to be overrided with environment
variables:
- SU_REPO
- SU_BRANCH
- LIBHTP_REPO
- LIBHTP_BRANCH
3 years ago
Juliana Fajardini 67af1504b3 devguide: drop use of mscgen script in builds/make
Currently, it seems easier to upload the diagram images to git than to
try to make the image generation script work with out of the tree builds
and other corner cases.

This means, however, that one must activelly remember to update msc
diagram files, run the script and re-add new png files, if those ever
need to be updated. To raise awareness to that, a watermark was added
to the diagram images.

Also removed configuration steps that added mscgen as dependency
(locally and for workflow builds and readthedocs).
3 years ago
Victor Julien 08346cb239 dnp3: update gen script to use jb_set_string_from_bytes
Bug: #5080.
3 years ago
Jason Ish 6392216f6b base64: use the Rust base64 encode implementation
Replace our internal base64 implementation with a ffi wrapper
around the Rust implementation provided by an external crate.
3 years ago
Jason Ish 6d3dcf27a6 eve: use JsonBuilder for encoding base64
Replaces all usages of Base64Encode just before writing to a
JsonBuilder with jb_set_base64 and jb_append_base64.
3 years ago
Philippe Antoine 86b5c81ea2 dnp3: fix int warnings
There is a hack to know the type of an integer
and do an explicit cast in the python script
generating the C file

Also extends some bounds check against negative values
3 years ago
Jason Ish 16a21d7839 scripts: bundle script for requirements
Add a bundle.sh script to bundle the requirements of libhtp
and suricata-update. This uses a Python like requirements.txt
file to specify the URL to download for libhtp and suricata-update.
4 years ago
Philippe Antoine 126a7dcb4f dnp3: adds bounds check for prefix chararray
Ticket: #4558
Avoids intra structure overflow
4 years ago
Philippe Antoine 5ec9688f03 dnp3: use base64 macro in gen script
As is done already in C
cf commit ea0936199d
4 years ago
Juliana Fajardini c6a35d09b7 templates: fix typos
- *template*files[ch][rs]: fix typos
- scripts/setup-app-layer: fix typos
4 years ago
Juliana Fajardini 4748826dc7 scripts/setup-app-layer: fix Makefile.am patch
adjust lines for patching /src/Makefile.am, as current generated
Makefile wasn't building Suricata.
Add suggestion to run "./configure" before running "make".
Add --logger and --parser options to examples.
4 years ago
Philippe Antoine 15980af7de dnp3: avoids DOS by too long loop over null-sized objects 4 years ago
Philippe Antoine 5749024e3f dnp3: fix memory leak with object containing bytearrays 4 years ago
Philippe Antoine 001350547a dnp3: fix signed integer overflow
By using unsigned integers everywhere
4 years ago
Danny Browning ac37fd5e29 tools: bash from env
Use of hardcoded bash prevents users from using an upgraded bash which may
live in a different location. This behavior is often seen on OSX systems.

Utilize env to find the preferred bash to call for scripts.
4 years ago
Jason Ish 13049ae09d scripts/setup-app-layer: fix rust generation
Fix Rust app-layer generation. Main parser file was being named
gopher.rs instead of the name of the protocol.
4 years ago
Roland Fischer 69ed6f253f util: Add clang-format helper script 5 years ago
Jason Ish 85eaa2276c scripts/dnp3-gen: update to generate JsonBuilder code 5 years ago
Jason Ish 4976afd96a script/dnp3-gen: update generator to reflect in tree changes
Some changes were made to the generated files instead of the
generator script. Update the script to generate what is
in the current state of the in-tree generated files.
5 years ago
Philippe Antoine 293eebd999 fuzz: remove obsolete AFL code 5 years ago
Philippe Antoine 492504cf62 python: remove unused imports 5 years ago
Victor Julien edd2cd626f jansson: remove HAVE_LIBJANSSON guards 5 years ago
Jason Ish c1238af3e0 check-setup: fix script names for .sh to .py 6 years ago
Victor Julien 0b5a2ab49b setup-app-layer: support tests in tests/ 7 years ago
Jason Ish 7ec7d85ecc setup-app-layer.py: integrate detect buffer setup
Add --detect to setup a detect buffer.

Obsoletes setup-app-layer-detect.sh.
7 years ago
Jason Ish 15922dcd8c setup-app-layer.py: attempt to cd into correct directory
- If in src, cd to ..
- Error out early if the current directory does not look like a
  Suricata source directory.
7 years ago
Victor Julien 789b1474ed detect/template2: setup script 7 years ago
Victor Julien 5ed7e4fb5f setup-app-layer-detect: update for tests/ dir 7 years ago
Victor Julien 452355bb63 setup-simple-detect: update for new tests location 7 years ago
Jason Ish 9da00bebf0 scripts/setup: remove 'ed' based setup scripts
Removes:
- setup-app-layer.sh
- setup-app-layer-logger.sh

These have been replaced by setup-app-layer.py.
7 years ago
Jason Ish e232fcc415 setup-app-layer: rewrite script in Python
The idea being that it is easier to read and maintain than
wrapping ed commands.

This script also merges the parser and logger setup into a single
script, but still allows just the parser, or just the logger
to be generated with flags, --logger and --parser.
7 years ago