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

Add YML configuration parsing #71

Open
6 tasks
alexkiro opened this issue Jan 5, 2017 · 0 comments
Open
6 tasks

Add YML configuration parsing #71

alexkiro opened this issue Jan 5, 2017 · 0 comments

Comments

@alexkiro
Copy link
Contributor

alexkiro commented Jan 5, 2017

We should add a new configuration mode for parsing rules that is more easily parsed and is a standing standard YML, e.g. a GTUBE rule:

body GTUBE      /XJS\*C4JDBQADN1\.NSBN3\*2IDNEN\*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL\*C\.34X/
describe GTUBE  Generic Test for Unsolicited Bulk Email
score GTUBE     1000

Would become:

GTUBE:
 type: body
 value: /XJS\*C4JDBQADN1\.NSBN3\*2IDNEN\*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL\*C\.34X/
 score: 1000
 desc: Generic Test for Unsolicited Bulk Email

  • This should generate the results dictionary that we generate in the parser that is required by the ruleset
  • This should also cover the configuration options an all of its types
  • A script should be created that converts the old configuration into the new YML version
  • Before the configuration is parsed as an YML file we should interpolate it as a Jinja Template to cover cases where {% if commands are involved (similar to what SA has)
  • The exiting system should still be in place so the parse should determine if it is required to parse it in the old format instead of the new format
  • All tests should be ran under both types of configurations and the converter script should be used to change from the old config to the new one (similar to what we do with the compile script now and the USE_PICKLES flag.
cosmingrz added a commit that referenced this issue Mar 11, 2017
cosmingrz added a commit that referenced this issue Mar 11, 2017
- Treat some edge cases
- Repair `convert_cf_to_yaml.py` script
- Make tests able to run with both setups (yaml and standard configs)
- Treat `.yml` as `.pre` and `.yaml` as `.cf` files for conversion and parse script
cosmingrz added a commit that referenced this issue Mar 11, 2017
- Adjust `.travis.yml` to run tests under both types of configurations
cosmingrz added a commit that referenced this issue Mar 11, 2017
- Modify `.travis.yml` for debug purposes
- Modify conversion script to work with relative paths
cosmingrz added a commit that referenced this issue Mar 11, 2017
- Modify `.travis.yml` for debug purposes
cosmingrz added a commit that referenced this issue Mar 11, 2017
Use isinstance for type comparison
Catch possible key error
cosmingrz added a commit that referenced this issue Mar 11, 2017
cosmingrz added a commit that referenced this issue Mar 11, 2017
cosmingrz added a commit that referenced this issue Mar 11, 2017
…e tests are running by default using USE_YAML=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant