<<

NAME

pf::useragent

DESCRIPTION

pf::useragent is the module for User-Agent data management for both nodes and violations enforcement.

SUBROUTINES

useragent_db_prepare

Initialize database prepared statements

node_useragent_exist

Returns true if node_useragent record exists undef or 0 otherwise.

node_useragent_add
node_useragent_update
update_node_useragent_record
node_useragent_view_all - view all node_useragent entries, returns an array of hashrefs
node_useragent_view - view a node_useragent entry, returns an hashref
is_mobile

Is a MAC considered mobile based on its User-Agent

Return values: undef if we have no information on the browser. true if it's a mobile false otherwise

count

View a single useragent trigger

view

View a single useragent trigger

view_all

View all useragent triggers

node_useragent_view_all_searchable

View all useragent triggers

add

Add a useragent trigger along with it's metadata

property_to_tid

Lookup the trigger ID for a given browser property

_init

Initializes the User-Agent data structure. It's two things, one fast lookup hash for trigger ids:

  browser property => trigger id

and one array of hashes with everything:

  (
    id => trigger id
    property => browser property
    description => property description
  )

Be _really_ careful modifying this method so that the trigger IDs will stay the same! We don't want our users to keep updating their conf/violations.conf file to track changing trigger IDs.

process_useragent

Updates the node_useragent information according to User-Agent string and fires appropriate violation triggers based on User-Agent properties.

AUTHOR

Inverse inc. <info@inverse.ca>

COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<