@@ -408,6 +408,47 @@ describe('SecurityConfigurationAssessment', function() {
408
408
} ) ;
409
409
} ) ;
410
410
411
+ it ( 'Filters: title' , function ( done ) {
412
+ request ( common . url )
413
+ . get ( "/sca/000/checks/cis_debian9_L2?&title=Ensure%20events%20that%20modify%20the%20system%27s%20Mandatory%20Access%20Controls%20are%20collected%20%28SELinux%29&limit=1" )
414
+ . auth ( common . credentials . user , common . credentials . password )
415
+ . expect ( "Content-type" , / j s o n / )
416
+ . expect ( 200 )
417
+ . end ( function ( err , res ) {
418
+ if ( err ) return done ( err ) ;
419
+
420
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
421
+
422
+ res . body . error . should . equal ( 0 ) ;
423
+ res . body . data . totalItems . should . be . above ( 0 ) ;
424
+ res . body . data . items . should . be . instanceof ( Array ) ;
425
+ res . body . data . items [ 0 ] . should . have . properties ( sca_check_fields ) ;
426
+
427
+ done ( ) ;
428
+ } ) ;
429
+
430
+ } ) ;
431
+
432
+ it ( 'Filters: incomplete title' , function ( done ) {
433
+ request ( common . url )
434
+ . get ( "/sca/000/checks/cis_debian9_L2?title=Ensure%20events%20that&limit=1" )
435
+ . auth ( common . credentials . user , common . credentials . password )
436
+ . expect ( "Content-type" , / j s o n / )
437
+ . expect ( 200 )
438
+ . end ( function ( err , res ) {
439
+ if ( err ) return done ( err ) ;
440
+
441
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
442
+
443
+ res . body . error . should . equal ( 0 ) ;
444
+ res . body . data . totalItems . should . be . equal ( 0 ) ;
445
+ res . body . data . items . should . be . instanceof ( Array ) ;
446
+
447
+ done ( ) ;
448
+ } ) ;
449
+
450
+ } ) ;
451
+
411
452
it ( 'Filters: description' , function ( done ) {
412
453
request ( common . url )
413
454
. get ( "/sca/000/checks/unix_audit?description=Turn%20on%20the%20auditd%20daemon%20to%20record%20system%20events.&limit=1" )
@@ -429,6 +470,27 @@ describe('SecurityConfigurationAssessment', function() {
429
470
430
471
} ) ;
431
472
473
+ it ( 'Filters: rationale' , function ( done ) {
474
+ request ( common . url )
475
+ . get ( "/sca/000/checks/cis_debian9_L2?rationale=In%20high%20security%20contexts%2C%20the%20risk%20of%20detecting%20unauthorized%20access%20or%20nonrepudiation%20exceeds%20the%20benefit%20of%20the%20system%27s%20availability.&limit=1" )
476
+ . auth ( common . credentials . user , common . credentials . password )
477
+ . expect ( "Content-type" , / j s o n / )
478
+ . expect ( 200 )
479
+ . end ( function ( err , res ) {
480
+ if ( err ) return done ( err ) ;
481
+
482
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
483
+
484
+ res . body . error . should . equal ( 0 ) ;
485
+ res . body . data . totalItems . should . be . above ( 0 ) ;
486
+ res . body . data . items . should . be . instanceof ( Array ) ;
487
+ res . body . data . items [ 0 ] . should . have . properties ( sca_check_fields ) ;
488
+
489
+ done ( ) ;
490
+ } ) ;
491
+
492
+ } ) ;
493
+
432
494
it ( 'Filters: remediation' , function ( done ) {
433
495
request ( common . url )
434
496
. get ( "/sca/000/checks/unix_audit?remediation=Change%20the%20Port%20option%20value%20in%20the%20sshd_config%20file.&limit=1" )
@@ -513,6 +575,69 @@ describe('SecurityConfigurationAssessment', function() {
513
575
514
576
} ) ;
515
577
578
+ it ( 'Filters: command' , function ( done ) {
579
+ request ( common . url )
580
+ . get ( "/sca/000/checks/unix_audit?command=systemctl%20is-enabled%20auditd&limit=1" )
581
+ . auth ( common . credentials . user , common . credentials . password )
582
+ . expect ( "Content-type" , / j s o n / )
583
+ . expect ( 200 )
584
+ . end ( function ( err , res ) {
585
+ if ( err ) return done ( err ) ;
586
+
587
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
588
+
589
+ res . body . error . should . equal ( 0 ) ;
590
+ res . body . data . totalItems . should . be . above ( 0 ) ;
591
+ res . body . data . items . should . be . instanceof ( Array ) ;
592
+ res . body . data . items [ 0 ] . should . have . properties ( sca_check_fields ) ;
593
+
594
+ done ( ) ;
595
+ } ) ;
596
+
597
+ } ) ;
598
+
599
+ it ( 'Filters: status' , function ( done ) {
600
+ request ( common . url )
601
+ . get ( "/sca/000/checks/unix_audit?status=Not%20applicable&limit=1" )
602
+ . auth ( common . credentials . user , common . credentials . password )
603
+ . expect ( "Content-type" , / j s o n / )
604
+ . expect ( 200 )
605
+ . end ( function ( err , res ) {
606
+ if ( err ) return done ( err ) ;
607
+
608
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
609
+
610
+ res . body . error . should . equal ( 0 ) ;
611
+ res . body . data . totalItems . should . be . above ( 0 ) ;
612
+ res . body . data . items . should . be . instanceof ( Array ) ;
613
+ res . body . data . items [ 0 ] . should . have . properties ( sca_check_fields ) ;
614
+
615
+ done ( ) ;
616
+ } ) ;
617
+
618
+ } ) ;
619
+
620
+ it ( 'Filters: reason' , function ( done ) {
621
+ request ( common . url )
622
+ . get ( "/sca/000/checks/cis_debian9_L2?reason=Could%20not%20open%20file%20%27%2Fetc%2Fdefault%2Fgrub%27&limit=1" )
623
+ . auth ( common . credentials . user , common . credentials . password )
624
+ . expect ( "Content-type" , / j s o n / )
625
+ . expect ( 200 )
626
+ . end ( function ( err , res ) {
627
+ if ( err ) return done ( err ) ;
628
+
629
+ res . body . should . have . properties ( [ 'error' , 'data' ] ) ;
630
+
631
+ res . body . error . should . equal ( 0 ) ;
632
+ res . body . data . totalItems . should . be . above ( 0 ) ;
633
+ res . body . data . items . should . be . instanceof ( Array ) ;
634
+ res . body . data . items [ 0 ] . should . have . properties ( sca_check_fields ) ;
635
+
636
+ done ( ) ;
637
+ } ) ;
638
+
639
+ } ) ;
640
+
516
641
it ( 'Filters: condition' , function ( done ) {
517
642
request ( common . url )
518
643
. get ( "/sca/000/checks/unix_audit?condition=all&limit=1" )
0 commit comments