Erlang -- mod_security

inets

Reference Manual

Version 7.4

- User's Guide
- Reference Manual
- Release Notes
- PDF
- Top

- Expand All
- Contract All

### Table of Contents

- inets
  - Top of manual page
  - service_names/0
  - services/0
  - services_info/0
  - start/0
  - start/1
  - start/2
  - start/3
  - stop/0
  - stop/2
- httpc
  - Top of manual page
  - cancel_request/1
  - cancel_request/2
  - cookie_header/1
  - cookie_header/2
  - cookie_header/3
  - get_options/1
  - get_options/2
  - info/0
  - info/1
  - request/1
  - request/2
  - request/4
  - request/5
  - reset_cookies/0
  - reset_cookies/1
  - set_options/1
  - set_options/2
  - store_cookies/2
  - store_cookies/3
  - stream_next/1
  - which_cookies/0
  - which_cookies/1
  - which_sessions/0
  - which_sessions/1
- httpd
  - Top of manual page
  - info/1
  - info/2
  - info/2
  - info/3
  - info/4
  - info/3
  - parse_query/1
  - reload_config/2
  - Module:do/1
  - Module:remove/1
  - Module:store/2
- httpd_custom_api
  - Top of manual page
  - request_header/1
  - response_default_headers/0
  - response_header/1
- httpd_socket
  - Top of manual page
  - deliver/3
  - peername/2
  - resolve/0
- httpd_util
  - Top of manual page
  - convert_request_date/1
  - create_etag/1
  - day/1
  - decode_hex/1
  - flatlength/1
  - hexlist_to_integer/1
  - integer_to_hexlist/1
  - lookup/2
  - lookup/3
  - lookup_mime/2
  - lookup_mime/3
  - lookup_mime_default/2
  - lookup_mime_default/3
  - message/3
  - month/1
  - multi_lookup/2
  - reason_phrase/1
  - rfc1123_date/0
  - rfc1123_date/1
  - split/3
  - split_path/1
  - split_script_path/1
  - strip/1
  - suffix/1
- mod_alias
  - Top of manual page
  - default_index/2
  - path/3
  - real_name/3
  - real_script_name/3
- mod_auth
  - Top of manual page
  - add_group_member/3
  - add_group_member/4
  - add_group_member/5
  - add_user/2
  - add_user/5
  - add_user/6
  - delete_group/2
  - delete_group/4
  - delete_group_member/3
  - delete_group_member/4
  - delete_group_member/5
  - delete_user/2
  - delete_user/3
  - delete_user/4
  - get_user/2
  - get_user/3
  - get_user/4
  - list_group_members/2
  - list_group_members/3
  - list_group_members/4
  - list_groups/1
  - list_groups/2
  - list_groups/3
  - list_users/1
  - list_users/2
  - list_users/3
  - update_password/5
  - update_password/6
- mod_esi
  - Top of manual page
  - deliver/2
  - Module:Function/3
  - Module:Function/2
- mod_security
  - Top of manual page
  - block_user/4
  - block_user/5
  - list_auth_users/1
  - list_auth_users/2
  - list_auth_users/2
  - list_auth_users/3
  - list_blocked_users/1
  - list_blocked_users/2
  - list_blocked_users/2
  - list_blocked_users/3
  - unblock_user/2
  - unblock_user/3
  - unblock_user/3
  - unblock_user/4
  - Module:event/4
  - Module:event/5
- http_uri
  - Top of manual page
  - decode/1
  - encode/1
  - parse/1
  - parse/2
  - scheme_defaults/0

# mod_security

### Module

mod_security

### Module Summary

Security Audit and Trailing Functionality

### Description

Security Audit and Trailing Functionality

### Exports

block_user(User, Port, Dir, Seconds) -> true | {error, Reason} |

block_user(User, Address, Port, Dir, Seconds) -> true | {error, Reason} |

### Types

User = string()
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Seconds = integer() | infinity
Reason = no_such_directory

block_user/4 and block_user/5 each blocks the user User from directory Dir for a specified amount of time.

list_auth_users(Port) -> Users | [] |

list_auth_users(Address, Port) -> Users | [] |

list_auth_users(Port, Dir) -> Users | [] |

list_auth_users(Address, Port, Dir) -> Users | [] |

### Types

Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Users = list() = [string()]

list_auth_users/1, list_auth_users/2, and list_auth_users/3 each returns a list of users that are currently authenticated. Authentications are stored for SecurityAuthTimeout seconds, and then discarded.

list_blocked_users(Port) -> Users | [] |

list_blocked_users(Address, Port) -> Users | [] |

list_blocked_users(Port, Dir) -> Users | [] |

list_blocked_users(Address, Port, Dir) -> Users | [] |

### Types

Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Users = list() = [string()]

list_blocked_users/1, list_blocked_users/2, and list_blocked_users/3 each returns a list of users that are currently blocked from access.

unblock_user(User, Port) -> true | {error, Reason} |

unblock_user(User, Address, Port) -> true | {error, Reason} |

unblock_user(User, Port, Dir) -> true | {error, Reason} |

unblock_user(User, Address, Port, Dir) -> true | {error, Reason} |

### Types

User = string()
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Reason = term()

unblock_user/2, unblock_user/3, and unblock_user/4 each removes the user User from the list of blocked users for Port (and Dir).

### SecurityCallbackModule

The SecurityCallbackModule is a user-written module that can receive events from the mod_security Erlang web server API module. This module only exports the functions event/[4,5] which are described here.

### Exports

Module:event(What, Port, Dir, Data) -> ignored | OTP 18.1

Module:event(What, Address, Port, Dir, Data) -> ignored | OTP 18.1

### Types

What = atom()
Port = integer()
Address = {A,B,C,D} | string()
Dir = string()
Data = [Info]
Info = {Name, Value}

event/4 or event/5 is called whenever an event occurs in the mod_security Erlang web server API module. (event/4 is called if Address is undefined, otherwise event/5. Argument What specifies the type of event that has occurred and is one of the following reasons:

auth_fail

  A failed user authentication.

user_block

  A user is being blocked from access.

user_unblock

  A user is being removed from the block list.

Note

The event user_unblock is not triggered when a user is removed from the block list explicitly using the unblock_user function.