We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

OS Lock

Potency
3 / 3
Resilience
3 / 5
Cost
2 / 5

Tags: os,lock,operating system

Description

OS Lock locks code to a list of operating systems. This will ensure that the
code will only work in one of the allowed operating systems. This is a good
transformation to enforce applications to a specific platform. A warning
function
can be specified (optionally) to be executed when the code runs in any
other operating system. The warning function is implemented by you and can be
used, for instance, to send a report to your server or to pop up a message.

Consider combining this transformation with obfuscation transformations to harden
the resulting code making it more resilient to automated de-obfuscator tools and
harder to understand by a human. You may also find useful to combine this
transformation with other locks:

Option Types

Name Required Default Value Description
oses Yes N/A List of OSes where the code is allowed to run.
warningFunction No N/A Name of the function that is called when the code is executed in a OS that is not in the list of allowed OSes.

API Parameters

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "osLock",
"options": {
"oses": [
"linux",
"windows",
"osx",
"tizen",
"android",
"ios"
],
"warningFunction": "VALUE"
}
}
]
}