Граф коммитов

1993 Коммитов

Автор SHA1 Сообщение Дата
Anurag Kishore 980561c40a Change handling of invalid request body
### modsecurity.h
* Standardize body parser return codes

### msc_json.c, msc_xml.c
* Return special error code on body parsing failure

### msc_reqbody.c, apache2_io.c, mod_security2.c
* Change body parsing error codes to refer to constants
  defined in header.
2022-01-25 16:40:21 +05:30
tejasshah7 a6ad396dda
Merge pull request #178 from microsoft/akishore/feature/ci
Add Github Action for CI
2022-01-24 13:05:03 -08:00
Anurag Kishore 44eb151d6d Add Github Action for CI
This commit adds a github action to try to run make on every PR for CI purposes. It is meant to replace the travis-ci setup.

### new file:    .github/workflows/main.yml
* Triggers set to pushes and pull_requests for waf_nginx branch
* Logs into Azure Container Registry to fetch build environment container image
* Runs make commands inside the docker-compose generated environment

### new file:   .github/workflows/tests.yml
* Triggers set to pushes and pull requests for waf_nginx branch
* Starts IIS and publishes modsec package to IIS
* Runs ftw tests on IIS with modsec.
* Set ftw version to v1.1.7 specifically in the buildscript

### modified:   iis/build_dependencies.bat
* Remove hardcoded path for 7-zip.
  7zip is dynamically managed by the build.

### modified:   iis/build_release_amd64.bat
* Change vcvars path for VS 2019 compatibility.
  Older versions aren't available on Github Actions.

