How do I get firewalld to restrict access to all except specified IP addresses?

338

one option is to remove the service: https from the zone

firewall-cmd --zone=public --remove-service=https

and then use what is known as rich rules to specify what sources [IP addresses] may access what service [such as http and https] like so:

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="x.x.x.0/24" service name="https" log prefix="https" level="info" accept'

might need to reload though

Share:
338

Related videos on Youtube

kiddbenji
Author by

kiddbenji

Updated on September 18, 2022

Comments

  • kiddbenji
    kiddbenji almost 2 years

    I dont have the rights to create a table from the view but I can read this view. Database has no Table juste one view.

    • Michael Hampton
      Michael Hampton about 9 years
      That looks right. Have you got other zones?
    • zaadman
      zaadman over 7 years
      See this post for more options: serverfault.com/questions/680780/…
    • inspectorG4dget
      inspectorG4dget almost 3 years
      df = pd.DataFrame(sql='select * from my_view')
    • kiddbenji
      kiddbenji almost 3 years
      There is no keyword argument sql
    • Henry Ecker
      Henry Ecker almost 3 years
      I think that's supposed to be df = pd.read_sql('select * from my_view', conn)
    • Larnu
      Larnu almost 3 years
      If the database had no tables, where is the data in the view coming from? A view is a pseudo table defined by a SELECT. The data can't exist in the view.
    • kiddbenji
      kiddbenji almost 3 years
      From another database but we dont have acces. We got one view and I have to deal with it. This is a large view and it take too much time to display it or transform it into a DataFrame
    • kiddbenji
      kiddbenji almost 3 years
      df = pd.read_sql('select * from my_view', conn) = too much time
    • Larnu
      Larnu almost 3 years
      Then improve the performance of the VIEW, that seems like the problem here.
    • kiddbenji
      kiddbenji almost 3 years
      I Only can read the VIEW
    • SMor
      SMor almost 3 years
      Ask the people that manage your server instance / databases. There is little you can do in the query to "speed things up" without more intimate knowledge of the view, the query that defines it, the tables it uses, etc.
    • Larnu
      Larnu almost 3 years
      Clearly the problem here is the VIEW and or tables and they (lack of) indexing; that is what you, or someone else, needs to fix. You can't make a SELECT * from a VIEW faster without altering the view or tables it references.