File tree Expand file tree Collapse file tree 4 files changed +38
-2
lines changed Expand file tree Collapse file tree 4 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::env;
2
2
3
3
use crate :: config:: Config ;
4
4
5
- // pub mod processor;
5
+ pub mod processor;
6
6
7
7
#[ must_use]
8
8
pub fn is_enabled ( config : & Config ) -> bool {
Original file line number Diff line number Diff line change
1
+ use std:: sync:: Arc ;
2
+
3
+ use crate :: appsec:: { get_rules, is_enabled, is_standalone} ;
4
+ use crate :: config:: Config ;
5
+
6
+ use libddwaf:: WafInstance ;
7
+ use tracing:: { debug, info} ;
8
+
9
+ pub struct Processor {
10
+ _config : Arc < Config > ,
11
+ _handle : WafInstance ,
12
+ }
13
+
14
+ impl Processor {
15
+ pub fn new ( config : Arc < Config > ) -> Result < Self , Box < dyn std:: error:: Error > > {
16
+ if !is_enabled ( & config) {
17
+ return Err ( "AppSec is not enabled" . into ( ) ) ;
18
+ }
19
+ debug ! ( "Starting ASM processor" ) ;
20
+
21
+ if is_standalone ( ) {
22
+ info ! (
23
+ "Starting ASM in standalone mode. APM tracing will be disabled for this service."
24
+ ) ;
25
+ }
26
+
27
+ // Check if ASM can run properly
28
+ // wafHealth
29
+
30
+ let _rules = get_rules ( & config) . unwrap_or_default ( ) ;
31
+
32
+ Err ( "Not implemented" . into ( ) )
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -844,7 +844,8 @@ fn start_api_runtime_proxy(
844
844
return None ;
845
845
}
846
846
847
+ let config = config. clone ( ) ;
847
848
let aws_config = aws_config. clone ( ) ;
848
849
let invocation_processor = invocation_processor. clone ( ) ;
849
- interceptor:: start ( aws_config, invocation_processor) . ok ( )
850
+ interceptor:: start ( config , aws_config, invocation_processor) . ok ( )
850
851
}
Original file line number Diff line number Diff line change 17
17
#![ allow( clippy:: cast_precision_loss) ]
18
18
#![ allow( clippy:: needless_pass_by_value) ]
19
19
20
+ pub mod appsec;
20
21
pub mod config;
21
22
pub mod event_bus;
22
23
pub mod events;
You can’t perform that action at this time.
0 commit comments