### deleted:   appveyor.yml, .travis.yml
* Delete files. The contents have been translated to github actions.
2022-01-24 18:49:39 +05:30
karanbazaz 724e856c40
Merge pull request #170 from microsoft/kabazaz/waf_latency_metrics
Calculating waf latency metric for modsecurity
2021-02-04 04:55:13 +05:30
karanbazaz 54fd889ee5
Merge branch 'waf_nginx' into kabazaz/waf_latency_metrics 2021-02-04 03:57:02 +05:30
karanbazaz f23dde9401
Merge pull request #174 from microsoft/kabazaz/update_binary_doc
Update BUILD.md to add extra dependency binary location
2021-02-04 02:44:19 +05:30
Karan Bazaz 0fc01422dd Retrigger the CICD pipeline 2021-02-04 02:18:56 +05:30
karanbazaz d989e25f22
Update BUILD.md 2021-02-04 02:00:13 +05:30
karanbazaz de7c31cf0c
Update BUILD.md 2021-02-04 01:56:48 +05:30
karanbazaz 718590901c
Adding binary dependencies (#172)
Co-authored-by: Karan Bazaz <kabazaz@microsoft.com>
2021-02-03 12:04:54 -08:00
Karan Bazaz 9a2769059e Run again the CICD pipeline 2021-02-03 04:16:20 +05:30
Karan Bazaz ab299b4abf Testing the CICD pipeline 2021-02-03 04:03:11 +05:30
Karan Bazaz 640ad15cbc rerunning the CICD pipeline 2021-02-03 02:37:54 +05:30
Karan Bazaz 9b5523a46e Fixing some minor issues 2021-02-02 04:54:12 +05:30
Karan Bazaz d1dfd86671 Addresed code review comments 2021-01-29 04:18:53 +05:30
Karan Bazaz 642ed0b4dc Addresed code review comments 2021-01-29 04:08:49 +05:30
Karan Bazaz 5e8fcbda14 Fixing code review comment 2021-01-26 04:58:51 +05:30
Karan Bazaz af98d58380 Adding changes for azwaf hybrid mode 2021-01-26 04:11:30 +05:30
Karan Bazaz cff1347515 Removed extra params from function 2020-12-14 18:38:24 +05:30
Karan Bazaz 054070d6e2 Fixing broken test cases and small changes 2020-12-09 06:31:07 +05:30
Karan Bazaz 03cbfd70e0 Adding wafmode variable 2020-12-09 01:30:30 +05:30
Karan Bazaz d9eaf3129e Moving start time inside modsec ctx 2020-12-02 05:29:23 +05:30
Karan Bazaz 192c77f031 Creating two variables in waf latency for detect and prevent mode 2020-11-24 22:47:34 +05:30
Karan Bazaz fa966ef184 Code refactoring to make it less verbose 2020-11-23 16:01:26 +05:30
Karan Bazaz 5b3cca70ad Changing the name of the waf_latency variable and other changes 2020-11-19 16:05:03 +05:30
Karan Bazaz 59ea21f360 Moved all the nginx core logic to modsec module 2020-11-18 15:55:39 +05:30
Karan Bazaz 0c6c5f7e49 Adding modsec calculations part for waf latency metrics 2020-11-04 03:00:57 +05:30
Venkata Krishnan 0420b9ff41
Merge pull request #168 from microsoft/vekrishn/connectionCountMetricFix
Setting the request->count to 1 to ensure it gets closed/freed
2020-10-06 11:50:02 -07:00
Venkata Krishnan 0859e246fd addressing nit 2020-10-06 11:25:13 -07:00
Venkata Krishnan Anantha Raman 0baf484175 minor typo 2020-10-06 18:01:55 +00:00
Venkata Krishnan Anantha Raman 8c09f2acf2 setting the count to 1 to ensure the request gets freed 2020-10-02 15:23:44 -07:00
Yanshu ff26c3a3b4
Revert "Merge pull request #151 from microsoft/vlkrivop/backpressure" (#166)
This reverts commit d3ebd65264, reversing
changes made to 28f2f3150f.
2020-05-26 16:21:45 -07:00
Yanshu 49ba5fafa8
Fix build issue as nginx module (#161)
* fix specific pcre log error message

* Use Modsec cmd SecComponentSignature

* move from global to per licaton config

* add error code to avoid string match

* fix build

* fix build

* fix build issue with nginx module
2020-03-26 21:11:04 -07:00
Yanshu 7754cbeeb5
Fix PCRE specific message and mandatory rules length comparison issue (#158)
* fix specific pcre log error message

* Use Modsec cmd SecComponentSignature

* move from global to per licaton config

* add error code to avoid string match

* fix build

* fix build
2020-03-25 15:53:13 -07:00
Alex Z. Yang e0e3c52581
filename* extension parameters should match case-insensitively for both character set names and language tags (#159)
Signed-off-by: Venkata Krishnan Anantha Raman <vekrishn@microsoft.com>
2020-03-10 13:28:20 -07:00
Yanshu fdf13f7c9c
Fix detection mode reopen file (#153)
* Fix Reopen file issue in detection mode

* remove outdated comment

* only expose the lock

* move wafjson lock from modsec to global
2020-02-18 13:39:29 -08:00
Vladimir Krivopalov d3ebd65264
Merge pull request #151 from microsoft/vlkrivop/backpressure
Process request in place if cannot add it to the thread pool
2020-01-30 11:18:18 -08:00
Yanshu d3e956bd84
Merge branch 'waf_nginx' into vlkrivop/backpressure 2020-01-29 22:23:21 -08:00
Yanshu 28f2f3150f
Fix reopen file issue. (#150)
* fix reopen file function

* correct naming and log message

* rename the variable and clean up the code
2020-01-29 20:37:48 -08:00
Vladimir Krivopalov 7ab5fd432e Process request in place if cannot add it to the thread pool
Instead of rejecting the request when unable to post it to the thread
pool for offloaded processing, process it in place.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2020-01-28 15:07:35 -08:00
Vladimir Krivopalov e3cda85c57
Merge pull request #149
Fix multipart content type parsing to account for extra attributes
2020-01-24 09:39:25 -08:00
Vladimir Krivopalov 05eca3ccdb Fix multipart content type parsing to account for extra attributes
Before this fix, the parsing code did not expect any attributes other
than 'boundary' to appear in a Content-Type header of
multipart/form-data kind.
This would result in validation failure of requests that have, e.g., a
'charset' attribute set.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2020-01-23 14:20:58 -08:00
Vladimir Krivopalov 4e5d6b2932
Merge pull request #148 from microsoft/vlkrivop/fix_malformed_xml_memory_leak
Properly cleanup XML parser contexts upon completion
2020-01-14 11:33:08 -08:00
Vladimir Krivopalov 080a733637 Properly cleanup XML parser contexts upon completion
It is currently possible that the XML parsing context is not properly
cleaned up if a parsed XML document is malformed.

This fix makes sure that the context is taken care of.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2020-01-13 16:36:09 -08:00
Vladimir Krivopalov 45f52aa9f8 Fix memory leak that occurs on JSON parsing error
ModSecurity uses a dynamically allocated error message when JSON parsing
fails but never releases it properly.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2020-01-11 18:02:16 -08:00
Vladimir Krivopalov 72dc2ddf43
Cleanup allocated resources explicitly upon validator exit (#146)
Now our debug builds use AddressSanitizer and it complains to memory
leaks.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2019-12-23 19:30:46 -08:00
Vladimir Krivopalov d65d1e2364
Merge pull request #145 from microsoft/vlkrivop/async-done-right
Enable request body processing in detection mode in Nginx
2019-12-20 11:55:08 -08:00
Vladimir Krivopalov b76259ebab Explicitly initialize request context in detection-only mode
This ensures that predicates can be run correctly on the request.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2019-12-20 11:22:19 -08:00
Vladimir Krivopalov 165a868dc4 Introduce new public API for initializing transaction context
The transaction context needs to be initialized before predicates like
modsecIsRequestBodyAccessEnabled() can be run on a request.

Typically, it is created during request headers processing but for
detection mode when we defer all processing we may need it sooner.

Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2019-12-20 11:22:18 -08:00
Vladimir Krivopalov e0308a9c7f Make create_tx_context() function visible from other units
Signed-off-by: Vladimir Krivopalov <vlkrivop@microsoft.com>
2019-12-20 11:22:18 -08:00