{"id":1234,"date":"2015-04-30T10:23:31","date_gmt":"2015-04-30T17:23:31","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=1234"},"modified":"2015-04-30T10:23:31","modified_gmt":"2015-04-30T17:23:31","slug":"sqlite-and-fail2ban","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1234","title":{"rendered":"SQLite and fail2ban"},"content":{"rendered":"<p>OS: CentOS7<\/p>\n<p>I wanted to see exactly how and where the fail2ban IP addresses were stored.  Looking in the fail2ban.conf file, I found the following:<\/p>\n<blockquote><p>dbfile = \/var\/lib\/fail2ban\/fail2ban.sqlite3<\/p><\/blockquote>\n<p>So, I did a little research to try to find out how access the database.<\/p>\n<p>To open or connect to the database:<\/p>\n<blockquote><p># sqlite3 \/var\/lib\/fail2ban\/fail2ban.sqlite3<\/p><\/blockquote>\n<p>To list all the tables in the database:<\/p>\n<blockquote><p>sqlite> .tables<br \/>\nbans        fail2banDb  jails       logs\n<\/p><\/blockquote>\n<p>To query a table:<\/p>\n<blockquote><p>sqlite> SELECT * FROM logs;<\/p><\/blockquote>\n<p>Another table:<\/p>\n<blockquote><p>sqlite> SELECT * FROM bans;<\/p><\/blockquote>\n<p>To disconnect from the database:<\/p>\n<blockquote><p>sqlite> .quit<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>OS: CentOS7 I wanted to see exactly how and where the fail2ban IP addresses were stored. Looking in the fail2ban.conf file, I found the following: dbfile = \/var\/lib\/fail2ban\/fail2ban.sqlite3 So, I did a little research to try to find out how access the database. To open or connect to the database: # sqlite3 \/var\/lib\/fail2ban\/fail2ban.sqlite3 To list [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[309,393],"class_list":["post-1234","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-fail2ban","tag-sqlite"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1234"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1234\/revisions"}],"predecessor-version":[{"id":1235,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1234\/revisions\/1235"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}