HSL
From Halon Security
Halon Scripting Language is the core component in the mail security (SPG/VSP-series) for configuration of mail and IP flows. The language can be split into five different components: core, IP Policy, Mail Authentication, Mail Recipient, Mail Content and Mail Transport. The core consists of function that are shared between all the others, and can be executed in any context. You can think of the others (IP Policy, Mail Content, etc) as language extensions since they both add a few predefined variables and function that can be used in each one of the flows.
Contents |
Learning Halon Scripting Language
In order to master the HSL you need to know the essence of the language, which is inspired by C, Perl and PHP. This includes the syntax, control structures, data types and core functions. This reference guide assumes you have some basic knowledge on computer programming. One can also learn from the "Show Script" button (the {} icon in the flow tables) which displays the script compiled from the built-in flow blocks.
Core Language
Core functions are recognized by their lowercase names, and can be used in any flow (which maps to a script executed by a process). Most functions are indeed core functions, for reusability. Other functions which are context dependent (such as the Block() function, blocking an IP packet) have capitalized names, and documented in the respective flow sections.
IP Policy Flow
The IP Policy variables and functions are only available when creating a IP Policy flow. It operates on IP packets, and have thus only functions like Block() and Allow(). In order to produce meaningful scripts/flows, network functions from the core component can be used, such as in_network(), dns() or globalview(). The scripts are processed by ippolicyd.
Mail Flows
The mail flows are all closely tied to SMTP, as they are executed in each stage of the SMTP conversation, by different processes. The Authentication and Recipient flows are very much alike (and both part of the process mailpolicyd) but are processed in two different steps (EHLO/AUTH vs. MAIL FROM/RCPT TO). The Mail Content flow is issued when the entire e-mail is received (DATA), and processed by the mailscand process. The Mail Transport flow is issued when the outgoing SMTP transport fails to deliver a message; as a last resort. It's processed in the outgoing queue transport process; mailqueued.
