Skip to content

Commit 2f30532

Browse files
ozgengreenbonebot
authored andcommitted
Add scanner_id in oci image task
1 parent 0289e94 commit 2f30532

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/gsad_gmp.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ create_oci_image_task_gmp (gvm_connection_t *connection,
27492749
const char *schedule_id, *schedule_periods;
27502750
const char *in_assets, *alterable;
27512751
const char *add_tag, *tag_id, *auto_delete, *auto_delete_data;
2752-
const char *apply_overrides, *min_qod;
2752+
const char *apply_overrides, *min_qod, *scanner_id;
27532753
const char *accept_invalid_certs, *registry_allow_insecure;
27542754
gchar *name_escaped, *comment_escaped;
27552755
params_t *alerts;
@@ -2770,13 +2770,15 @@ create_oci_image_task_gmp (gvm_connection_t *connection,
27702770
oci_image_target_id = params_value (params, "oci_image_target_id");
27712771
accept_invalid_certs = params_value (params, "accept_invalid_certs");
27722772
registry_allow_insecure = params_value (params, "registry_allow_insecure");
2773+
scanner_id = params_value (params, "scanner_id");
27732774

27742775
CHECK_VARIABLE_INVALID (name, "Create OCI Image Task");
27752776
CHECK_VARIABLE_INVALID (comment, "Create OCI Image Task");
27762777
CHECK_VARIABLE_INVALID (oci_image_target_id, "Create OCI Image Task");
27772778
CHECK_VARIABLE_INVALID (schedule_id, "Create OCI Image Task");
27782779
CHECK_VARIABLE_INVALID (accept_invalid_certs, "Create OCI Image Task");
27792780
CHECK_VARIABLE_INVALID (registry_allow_insecure, "Create OCI Image Task");
2781+
CHECK_VARIABLE_INVALID (scanner_id, "Create OCI Image Task");
27802782

27812783
if (str_equal (oci_image_target_id, "0"))
27822784
{
@@ -2866,11 +2868,13 @@ create_oci_image_task_gmp (gvm_connection_t *connection,
28662868
"</preference>"
28672869
"</preferences>"
28682870
"<usage_type>scan</usage_type>"
2871+
"<scanner id=\"%s\"/>"
28692872
"</create_task>",
28702873
schedule_periods, schedule_element, alert_element->str, oci_image_target_id,
28712874
name_escaped, comment_escaped, alterable ? strcmp (alterable, "0") : 0,
28722875
accept_invalid_certs ? strcmp (accept_invalid_certs, "0") : 0,
2873-
registry_allow_insecure ? strcmp (registry_allow_insecure, "0") : 0);
2876+
registry_allow_insecure ? strcmp (registry_allow_insecure, "0") : 0,
2877+
scanner_id);
28742878

28752879
g_free (name_escaped);
28762880
g_free (comment_escaped);
@@ -3491,7 +3495,7 @@ save_oci_image_task_gmp (gvm_connection_t *connection,
34913495
{
34923496
gchar *html = NULL, *response = NULL, *format = NULL;
34933497
const char *comment, *name, *schedule_id, *schedule_periods;
3494-
const char *task_id, *oci_image_target_id;
3498+
const char *task_id, *oci_image_target_id, *scanner_id;
34953499
const char *accept_invalid_certs, *registry_allow_insecure;
34963500
const char *alterable;
34973501
int ret;
@@ -3509,6 +3513,7 @@ save_oci_image_task_gmp (gvm_connection_t *connection,
35093513
oci_image_target_id = params_value (params, "oci_image_target_id");
35103514
accept_invalid_certs = params_value (params, "accept_invalid_certs");
35113515
registry_allow_insecure = params_value (params, "registry_allow_insecure");
3516+
scanner_id = params_value (params, "scanner_id");
35123517

35133518
/* Optional schedule_periods -> default "0" if not provided */
35143519
if (params_given (params, "schedule_periods"))
@@ -3526,6 +3531,7 @@ save_oci_image_task_gmp (gvm_connection_t *connection,
35263531
CHECK_VARIABLE_INVALID (oci_image_target_id, "Save OCI Image Task");
35273532
CHECK_VARIABLE_INVALID (accept_invalid_certs, "Save OCI Image Task");
35283533
CHECK_VARIABLE_INVALID (registry_allow_insecure, "Save OCI Image Task");
3534+
CHECK_VARIABLE_INVALID (scanner_id, "Save OCI Image Task");
35293535

35303536
/* Build alerts list */
35313537
alert_element = g_string_new ("");
@@ -3560,6 +3566,7 @@ save_oci_image_task_gmp (gvm_connection_t *connection,
35603566
"<oci_image_target id=\"%%s\"/>"
35613567
"<schedule id=\"%%s\"/>"
35623568
"<schedule_periods>%%s</schedule_periods>"
3569+
"<scanner id=\"%%s\"/>"
35633570
"%s%i%s" /* optional alterable wrapper with numeric value */
35643571
"<preferences>"
35653572
"<preference>"
@@ -3579,7 +3586,7 @@ save_oci_image_task_gmp (gvm_connection_t *connection,
35793586
ret = gmpf (
35803587
connection, credentials, &response, &entity, response_data, format, task_id,
35813588
name, comment, oci_image_target_id, schedule_id, schedule_periods,
3582-
accept_invalid_certs ? strcmp (accept_invalid_certs, "0") : 0,
3589+
scanner_id, accept_invalid_certs ? strcmp (accept_invalid_certs, "0") : 0,
35833590
registry_allow_insecure ? strcmp (registry_allow_insecure, "0") : 0);
35843591

35853592
g_free (format);

0 commit comments

Comments
 (0)