Skip to content

Update libinjection & Mbed TLS #3161

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

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

eduar-hte
Copy link
Contributor

@eduar-hte eduar-hte commented May 31, 2024

what

Update third-party dependencies (included in others directory): libinjection & Mbed TLS.

why

The versions included in ModSecurity have not been updated in a while:

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@marcstern
Copy link

We should indeed update these libraries from time to time.
This PR dynamically uses the last version (master), right?
It seems they don't provide a release version. Do you (and other people contributing to this repo, I some some other ones) consider the master version as always stable?
Btw, the same should be done for v2 as well.

@eduar-hte
Copy link
Contributor Author

This PR dynamically uses the last version (master), right? It seems they don't provide a release version. Do you (and other people contributing to this repo, I some some other ones) consider the master version as always stable?

In both cases the PR references a specific commit hash in order to pin down the version included in libModSecurity until a new review and update is done.

With regards to libinjection, as the project is not currently tagged (the last tag is from 2017), I'm referencing the current head (libinjection/libinjection@b9fcaaf). Mbed TLS references the commit for tag 3.6.0 (git submodules don't currently support explicitly referencing a tag), Mbed-TLS/mbedtls@2ca6c28.

@airween
Copy link
Member

airween commented May 31, 2024

Hi @eduar-hte,

thanks again for this great PR!

Fortunately @fzipi is one of the maintainer/developer of libinjection project so I tagged him - may be he can help us.

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
Copy link
Member

airween commented Jul 10, 2024

Thanks @eduar-hte for this great work again.

A reminder to myself: add git submodule init and git submodule update commands to README.md.

@airween airween merged commit 7c174e9 into owasp-modsecurity:v3/master Jul 10, 2024
49 checks passed
@fzipi
Copy link
Contributor

fzipi commented Jul 10, 2024

What you normally do is use the checkout actions like this:

      - name: Checkout
        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
        with:
          submodules: recursive

That will bring you what you want.

@marcstern
Copy link

So, we should replace the hard-coded files in v2 with submodules as well, right?

@eduar-hte eduar-hte deleted the others-update branch July 17, 2024 00:51
@eduar-hte
Copy link
Contributor Author

What you normally do is use the checkout actions like this:
(...)

That's right, the submodules option simplifies checkout of the repository and also its submodules. However, I found out that the git describe command would not work when the submodules are initialized that way, so I replaced that (arguably simpler approach) with an additional step to do those steps manually as a workaround.

If you take a look at the build with the workaround, you'll see that the 'configure' step shows version info on MbedTLS & libInjection correctly:

 Mandatory dependencies
   + libInjection                                  ....v3.9.2-92-gb9fcaaf
   + Mbed TLS                                      ....v3.6.0
   + SecLang tests                                 ....a3d4405

However, if you look at an older build, you'll notice that the version information is missing:

 Mandatory dependencies
   + libInjection                                  ....
   + SecLang tests                                 ....a3d4405

@fzipi
Copy link
Contributor

fzipi commented Jul 17, 2024

Oh, for describe you might also want to use depth: 0

@eduar-hte
Copy link
Contributor Author

eduar-hte commented Jul 17, 2024

Oh, for describe you might also want to use depth: 0

You're right, fetch-depth: 0 works! (I thought I had tested that before going for the workaround 🤷‍♂️)

I just created a simple PR (#3185) to simplify the workflow again, thanks.

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.

4 participants