ScienceLogic Policy/Rule API
Rules are the individual parts of a device policy.## Regular ExpressionsA regular expression specifies a set of strings as a pattern, rather than a list. For example, the pattern`C(o|as?)t` matches the strings Cot, Cat, and Cast, but not Coast. Skylar Compliance uses Perl-flavour RegularExpressions.Most characters can be used in a regular expression; however, some characters, called metacharacters, have specialmeanings:* `()` denote grouping: `(a|b)b` matches `ab` and `bb`* `|` denotes an alternative (see above)* `^` matches the beginning of a line* `$` matches the end of a line* `.` matches any character* `+` denotes one or more occurrences of the previous character: `a+b` matches `ab`, `aab`, `abb`, but not `b`* `*` denotes zero or more occurrences of the previous character: `a*b` matches `b`, `ab`, `aab`, `aaab`* `?` denotes zero or one occurrences of the previous character: `a?b` matches `b` and `ab`, but not `aab` or `aaab`Character classes are matches for sets of possible characters, rather than just a single character. For instance:* `[bcr]at` matches `bat`, `cat` and `rat`* `-` can be used as a range operator in a character class, so `[a-g]` matches any character from `a` to `g`There are some useful abbreviations for common character classes, in particular:* `\d` matches a digit* `\s` matches whitespace (a space or a tab)* `\w` matches a word character (alphanumeric or a _)For instance, `\d\d:\d\d:\d\d` would match a time in a hh:mm:ss format.For more information and examples of regular expressions, please see[this reference guide](http://www.regularexpressions.info/reference.html).## Lua FunctionsRules can be defined as Lua functions.Available functions for compliance rules are:* `nextline()` returns the next line of text* `getline(n)` returns the given line of text* `numlines()` returns the number of lines* `addmessage(m)` allows you to replace a series of variables in the remediation text. For instance, `addmessage("Hello")` with a remediation text of `$1` "World!" would produce the output `Hello World!`.The next `addmessage` call would replace `$2`, and so on.### ExampleThis function checks that the number of lines containing "configure" matches the lines containing "port":```luanum1 = 0num2 = 0line, next = nextline()while next do if line:match("configure") then num1 = num1+1 end if line:match("port") then num2 = num2+1 end line, next = nextlineendif num1 > num2 then addmessage("more")else if num2 < num1 then addmessage("less") endreturn num1 == num2```Remediation Text: `Config contains $1 configures than ports.`## RemediationRemediation is an action to be performed when a compliance rule is not met, generally intended to rectify theviolation. The following remediation types can be configured:* `Manual`: in this case, the remediation text will simply be appended to the notification email, signifying that the recipient should take the appropriate action.* `Command`: this will execute one of the stored Actions on the device (see Controlling a device).* `Automatic`: this setting will treat the text specified in the textbox as a command and execute it on the device.If the rule match type is **Regex**, the remediation can make use of the **Capture** feature, whereby parts ofthe pattern in brackets can be captured and then referred to in the remediation text (as `$1`, `$2`, etc.).For example, a rule may state that a configuration must not contain the regex:```set telnet (\d+\.\d+\.\d+\.\d+)```where the part in brackets is a match for an IP address. If this rule is violated, the configuration can beremedied using the phrase:```unset telnet $1```In this case, the brackets in the rule will capture the IP address, and fill it in when the command is performed, expanding to```unset telnet 1.2.3.4```if that was the matched IP address.
ScienceLogic Policy/Rule API is one of 80 APIs that ScienceLogic publishes on the APIs.io network, described by a machine-readable OpenAPI specification.
Tagged areas include Policy/Rule. The published artifact set on APIs.io includes an OpenAPI specification, an API reference, and API documentation.
This API exposes 6 operations across 3 paths. It is described by OpenAPI 3.2.0, at version 2.0.
Requests are made against a single base URL, /api/v2.
Metadata
The identity and technical contract details declared by the specification.
Authentication & Security 3
ScienceLogic Policy/Rule API declares
3 security schemes
for authenticating requests.
An API key is passed in the cookie as session (Cookie).
An API key is passed in the header as Authorization (Token).
It supports OpenID Connect (Permissions) discovered at https://ignore.example.com.
By default, every request must be authenticated.
Cookie— The Skylar Compliance web interface uses session cookies to authenticate API requests coming from a user's browser. Please use authentication tokens when integ…Token— To integrate with the Skylar Compliance API, please use the web interface to create API tokens. API requests via token should pass an Authorization header usin…Permissions— Lists required [Permissions](tag/Permission) for each individual endpoint. Please note: Whilst this authentication method is listed as an OpenID Connect authen…
Paths & Operations 6
Across 3 paths, the API surfaces 6 operations — 1 DELETE, 2 GET, 2 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.
Rules are the individual parts of a device policy.
Specification
The full machine-readable OpenAPI contract behind this narrative.
Source
More from ScienceLogic 12
Other APIs ScienceLogic publishes across the network.
This is an independent, third-party profile of ScienceLogic Policy/Rule API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.
The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.
Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.
info@apievangelist.com
·
Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and
you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.