secureCodeBox/secureCodeBox-v2-alpha

View on GitHub

Showing 45 of 45 total issues

Consider simplifying this complex logical expression.
Open

if(smbVersion >= 2 && smbVersion < 3) {
scriptFindings.push({
name: "SMB Protocol Version Finding v"+smbVersion,
description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: `+ smbVersion,
category: 'SMB',
Severity: Major
Found in scanners/nmap/parser/parser.js - About 1 hr to fix

    Method ScanReconciler.startParser has 10 return statements (exceeds 4 allowed).
    Open

    func (r *ScanReconciler) startParser(scan *executionv1.Scan) error {
    ctx := context.Background()
    namespacedName := fmt.Sprintf("%s/%s", scan.Namespace, scan.Name)
    log := r.Log.WithValues("scan_parse", namespacedName)
     
     
    Severity: Major
    Found in operator/controllers/execution/scans/parse_reconciler.go - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

      if(smbVersion > 0 && smbVersion < 2) {
      scriptFindings.push({
      name: "SMB Dangerous Protocol Version Finding v"+smbVersion,
      description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: ` + smbVersion,
      category: 'SMB',
      Severity: Major
      Found in scanners/nmap/parser/parser.js - About 1 hr to fix

        Method ScanReconciler.startReadOnlyHooks has 9 return statements (exceeds 4 allowed).
        Open

        func (r *ScanReconciler) startReadOnlyHooks(scan *executionv1.Scan) error {
        ctx := context.Background()
         
        var scanCompletionHooks executionv1.ScanCompletionHookList
         
         
        Severity: Major
        Found in operator/controllers/execution/scans/hook_reconciler.go - About 55 mins to fix

          Method ScheduledScanReconciler.Reconcile has 8 return statements (exceeds 4 allowed).
          Open

          func (r *ScheduledScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
          ctx := context.Background()
          log := r.Log.WithValues("scheduledscan", req.NamespacedName)
           
          // get the ScheduledScan
          Severity: Major
          Found in operator/controllers/execution/scheduledscan_controller.go - About 50 mins to fix

            Method ScanReconciler.ensureServiceAccountExists has 7 return statements (exceeds 4 allowed).
            Open

            func (r *ScanReconciler) ensureServiceAccountExists(namespace, serviceAccountName, description string, policyRules []rbacv1.PolicyRule) error {
            ctx := context.Background()
             
            var serviceAccount corev1.ServiceAccount
            err := r.Get(ctx, types.NamespacedName{Name: serviceAccountName, Namespace: namespace}, &serviceAccount)
            Severity: Major
            Found in operator/controllers/execution/scans/serviceaccount.go - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

              if(smbVersion >= 2 && smbVersion < 3) {
              scriptFindings.push({
              name: "SMB Protocol Version Finding v"+smbVersion,
              description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: `+ smbVersion,
              category: 'SMB',
              Severity: Major
              Found in scanners/nmap/parser/parser.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                if status.Name == container && status.State.Terminated != nil {
                log.Printf("Main Container Exited. Lurcher will end as well.")
                return
                }
                Severity: Major
                Found in lurcher/main.go - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                  if(smbVersion >= 3) {
                  scriptFindings.push({
                  name: "SMB Protocol Version Finding v"+smbVersion,
                  description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with version: ` + smbVersion,
                  category: 'SMB',
                  Severity: Major
                  Found in scanners/nmap/parser/parser.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                    if(smbVersion > 0 && smbVersion < 2) {
                    scriptFindings.push({
                    name: "SMB Dangerous Protocol Version Finding v"+smbVersion,
                    description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: ` + smbVersion,
                    category: 'SMB',
                    Severity: Major
                    Found in scanners/nmap/parser/parser.js - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                      if(elem.toString().includes("SMBv1")) {
                      scriptFindings.push({
                      name: "SMB Dangerous Protocol Version Finding SMBv1",
                      description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: SMBv1`,
                      category: 'SMB',
                      Severity: Major
                      Found in scanners/nmap/parser/parser.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                        if(smbVersion >= 3) {
                        scriptFindings.push({
                        name: "SMB Protocol Version Finding v"+smbVersion,
                        description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with version: ` + smbVersion,
                        category: 'SMB',
                        Severity: Major
                        Found in scanners/nmap/parser/parser.js - About 40 mins to fix

                          Method ScheduledScanReconciler.SetupWithManager has 5 return statements (exceeds 4 allowed).
                          Open

                          func (r *ScheduledScanReconciler) SetupWithManager(mgr ctrl.Manager) error {
                          if err := mgr.GetFieldIndexer().IndexField(&executionv1.Scan{}, ownerKey, func(rawObj runtime.Object) []string {
                          // grab the job object, extract the owner...
                          scan := rawObj.(*executionv1.Scan)
                          owner := metav1.GetControllerOf(scan)
                          Severity: Major
                          Found in operator/controllers/execution/scheduledscan_controller.go - About 35 mins to fix

                            Method ScanReconciler.SetupWithManager has 5 return statements (exceeds 4 allowed).
                            Open

                            func (r *ScanReconciler) SetupWithManager(mgr ctrl.Manager) error {
                            r.MinioClient = *r.initS3Connection()
                             
                            // Todo: Better config management
                             
                             
                            Severity: Major
                            Found in operator/controllers/execution/scans/scan_controller.go - About 35 mins to fix

                              Function analyseCertificateDeployments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function analyseCertificateDeployments(serverScanResult) {
                              const certificateInfos = serverScanResult.scan_commands_results.certificate_info.certificate_deployments.map(
                              analyseCertificateDeployment
                              );
                               
                               
                              Severity: Minor
                              Found in scanners/sslyze/parser/parser.js - About 35 mins to fix

                              Function generateLabelSelectorString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function generateLabelSelectorString({
                              matchExpression = [],
                              matchLabels = new Map()
                              }: LabelSelector): string {
                              const matchLabelsSelector = Array.from(Object.entries(matchLabels)).map(
                              Severity: Minor
                              Found in hooks/declarative-subsequent-scans/kubernetes-label-selector.ts - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Open

                              return ["Embedded Device", INFORMATIONAL];
                              Severity: Major
                              Found in scanners/nikto/parser/parser.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                return ["Potential Backup File", INFORMATIONAL];
                                Severity: Major
                                Found in scanners/nikto/parser/parser.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                  return ["Identified Software", INFORMATIONAL];
                                  Severity: Major
                                  Found in scanners/nikto/parser/parser.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                    return ["Identified Software", INFORMATIONAL];
                                    Severity: Major
                                    Found in scanners/nikto/parser/parser.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language