Skip to content

Commit

Permalink
Merge pull request #58 from C4tWithShell/feature/add_dev_env
Browse files Browse the repository at this point in the history
Add dojo development enviroment
  • Loading branch information
rndmh3ro authored Mar 4, 2024
2 parents 4d78b62 + f2a3ad0 commit 79bb462
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ docker run -it -v /path/to/your/.kube/config:/root/.kube/config \
| `defectDojoEvalEngagementName` | `"false"` | Specifies whether the engagement name should be evaluated as a python function. |
| `defectDojoEvalProductName` | `"false"` | Specifies whether the product name should be evaluated as a python function. |
| `defectDojoEvalProductTypeName` | `"false"` | Specifies whether the product type name should be evaluated as a python function. |
| `defectDojoEvalEnvName` | `"false"` | Specifies whether the enviroment type name should be evaluated as a python function. |
| `defectDojoEvalTestTitle` | `"false"` | Specifies whether the test title should be evaluated as a python function. |
| `defectDojoMinimumSeverity` | `Info` | The minimum severity level for findings in DefectDojo. |
| `defectDojoProductName` | `product` | The name of the product in DefectDojo. |
| `defectDojoProductTypeName` | `Research and Development` | The type of the product in DefectDojo. |
| `defectDojoEnvName` | `Development` | The type of the env in DefectDojo. |
| `defectDojoPushToJira` | `"false"` | Specifies whether findings should be pushed to Jira in DefectDojo. |
| `defectDojoTestTitle` | `Kubernetes` | The title of the test in DefectDojo. |
| `defectDojoVerified` | `"false"` | Specifies whether findings should be marked as verified in DefectDojo. |
Expand Down
6 changes: 6 additions & 0 deletions charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ spec:
- name: DEFECT_DOJO_EVAL_PRODUCT_TYPE_NAME
value: {{ quote .Values.operator.trivyDojoReportOperator.env.defectDojoEvalProductTypeName
}}
- name: DEFECT_DOJO_ENV_NAME
value: {{ quote .Values.operator.trivyDojoReportOperator.env.defectDojoEnvName
}}
- name: DEFECT_DOJO_EVAL_ENV_NAME
value: {{ quote .Values.operator.trivyDojoReportOperator.env.defectDojoEvalEnvName
}}
- name: DEFECT_DOJO_TEST_TITLE
value: {{ quote .Values.operator.trivyDojoReportOperator.env.defectDojoTestTitle
}}
Expand Down
2 changes: 2 additions & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ operator:
defectDojoEvalEngagementName: "false"
defectDojoEvalProductName: "false"
defectDojoEvalProductTypeName: "false"
defectDojoEvalEnvName: "false"
defectDojoEvalTestTitle: "false"
defectDojoMinimumSeverity: Info
defectDojoProductName: product
defectDojoProductTypeName: Research and Development
defectDojoEnvName: Development
defectDojoPushToJira: "false"
defectDojoTestTitle: Kubernetes
defectDojoVerified: "false"
Expand Down
4 changes: 4 additions & 0 deletions deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ spec:
value: "Research and Development"
- name: DEFECT_DOJO_EVAL_PRODUCT_TYPE_NAME
value: "false"
- name: DEFECT_DOJO_ENV_NAME
value: "Development"
- name: DEFECT_DOJO_EVAL_ENV_NAME
value: "false"
- name: DEFECT_DOJO_TEST_TITLE
value: "Kubernetes"
- name: DEFECT_DOJO_EVAL_TEST_TITLE
Expand Down
7 changes: 7 additions & 0 deletions src/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def send_to_dojo(body, meta, logger, **_):
else settings.DEFECT_DOJO_PRODUCT_TYPE_NAME
)

_DEFECT_DOJO_ENV_NAME = (
eval(settings.DEFECT_DOJO_ENV_NAME)
if settings.DEFECT_DOJO_EVAL_ENV_NAME
else settings.DEFECT_DOJO_ENV_NAME
)

_DEFECT_DOJO_TEST_TITLE = (
eval(settings.DEFECT_DOJO_TEST_TITLE)
if settings.DEFECT_DOJO_EVAL_TEST_TITLE
Expand Down Expand Up @@ -136,6 +142,7 @@ def send_to_dojo(body, meta, logger, **_):
"engagement_name": _DEFECT_DOJO_ENGAGEMENT_NAME,
"product_name": _DEFECT_DOJO_PRODUCT_NAME,
"product_type_name": _DEFECT_DOJO_PRODUCT_TYPE_NAME,
"environment": _DEFECT_DOJO_ENV_NAME,
"test_title": _DEFECT_DOJO_TEST_TITLE,
"do_not_reactivate": settings.DEFECT_DOJO_DO_NOT_REACTIVATE,
}
Expand Down
7 changes: 7 additions & 0 deletions src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
"DEFECT_DOJO_EVAL_PRODUCT_TYPE_NAME"
)

DEFECT_DOJO_ENV_NAME: str = os.getenv(
"DEFECT_DOJO_ENV_NAME", "Development"
)
DEFECT_DOJO_EVAL_ENV_NAME: bool = get_env_var_bool(
"DEFECT_DOJO_EVAL_ENV_NAME"
)

DEFECT_DOJO_TEST_TITLE: str = os.getenv("DEFECT_DOJO_TEST_TITLE", "Kubernetes")
DEFECT_DOJO_EVAL_TEST_TITLE: bool = get_env_var_bool("DEFECT_DOJO_EVAL_TEST_TITLE")

Expand Down

0 comments on commit 79bb462

Please sign in to comment.