Closed y0urself closed 4 years ago
Instead of using an attribute for the config id in the GMP command
(<modify_task task_id="foo" config_id="bar"/>
)
you should be using an element with an id
attribute like this:
<modify_task task id="foo"><config id="bar"/></modify_task>
In this case the modification should either work if the task is new or modifiable or the command should fail with an error response. The same applies to setting the scanner and target of a task.
Oh yes. This works. Thanks!
'<modify_task task_id="0efdaac6-a2de-4156-acee-d41cde37e754"><target id="5ca97fe1-694d-4e4a-bd4c-55529719d17e"/></modify_task>'
Response Error 400. Status must be New to edit Target
It is not possible to change
scanner_id
,target_id
orconfig_id
withmodify_task
. This effect might also appear in other modify functions of python-gvm ... This also relates tomodify_target
and the Ports and Credential fields.It seems to be an expected behaviour, that these values are immutable (and thus ignored) if the task is scheduled. E.g.: the GSA-UI marks these fields as immutable, too:
If a task is not scheduled, these fields can be changed ...
Assuming the task is immutable, this is what happens, if you try to change immutable fields with python-gvm:
(The values don't change)
Expected behavior
Response with an error or info from gvmd if a field is currently immutable ..
Like for deletes:
Current behavior
gvmd responses with an "OK" but the value is not changed ...
GVM versions
any
Environment
Operating system:
any
Installation method / source: (packages, source installation)
any