Search code examples
xmlopenvas

OpenVAS create alert with HTML attachment


I am having difficulty creating an alert with an attachment "HTML" (“Method > Email > Content > Attach > Html")

I have the ID for the HTML report, but can't figure out how to insert that into the ""

<create_alert>
<name>test3</name>
<condition>Always</condition>
<event>Task run status changed<data>Done<name>status</name></data></event>
<method>Email<data>[email protected]<name>to_address</name></data>
<data>[email protected]<name>from_address</name></data></method>
</create_alert>

I tried adding in "6c248850-1f62-11e1-b082-406186ea4fc5notice_attach_format" to the method section, but this didnt work.


Solution

  • I managed to create an alert with a PDF attachment like this, so you only need to subsitute c402cc3e-b531-11e1-9163-406186ea4fc5 with uuid of HTML :

    omp -u username -w password --xml="<create_alert><name>AlertName</name><condition>Always</condition><event>Task run status changed<data>Done<name>status</name></data></event><method>Email<data>2<name>notice</name></data><data>[email protected]<name>from_address</name></data><data>c402cc3e-b531-11e1-9163-406186ea4fc5<name>notice_attach_format</name></data><data>[email protected]<name>to_address</name></data></method></create_alert>"