tcell_agent 0.2.19 → 0.2.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE_libinjection +32 -0
- data/Rakefile +14 -1
- data/ext/libinjection/extconf.rb +3 -0
- data/ext/libinjection/libinjection.h +65 -0
- data/ext/libinjection/libinjection_html5.c +847 -0
- data/ext/libinjection/libinjection_html5.h +54 -0
- data/ext/libinjection/libinjection_sqli.c +2317 -0
- data/ext/libinjection/libinjection_sqli.h +295 -0
- data/ext/libinjection/libinjection_sqli_data.h +9004 -0
- data/ext/libinjection/libinjection_wrap.c +3525 -0
- data/ext/libinjection/libinjection_xss.c +531 -0
- data/ext/libinjection/libinjection_xss.h +21 -0
- data/lib/tcell_agent/configuration.rb +0 -48
- data/lib/tcell_agent/logger.rb +1 -0
- data/lib/tcell_agent/policies/appsensor/database_sensor.rb +8 -20
- data/lib/tcell_agent/policies/appsensor/injection_sensor.rb +30 -46
- data/lib/tcell_agent/policies/appsensor/login_sensor.rb +1 -4
- data/lib/tcell_agent/policies/appsensor/misc_sensor.rb +8 -22
- data/lib/tcell_agent/policies/appsensor/payloads_policy.rb +143 -0
- data/lib/tcell_agent/policies/appsensor/response_codes_sensor.rb +3 -1
- data/lib/tcell_agent/policies/appsensor/sensor.rb +21 -2
- data/lib/tcell_agent/policies/appsensor/size_sensor.rb +3 -1
- data/lib/tcell_agent/policies/appsensor/sqli_sensor.rb +9 -0
- data/lib/tcell_agent/policies/appsensor/user_agent_sensor.rb +1 -5
- data/lib/tcell_agent/policies/appsensor/xss_sensor.rb +9 -1
- data/lib/tcell_agent/policies/appsensor_policy.rb +40 -19
- data/lib/tcell_agent/policies/http_redirect_policy.rb +12 -2
- data/lib/tcell_agent/rails/csrf_exception.rb +1 -1
- data/lib/tcell_agent/rails/dlp.rb +98 -76
- data/lib/tcell_agent/rails/middleware/global_middleware.rb +1 -2
- data/lib/tcell_agent/rails/middleware/headers_middleware.rb +2 -2
- data/lib/tcell_agent/rails/on_start.rb +53 -20
- data/lib/tcell_agent/sensor_events/appsensor_event.rb +12 -19
- data/lib/tcell_agent/sensor_events/appsensor_meta_event.rb +7 -2
- data/lib/tcell_agent/sensor_events/sensor.rb +10 -11
- data/lib/tcell_agent/sensor_events/server_agent.rb +17 -12
- data/lib/tcell_agent/sensor_events/util/sanitizer_utilities.rb +148 -139
- data/lib/tcell_agent/utils/params.rb +24 -21
- data/lib/tcell_agent/version.rb +1 -1
- data/spec/lib/tcell_agent/configuration_spec.rb +0 -179
- data/spec/lib/tcell_agent/policies/appsensor/database_sensor_spec.rb +6 -4
- data/spec/lib/tcell_agent/policies/appsensor/misc_sensor_spec.rb +31 -22
- data/spec/lib/tcell_agent/policies/appsensor/payloads_policy_apply_spec.rb +466 -0
- data/spec/lib/tcell_agent/policies/appsensor/payloads_policy_from_json_spec.rb +890 -0
- data/spec/lib/tcell_agent/policies/appsensor/payloads_policy_log_spec.rb +484 -0
- data/spec/lib/tcell_agent/policies/appsensor/request_size_sensor_spec.rb +4 -3
- data/spec/lib/tcell_agent/policies/appsensor/response_codes_sensor_spec.rb +4 -4
- data/spec/lib/tcell_agent/policies/appsensor/response_size_sensor_spec.rb +1 -1
- data/spec/lib/tcell_agent/policies/appsensor/sqli_sensor_spec.rb +85 -0
- data/spec/lib/tcell_agent/policies/appsensor/user_agent_sensor_spec.rb +36 -16
- data/spec/lib/tcell_agent/policies/appsensor/xss_sensor_spec.rb +188 -312
- data/spec/lib/tcell_agent/policies/appsensor_policy_spec.rb +61 -0
- data/spec/lib/tcell_agent/rails/middleware/appsensor_middleware_spec.rb +18 -11
- data/spec/lib/tcell_agent/rails/middleware/redirect_middleware_spec.rb +14 -15
- data/spec/lib/tcell_agent/sensor_events/appsensor_meta_event_spec.rb +1 -1
- data/spec/lib/tcell_agent/sensor_events/util/sanitizer_utilities_spec.rb +6 -5
- data/spec/lib/tcell_agent/utils/params_spec.rb +28 -108
- data/tcell_agent.gemspec +21 -1
- metadata +37 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94acb227285ba44cdff883596610b0a1acfa7a44
|
4
|
+
data.tar.gz: 3434e3c09598e19d4913c23fa7241fd28ae71316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511965665332196c8d0c5715057251fcad8eeee5118d0e8a6626d14ef031d4c2861d2875e50aac1380c010cd9d110cff95632b19abe7362440ff91fff8b67c88
|
7
|
+
data.tar.gz: 7a551c6c4b09f6a1fc4c59c07b9275aadb3ad44c9de109b19b5d8ee5bd322fa6029d7f1f81f127d5c29fe81f91a05c758c84a31666051d776fa85fd069b2e97c
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Copyright (c) 2012-2016, Nick Galbreath
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright
|
12
|
+
notice, this list of conditions and the following disclaimer in the
|
13
|
+
documentation and/or other materials provided with the distribution.
|
14
|
+
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
16
|
+
contributors may be used to endorse or promote products derived from
|
17
|
+
this software without specific prior written permission.
|
18
|
+
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
https://github.com/client9/libinjection
|
32
|
+
http://opensource.org/licenses/BSD-3-Clause
|
data/Rakefile
CHANGED
@@ -1,11 +1,24 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rake/extensiontask'
|
1
3
|
require 'rspec/core/rake_task'
|
2
4
|
|
5
|
+
CLEAN.include('ext/**/*{.o,.log,.so,.bundle}')
|
6
|
+
CLEAN.include('ext/**/Makefile')
|
7
|
+
CLOBBER.include('lib/*{.so,.bundle}')
|
8
|
+
|
9
|
+
Rake::ExtensionTask.new("libinjection") do |ext|
|
10
|
+
ext.lib_dir = File.join("lib", "libinjection")
|
11
|
+
end
|
12
|
+
|
13
|
+
task :default => [:compile, :spec]
|
14
|
+
|
3
15
|
RSpec::Core::RakeTask.new(:spec)
|
4
16
|
|
5
17
|
desc "Run tests"
|
6
|
-
task :default => :spec
|
7
18
|
task :test => :spec
|
8
19
|
|
20
|
+
Rake::Task[:test].prerequisites << :compile
|
21
|
+
|
9
22
|
task "init-integration-tests" do
|
10
23
|
system("docker-compose run railsintegration224 bundle install")
|
11
24
|
system("docker-compose run railsintegration224 bundle exec rake db:create db:setup")
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2012-2016 Nick Galbreath
|
3
|
+
* nickg@client9.com
|
4
|
+
* BSD License -- see COPYING.txt for details
|
5
|
+
*
|
6
|
+
* https://libinjection.client9.com/
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef LIBINJECTION_H
|
11
|
+
#define LIBINJECTION_H
|
12
|
+
|
13
|
+
#ifdef __cplusplus
|
14
|
+
# define LIBINJECTION_BEGIN_DECLS extern "C" {
|
15
|
+
# define LIBINJECTION_END_DECLS }
|
16
|
+
#else
|
17
|
+
# define LIBINJECTION_BEGIN_DECLS
|
18
|
+
# define LIBINJECTION_END_DECLS
|
19
|
+
#endif
|
20
|
+
|
21
|
+
LIBINJECTION_BEGIN_DECLS
|
22
|
+
|
23
|
+
/*
|
24
|
+
* Pull in size_t
|
25
|
+
*/
|
26
|
+
#include <string.h>
|
27
|
+
|
28
|
+
/*
|
29
|
+
* Version info.
|
30
|
+
*
|
31
|
+
* This is moved into a function to allow SWIG and other auto-generated
|
32
|
+
* binding to not be modified during minor release changes. We change
|
33
|
+
* change the version number in the c source file, and not regenerated
|
34
|
+
* the binding
|
35
|
+
*
|
36
|
+
* See python's normalized version
|
37
|
+
* http://www.python.org/dev/peps/pep-0386/#normalizedversion
|
38
|
+
*/
|
39
|
+
const char* libinjection_version(void);
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Simple API for SQLi detection - returns a SQLi fingerprint or NULL
|
43
|
+
* is benign input
|
44
|
+
*
|
45
|
+
* \param[in] s input string, may contain nulls, does not need to be null-terminated
|
46
|
+
* \param[in] slen input string length
|
47
|
+
* \param[out] fingerprint buffer of 8+ characters. c-string,
|
48
|
+
* \return 1 if SQLi, 0 if benign. fingerprint will be set or set to empty string.
|
49
|
+
*/
|
50
|
+
int libinjection_sqli(const char* s, size_t slen, char fingerprint[]);
|
51
|
+
|
52
|
+
/** ALPHA version of xss detector.
|
53
|
+
*
|
54
|
+
* NOT DONE.
|
55
|
+
*
|
56
|
+
* \param[in] s input string, may contain nulls, does not need to be null-terminated
|
57
|
+
* \param[in] slen input string length
|
58
|
+
* \return 1 if XSS found, 0 if benign
|
59
|
+
*
|
60
|
+
*/
|
61
|
+
int libinjection_xss(const char* s, size_t slen);
|
62
|
+
|
63
|
+
LIBINJECTION_END_DECLS
|
64
|
+
|
65
|
+
#endif /* LIBINJECTION_H */
|