Skip to content

Conversation

@Sebitosh
Copy link
Contributor

Related Issue

#7

Description

Implements global cross-file and local per-file constants for use in the yaml schema

It turned out that there was more design decisions I hadn't thought of, so I propose some differences with the original specifications. Please give any feedback you may have on those changes, as I can adapt them easily if need be.

Definition syntax

Instead of defining constants like "objects" in a list:

- constant:
   - name: ONE
     value: 1

They are defined as key-value pairs:

ONE: 1

This is less cumbersome and more "yaml like", and thus preferable in my opinion.

Reference syntax

Originally, references would use @{...}@ separators, but it turns out@ is a reserved character in yaml and can't start a scalar. To try to avoid using characters reserved in both Yaml and SecLang for clarity, I used ~{...}~ as separator instead.

Types

Constants can be either any yaml scalar, lists or even dictionaries. This allows defining constants that can define whole subsections of the schema

Properties

There are multiple properties that were not clearly described in the specs, I tried to discuss the most important ones in the README section.

Signed-off-by: Sebitosh <soloplayerdiablo@gmail.com>
Signed-off-by: Sebitosh <soloplayerdiablo@gmail.com>
Copy link
Member

@airween airween left a comment

Choose a reason for hiding this comment

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

LGTM

@airween airween merged commit 9a4d1d1 into owasp-modsecurity:main Jan 15, 2025
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.

2 participants