Security

last person joined: yesterday 

Forum to discuss Enterprise security using HPE Aruba Networking NAC solutions (ClearPass), Introspect, VIA, 360 Security Exchange, Extensions, and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Clearpass SQL API

This thread has been viewed 9 times
  • 1.  Clearpass SQL API

    Posted Sep 29, 2014 07:14 PM

    Is there a way to UPDATE or DELETE operations from an external server?

    The appexternal user seems to only have SELECT permission on the database.



  • 2.  RE: Clearpass SQL API

    EMPLOYEE
    Posted Sep 29, 2014 07:17 PM
    Which database?


  • 3.  RE: Clearpass SQL API

    Posted Sep 29, 2014 07:26 PM

    I am looking to implement a rotating password script for a particular guest user.

    Trying to avoid the XML API which I am not familiar with, SQL would be a piece of cake.

     

    So looks like I need to modify tipsDB -> cpg_nwamdpsuser. But the perms are:

     

    ALTER TABLE cpg_nwamdpsuser OWNER TO postgres;
    GRANT ALL ON TABLE cpg_nwamdpsuser TO postgres;
    GRANT SELECT ON TABLE cpg_nwamdpsuser TO appuser;
    GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE cpg_nwamdpsuser TO appadmin;

     

    However appadmin isn't allowed to login externally via pg_hba.conf.



  • 4.  RE: Clearpass SQL API

    EMPLOYEE
    Posted Sep 29, 2014 07:29 PM
    You cannot make changes to that database with the appexternal account because there is an API available to make changes.


  • 5.  RE: Clearpass SQL API

    Posted Sep 29, 2014 07:45 PM

    So in a nutshell, no way to make change to tipsDB via SQL? Must use the XML API?



  • 6.  RE: Clearpass SQL API

    EMPLOYEE
    Posted Sep 29, 2014 08:11 PM

    For guest users, yes the XML API needs to be used.



  • 7.  RE: Clearpass SQL API

    EMPLOYEE
    Posted Sep 30, 2014 02:24 AM


  • 8.  RE: Clearpass SQL API

    Posted Sep 30, 2014 02:30 AM

    Thanks, I just finished writing a script to do much the same thing but using wget. It's always nice to find things can be done with a simple shell command :)



  • 9.  RE: Clearpass SQL API

    Posted Sep 30, 2014 02:52 AM

    For anyone checking this later, the basics of this is 

     

    /usr/bin/wget https://<clearpass>/tipsapi/config/write/GuestUser --no-check-certificate --user=apiadmin --password=<pass> --header=\"Content-Type:text/xml\" --post-file=<guestUserFile> --output-document=<resultFile> --quiet

     

    ..where <guestUserFile> is the xml as per the API guide.