Export of Blacklist "Who" Objects

Florensen

New Member
Dec 13, 2018
2
0
1
22
Hi everyone,

we want to export all "Who" Objects in one of our Blacklists and compare it to a List in a .csv File.

From my understanding, it is not possible to export directly from the Webinterface.

It either needs to be done with API Calls, CLI or directly get the Information from the Database, but I struggle to get that done.

CLI approach:
I looked through the API/CLI documentation and thought I can get the Objects running -> pmgsh get /config/ruledb/who/26
But I only get the configuration of the Blacklist itself, or at least I think that's what I'm receiving.

Database approach:
I found this Forum Post -> https://forum.proxmox.com/threads/blacklist.41913/#post-201443
and tried to get access to the Database but i don´t have the Password for the Postgres user.
I'm not the one who installed Proxmox in our Environment, was a Password specified while installing or is there a default one?

I hope thats enough information so you can push me in the right direction.
Thanks in advance.
 
CLI approach:
I looked through the API/CLI documentation and thought I can get the Objects running -> pmgsh get /config/ruledb/who/26
But I only get the configuration of the Blacklist itself, or at least I think that's what I'm receiving.
That's almost it:
`pmgsh get /config/ruledb/who/26/objects` (assuming 26 is the object you want) - the fields depend on what kind of objects your blacklist contains (domains, regex, ip,...)

and tried to get access to the Database but i don´t have the Password for the Postgres user.
I'm not the one who installed Proxmox in our Environment, was a Password specified while installing or is there a default one?
`su - postgres` - then you're the postgres user on the pmg-system and can use `psql Proxmox_ruledb` (on pmg you can also use the root user)
if you want to create a user with restricted permissions - check `man createuser` (postres' utility for creating db-users)

Hope this helps!
 
Thanks for the great answer.

I was able to get everything i need using the CLI commands
 
You're welcome - Glad you managed to solve your task!
Please mark the thread as 'SOLVED' so that other know what to expect
Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!