Skip to content

Commit 06581ca

Browse files
committed
Add support for OWASP Kubernetes Top 10 parsers with fallback logging
1 parent 48476ad commit 06581ca

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

application/cmd/cre_main.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -925,13 +925,33 @@ def run(args: argparse.Namespace) -> None: # pragma: no cover
925925
db_connection_str=args.cache_file,
926926
)
927927
if getattr(args, "owasp_kubernetes_top10_2022_in", False):
928-
raise RuntimeError(
929-
"--owasp_kubernetes_top10_2022_in is not supported in this branch because the Kubernetes 2022 parser module is not implemented"
930-
)
928+
try:
929+
from application.utils.external_project_parsers.parsers import (
930+
owasp_kubernetes_top10_2022,
931+
)
932+
933+
BaseParser().register_resource(
934+
owasp_kubernetes_top10_2022.OwaspKubernetesTop10_2022,
935+
db_connection_str=args.cache_file,
936+
)
937+
except ImportError:
938+
logger.warning(
939+
"--owasp_kubernetes_top10_2022_in requested but parser module is missing; skipping"
940+
)
931941
if getattr(args, "owasp_kubernetes_top10_2025_in", False):
932-
raise RuntimeError(
933-
"--owasp_kubernetes_top10_2025_in is not supported in this branch because the Kubernetes 2025 parser module is not implemented"
934-
)
942+
try:
943+
from application.utils.external_project_parsers.parsers import (
944+
owasp_kubernetes_top10_2025,
945+
)
946+
947+
BaseParser().register_resource(
948+
owasp_kubernetes_top10_2025.OwaspKubernetesTop10_2025,
949+
db_connection_str=args.cache_file,
950+
)
951+
except ImportError:
952+
logger.warning(
953+
"--owasp_kubernetes_top10_2025_in requested but parser module is missing; skipping"
954+
)
935955
if getattr(args, "owasp_llm_top10_2025_in", False):
936956
from application.utils.external_project_parsers.parsers import (
937957
owasp_llm_top10_2025,

0 commit comments

Comments
 (0)