Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

CloudEarthAU/fortinet-block-pages-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note

This project is still a work in progress.

fortinet-block-pages-generator

A simple CLI tool to generate Fortinet block pages from an HTML template.

What this does

  1. Inlines resources, such as CSS and JavaScript files.
  2. Minifies HTML files.
  3. Allows templates to be used to show/hide elements based on the page type
  4. Runs a server to preview the generated pages

An example

For example, you could input this
<h1>
    {% if type == "dlp_block_page" %}
    Transfer attempt blocked
    {% elseif type == "virus_block_page" %}
    Virus blocked
    {% elseif type == "application_control_block_page" %}
    Application blocked
    {% else %}
    Access blocked
    {% endif %}
</h1>
<div>
    {% for detail in details %}
        <b>{{ detail.title }}</b>
        <p>{{ detail.value }}</p>
    {% endfor %}
</div>

you would get these files as output:

fortiguard-block-page.html

<h1>
    Access blocked
</h1>
<div>
    <b>URL</b>
    <p>https://example.com</p>
    <b>Category</b>
    <p>Example</p>
</div>

url-block-page.html

<h1>
    Access blocked
</h1>
<div>
    <b>URL</b>
    <p>https://example.com</p>
    <b>Description</b>
    <p>Request Blocked</p>
    <b>URL Source</b>
    <p>Blocking Source</p>
</div>

application-control-block-page.html

<h1>
    Application blocked
</h1>
<div>
    <b>Application</b>
    <p>Facebook</p>
    <b>Category</b>
    <p>Social Media</p>
    <b>URL</b>
    <p>https://example.com</p>
    <b>Policy</b>
    <p>61F1317D-9A44-4B86-BB0B-201C9A3956C2</p>
</div>

dlp-block-page.html

<h1>
    Transfer attempt blocked
</h1>
<div>
    <b>URL</b>
    <p>https://example.com</p>
</div>

virus-block-page.html

<h1>
    Virus blocked
</h1>
<div>
    <b>URL</b>
    <p>https://www.example.com/</p>
    <b>Quarantined File Name</b>
    <p>example.exe</p>
    <b>Reference URL</b>
    <p>https://fortiguard.com/encyclopedia/virus/1</p>
</div>

Usage

Development

  1. Create a new project with
fortinet-block-pages-generator init my-project
cd my-project
  1. Launch the development server with
fortinet-block-pages-generator dev
  1. Edit index.html and see the changes live

Build

To build the project:

fortinet-block-pages-generator build

AI code

Some of this code was written by AI. This is because I use AI for refactoring and adding better error handling (basically things I don't want to do myself). Also I use AI completions in my editor.

I (@Inglan) have prefixed any commits that primarily use AI with [With AI] or similar.

About

[Work in progress] A simple CLI tool to generate Fortinet block pages from an HTML template.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •