Open
Description
Hello, I encountered some problems when I used python-gvm, so I would like to ask you for advice.
When I use modify_permission to modify an existing permission, it doesn't work as expected.
- When I passed in the permission_id and comment values, it did not successfully modify the comment corresponding to the permission, but reported an error:
<modify_permission_response status="400" status_text="Error in SUBJECT">
The code shows as below:
path = '/run/gvmd/gvmd.sock'
connection = UnixSocketConnection(path=path)
with Gmp(connection=connection) as gmp:
gmp.authenticate('admin','199954')
print(gmp.modify_permission(
permission_id='d140d640-01f1-4c98-8fe8-616e8829e55d', #The id of authenticate
# name='authenticate',
comment='010203040000',
# resource_type=EntityType.SCAN_CONFIG,
# resource_id='d21f6c81-2b88-4ac1-b7b4-a2a9f2ad4663',
# resource_type=None,
# resource_id=None,
# subject_id='c3de57e6-6678-4a06-9866-47e43321fa77', #The id of an USER
# subject_type=PermissionSubjectType.USER
))
- When I passed in the subject corresponding to the permission, it reported another error: "gvm.errors.GvmError: Remote closed the connection"
path = '/run/gvmd/gvmd.sock'
connection = UnixSocketConnection(path=path)
with Gmp(connection=connection) as gmp:
gmp.authenticate('admin','199954')
print(gmp.modify_permission(
permission_id='d140d640-01f1-4c98-8fe8-616e8829e55d', #The id of authenticate
# name='authenticate',
comment='010203040000',
# resource_type=EntityType.SCAN_CONFIG,
# resource_id='d21f6c81-2b88-4ac1-b7b4-a2a9f2ad4663',
# resource_type=None,
# resource_id=None,
subject_id='c3de57e6-6678-4a06-9866-47e43321fa77', #The id of an USER
subject_type=PermissionSubjectType.USER
))
- Only when all the parameters are passed in can the modification be successful.But I don't know what parameter should be passed in those permissions don't have Resource.
Metadata
Metadata
Assignees
Labels
No labels