This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sophos XG API

As per this article:https://doc.sophos.com/nsg/sophos-firewall/18.5/help/en-us/webhelp/onlinehelp/AdministratorHelp/BackupAndFirmware/API/APIUsingAPI/index.html

is seems i can get the ip host objects if i can do something like:

1.1.1.1:4444/.../APIController admin</Username><Password>abcd</Password></Login><Get><IPHost><Name></Name><IPFamily></IPFamily><HostType></HostType><IPAddress></IPAddress></IPHost></Get></Request>

Those articles are note very helpful:

https://doc.sophos.com/nsg/sophos-firewall/18.5/help/en-us/webhelp/onlinehelp/AdministratorHelp/BackupAndFirmware/API/APIUsingAPI/index.html#get-add-update-or-delete-an-ip-host

This provides a very useful way of doing some things in an programable/automated way.

https://docs.sophos.com/nsg/sophos-firewall/18.5/API/index.html 

But i need to start with the basics:

How do i get the objects and how do i know where they are located?

for example the following should retrive the firmware version:

<Request> <Get> <System> <FirmwareVersion/> </System> </Get> </Request> </Request>

however i get: 

<Response>
<Status code">529">Input request file is Invalid</Status>
</Response>
I would very much like the documentation for this. I Need to know how to get all the objects form the firewall: firmware version, firewall rules, a single firewall rule(eg: rule 79), web exceptions, a single web exception, live users, pretty much anything that i can click on GUI.
Can anyone help?
Thanks,
Dragos


This thread was automatically locked due to age.
  • Hi,

    Thanks for your reply.

    I know i can get certain objects exporting the config.

    however at this point i am very interested to get firmware version from a firewall, and nothing seems to work.  

    Exporting the config is still not a feasible option. is not scalable. 

    have you been successful retriving the firmware version by exporting the config or an api call?

    Thanks,

    Dragos

  • did the answer above not allow you to get firmware version?

    <Request APIVersion="X.X">
                    <Authentication>
                            <UserName>XXXXX</UserName>
                           <Password>XXXXX</Password>
                   </Authentication>
                  <DeviceInfo></DeviceInfo>
    </Request>

    XML Response
    <CentralManagement>
    <DeviceInfo>
    <ApplianceKey>XXXXXXXXXXXXXXXXX</ApplianceKey>
    <Model>XXX</Model>
    <OSVersion>XX.XX.X build XXX</OSVersion>
    <UpTime>XX day(s), XX hour(s), XX minutes</UpTime>
    <ManagedApplianceCount>X</ManagedApplianceCount>
    <Gateway>
    <IP>X.X.X.X</IP>
    <Status>True</Status>
    </Gateway>
    </DeviceInfo>
    </CentralManagement>

    ------------------------------------------------

    worlds number one free ICMP monitoring platform: https://pinescore.com

  • Hi Ryan,

    Thanks for your question.

    I am not able to retrieve the info. 

    <?xml version="1.0" encoding="UTF-8"?>
    <Response APIVersion="1905.1" IPS_CAT_VER="0">
        <Login>
            <status>Authentication Successful</status>
        </Login>
        <DeviceInfo/>
    </Response>
    
    I was wondering if anyone was successful?
    Regards,
    Dragos