├── tools
├── scripts
│ ├── utils.sh
│ ├── google-java-format.sh
│ └── setup-malc.sh
└── git-hooks
│ ├── pre-commit.d
│ ├── format-pom.sh
│ └── format-java.sh
│ └── install.sh
├── src
├── main
│ ├── resources
│ │ └── icons
│ │ │ ├── User.svg
│ │ │ ├── Password.svg
│ │ │ ├── Host.svg
│ │ │ └── Network.svg
│ └── mal
│ │ └── exampleLang.mal
└── test
│ └── java
│ └── org
│ └── mal_lang
│ └── examplelang
│ └── test
│ ├── ExampleLangTest.java
│ ├── TestGuessPassword.java
│ ├── TestPhishing.java
│ └── TestExampleLang.java
├── .gitignore
├── .github
└── workflows
│ ├── maven-build.yml
│ ├── release-on-tag.yml
│ └── release-on-push.yml
├── RELEASE.md
├── NOTICE
├── README.md
├── pom.xml
└── LICENSE
/tools/scripts/utils.sh:
--------------------------------------------------------------------------------
1 | # shellcheck shell=sh
2 |
3 | comma_list() {
4 | echo "$1" | sed "/^[[:space:]]*$/d" | tr "\n" "," | sed "s/,$/\n/g"
5 | }
6 |
--------------------------------------------------------------------------------
/tools/scripts/google-java-format.sh:
--------------------------------------------------------------------------------
1 | # shellcheck shell=sh
2 |
3 | get_latest_assets() {
4 | curl -fLSs "https://api.github.com/repos/google/google-java-format/releases/latest" | jq -c .assets[]
5 | }
6 |
7 | get_latest_asset() {
8 | get_latest_assets | while IFS= read -r asset; do
9 | if echo "$asset" | jq -r .name | grep -q "^google-java-format-.*-all-deps\.jar$"; then
10 | echo "$asset"
11 | fi
12 | done
13 | }
14 |
15 | get_latest_name() {
16 | get_latest_asset | jq -r .name
17 | }
18 |
19 | get_latest_url() {
20 | get_latest_asset | jq -r .browser_download_url
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/resources/icons/User.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tools/git-hooks/pre-commit.d/format-pom.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eu
4 |
5 | cd "$(dirname "$0")/../../.."
6 |
7 | echo_changed_pom() {
8 | set +e
9 | git diff --cached --name-only --diff-filter=ACMR | grep "^pom\.xml$"
10 | set -e
11 | }
12 |
13 | format_pom() {
14 | # shellcheck source=../../scripts/utils.sh
15 | . tools/scripts/utils.sh
16 |
17 | echo "Formatting $(echo "$changed_pom" | wc -l) pom.xml files"
18 | mvn -B -q -Dincludes="$(comma_list "$changed_pom")" xml-format:xml-format tidy:pom
19 | echo "$changed_pom" | tr "\n" "\0" | xargs -0 git add -f
20 | }
21 |
22 | main() {
23 | changed_pom="$(echo_changed_pom)"
24 | if [ -z "$changed_pom" ]; then
25 | exit
26 | fi
27 | format_pom
28 | }
29 |
30 | main
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 | # Maven
26 | target/
27 | pom.xml.tag
28 | pom.xml.releaseBackup
29 | pom.xml.versionsBackup
30 | pom.xml.next
31 | release.properties
32 | dependency-reduced-pom.xml
33 | buildNumber.properties
34 | .mvn/timing.properties
35 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar
36 | .mvn/wrapper/maven-wrapper.jar
37 |
38 | # JDT
39 | .classpath
40 | .factorypath
41 | .project
42 | .settings
43 |
--------------------------------------------------------------------------------
/src/main/resources/icons/Password.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tools/git-hooks/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eu
4 |
5 | cd "$(dirname "$0")/../.."
6 |
7 | repo_dir="$PWD"
8 | hooks_dir="$repo_dir/.git/hooks"
9 |
10 | echo_hook() {
11 | echo "#!/bin/sh"
12 | echo
13 | echo "set -eu"
14 | echo
15 | echo "cd \"\$(dirname \"\$0\")/../..\""
16 | echo
17 | echo "hook=\"\$(basename \"\$0\")\""
18 | echo "hook_dir=\"tools/git-hooks/\$hook.d\""
19 | echo
20 | echo "if [ -d \"\$hook_dir\" ]; then"
21 | echo " for script in \"\$hook_dir\"/*.sh; do"
22 | echo " if [ -x \"\$script\" ]; then"
23 | echo " echo \"Running \$hook hook \$(basename \"\$script\")\""
24 | echo " \"./\$script\" \"\$@\""
25 | echo " fi"
26 | echo " done"
27 | echo "fi"
28 | }
29 |
30 | main() {
31 | for hook in pre-commit prepare-commit-msg commit-msg post-commit; do
32 | hook_file="$hooks_dir/$hook"
33 | echo_hook >"$hook_file"
34 | chmod a+x "$hook_file"
35 | done
36 | }
37 |
38 | main
39 |
--------------------------------------------------------------------------------
/src/test/java/org/mal_lang/examplelang/test/ExampleLangTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2022 Foreseeti AB
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.mal_lang.examplelang.test;
17 |
18 | import core.Asset;
19 | import core.AttackStep;
20 | import core.Defense;
21 | import org.junit.jupiter.api.AfterEach;
22 |
23 | public class ExampleLangTest {
24 | @AfterEach
25 | public void deleteModel() {
26 | Asset.allAssets.clear();
27 | AttackStep.allAttackSteps.clear();
28 | Defense.allDefenses.clear();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.github/workflows/maven-build.yml:
--------------------------------------------------------------------------------
1 | name: Maven Build
2 | on:
3 | pull_request:
4 | branches:
5 | - master
6 | jobs:
7 | maven-build:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v2
12 | with:
13 | persist-credentials: false
14 |
15 | - name: Set up JDK
16 | uses: actions/setup-java@v2
17 | with:
18 | distribution: adopt
19 | java-version: 11
20 | check-latest: true
21 |
22 | - name: Maven Build
23 | run: mvn -B clean test
24 |
25 | - name: Configure AWS Credentials
26 | uses: aws-actions/configure-aws-credentials@v1
27 | with:
28 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
29 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
30 | aws-region: eu-central-1
31 |
32 | - name: Maven Build
33 | run: mvn -B clean package -PsecuriCAD
34 |
35 | - name: Set up malc
36 | run: ./tools/scripts/setup-malc.sh
37 |
38 | - name: malc Build
39 | run: cd target && malc -i ../src/main/resources/icons -l ../LICENSE -n ../NOTICE ../src/main/mal/exampleLang.mal
40 |
--------------------------------------------------------------------------------
/src/main/resources/icons/Host.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tools/git-hooks/pre-commit.d/format-java.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eu
4 |
5 | cd "$(dirname "$0")/../../.."
6 |
7 | echo_changed_java() {
8 | set +e
9 | git diff --cached --name-only --diff-filter=ACMR | grep "\.java$"
10 | set -e
11 | }
12 |
13 | format_java() {
14 | # shellcheck source=../../scripts/google-java-format.sh
15 | . tools/scripts/google-java-format.sh
16 |
17 | latest_name="$(get_latest_name)"
18 | fmt_jar="$PWD/tools/$latest_name"
19 |
20 | if [ ! -f "$fmt_jar" ]; then
21 | echo "Downloading $latest_name"
22 | latest_url="$(get_latest_url)"
23 | wget -qO "$fmt_jar" "$latest_url"
24 | fi
25 |
26 | echo "Formatting $(echo "$changed_java" | wc -l) java files"
27 | echo "$changed_java" |
28 | tr "\n" "\0" |
29 | xargs -0 java \
30 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
31 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
32 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
33 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
34 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
35 | -jar "$fmt_jar" \
36 | --replace
37 | echo "$changed_java" | tr "\n" "\0" | xargs -0 git add -f
38 | }
39 |
40 | main() {
41 | changed_java="$(echo_changed_java)"
42 | if [ -z "$changed_java" ]; then
43 | exit
44 | fi
45 | format_java
46 | }
47 |
48 | main
49 |
--------------------------------------------------------------------------------
/src/test/java/org/mal_lang/examplelang/test/TestGuessPassword.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2022 Foreseeti AB
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.mal_lang.examplelang.test;
17 |
18 | import core.Attacker;
19 | import org.junit.jupiter.api.Test;
20 |
21 | public class TestGuessPassword extends ExampleLangTest {
22 | private static class GuessPasswordModel {
23 | public final Network internet = new Network("internet");
24 | public final Host server = new Host("server");
25 |
26 | public GuessPasswordModel() {
27 | internet.addHosts(server);
28 | }
29 | }
30 |
31 | @Test
32 | public void testGuessPassword() {
33 | var model = new GuessPasswordModel();
34 |
35 | var attacker = new Attacker();
36 | attacker.addAttackPoint(model.internet.access);
37 | attacker.addAttackPoint(model.server.guessPassword);
38 | attacker.attack();
39 |
40 | model.server.access.assertCompromisedWithEffort();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/mal/exampleLang.mal:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2022 Foreseeti AB
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | #id: "org.mal-lang.examplelang"
17 | #version: "1.0.0"
18 |
19 | category System {
20 | asset Network {
21 | | access
22 | -> hosts.connect
23 | }
24 |
25 | asset Host {
26 | | connect
27 | -> access
28 | | authenticate
29 | -> access
30 | | guessPassword
31 | -> guessedPassword
32 | | guessedPassword [Exponential(0.02)]
33 | -> authenticate
34 | & access
35 | }
36 |
37 | asset User {
38 | | attemptPhishing
39 | -> phish
40 | | phish [Exponential(0.1)]
41 | -> passwords.obtain
42 | }
43 |
44 | asset Password {
45 | | obtain
46 | -> host.authenticate
47 | }
48 | }
49 |
50 | associations {
51 | Network [networks] * <-- NetworkAccess --> * [hosts] Host
52 | Host [host] 1 <-- Credentials --> * [passwords] Password
53 | User [user] 1 <-- Credentials --> * [passwords] Password
54 | }
55 |
--------------------------------------------------------------------------------
/.github/workflows/release-on-tag.yml:
--------------------------------------------------------------------------------
1 | name: Release on Tag
2 | on:
3 | push:
4 | tags:
5 | - release/*
6 | jobs:
7 | release-on-tag:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v2
12 | with:
13 | persist-credentials: false
14 |
15 | - name: Create Release Name
16 | run: |
17 | echo "${{ github.ref }}" | sed "s|^refs/tags/release/\(.*\)$|release_name=\1|" >> $GITHUB_ENV
18 | shell: bash
19 |
20 | - name: Set up JDK
21 | uses: actions/setup-java@v2
22 | with:
23 | distribution: adopt
24 | java-version: 11
25 | check-latest: true
26 |
27 | - name: Configure AWS Credentials
28 | uses: aws-actions/configure-aws-credentials@v1
29 | with:
30 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
31 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32 | aws-region: eu-central-1
33 |
34 | - name: Build jar
35 | run: mvn -B clean package -PsecuriCAD
36 |
37 | - name: Set up malc
38 | run: ./tools/scripts/setup-malc.sh
39 |
40 | - name: Build mar
41 | run: cd target && malc -i ../src/main/resources/icons -l ../LICENSE -n ../NOTICE ../src/main/mal/exampleLang.mal
42 |
43 | - name: Create release
44 | uses: softprops/action-gh-release@v1
45 | with:
46 | files: |
47 | target/examplelang-*.jar
48 | target/org.mal-lang.examplelang-*.mar
49 | name: ${{ env.release_name }}
50 | env:
51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 |
--------------------------------------------------------------------------------
/tools/scripts/setup-malc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eu
4 |
5 | cd "$(dirname "$0")/../.."
6 |
7 | get_latest_assets() {
8 | curl -fLSs "https://api.github.com/repos/mal-lang/malc/releases/latest" | jq -c .assets[]
9 | }
10 |
11 | get_latest_asset() {
12 | get_latest_assets | while IFS= read -r asset; do
13 | if echo "$asset" | jq -r .name | grep -q "^malc-.*\.linux\.amd64\.tar\.gz$"; then
14 | echo "$asset"
15 | fi
16 | done
17 | unset asset
18 | }
19 |
20 | get_latest_name() {
21 | get_latest_asset | jq -r .name
22 | }
23 |
24 | get_latest_url() {
25 | get_latest_asset | jq -r .browser_download_url
26 | }
27 |
28 | download_malc() {
29 | latest_name="$(get_latest_name)"
30 | latest_url="$(get_latest_url)"
31 | malc_tarball="$PWD/tools/$latest_name"
32 |
33 | echo "Downloading $latest_name"
34 | rm -f "$malc_tarball"
35 | wget -qO "$malc_tarball" "$latest_url"
36 |
37 | unset latest_name latest_url
38 | }
39 |
40 | install_malc() {
41 | malc_dir="$(basename "$malc_tarball")"
42 | malc_dir="${malc_dir%.tar.gz}"
43 | malc_dir="/opt/$malc_dir"
44 |
45 | echo "Installing $(basename "$malc_tarball")"
46 | sudo mkdir -p /opt /usr/local/bin /usr/local/share/man/man1 /usr/local/share/bash-completion/completions
47 | sudo rm -fR "$malc_dir"
48 | sudo tar -xzf "$malc_tarball" -C /opt
49 | sudo ln -sf "$malc_dir/malc" /usr/local/bin/malc
50 | sudo ln -sf "$malc_dir/malc.1" /usr/local/share/man/man1/malc.1
51 | sudo ln -sf "$malc_dir/malc_completion.sh" /usr/local/share/bash-completion/completions/malc
52 | }
53 |
54 | main() {
55 | download_malc
56 | install_malc
57 | }
58 |
59 | main
60 |
--------------------------------------------------------------------------------
/src/test/java/org/mal_lang/examplelang/test/TestPhishing.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2022 Foreseeti AB
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.mal_lang.examplelang.test;
17 |
18 | import core.Attacker;
19 | import org.junit.jupiter.api.Test;
20 |
21 | public class TestPhishing extends ExampleLangTest {
22 | private static class PhishingModel {
23 | public final Network internet = new Network("internet");
24 | public final Host server = new Host("server");
25 | public final User alice = new User("Alice");
26 | public final Password password123 = new Password("password123");
27 |
28 | public PhishingModel() {
29 | internet.addHosts(server);
30 | server.addPasswords(password123);
31 | alice.addPasswords(password123);
32 | }
33 | }
34 |
35 | @Test
36 | public void testPhishing() {
37 | var model = new PhishingModel();
38 |
39 | var attacker = new Attacker();
40 | attacker.addAttackPoint(model.internet.access);
41 | attacker.addAttackPoint(model.alice.attemptPhishing);
42 | attacker.attack();
43 |
44 | model.server.access.assertCompromisedWithEffort();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/resources/icons/Network.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/RELEASE.md:
--------------------------------------------------------------------------------
1 | # Release exampleLang
2 |
3 | This file describes how to make release builds of exampleLang.
4 |
5 | To make a release, perform the following steps:
6 |
7 | 1. Make a release commit and push it to a new branch
8 | 2. Make a pull request to `master` and get it approved and merged
9 | 3. Make a release tag for the merged pull request
10 |
11 | ### 1. Make a release commit and push it to a new branch
12 |
13 | The release commit shall contain the following changes in `pom.xml`:
14 |
15 | - `project.version` is set to the release version, e.g. `1.0.0`
16 |
17 | The release commit shall contain the following changes in `src/main/mal/exampleLang.mal`:
18 |
19 | - `#version` is set to the release version, e.g. `1.0.0`
20 |
21 | The name of the new branch doesn't matter, since it will be deleted after the release commit has been merged to `master`, but the convention for branch names is `/`, e.g. `max/release`.
22 |
23 | The commit message shall be `Release `, e.g. `Release 1.0.0`.
24 |
25 | ```
26 | $ git checkout -b max/release
27 | $ sed -i 's|^ .*$| 1.0.0|' pom.xml
28 | $ sed -i 's|^#version: ".*"$|#version: "1.0.0"|' src/main/mal/exampleLang.mal
29 | $ git add pom.xml src/main/mal/exampleLang.mal
30 | $ git commit -m "Release 1.0.0"
31 | $ git push origin max/release
32 | ```
33 |
34 | ### 2. Make a pull request to `master` and get it approved and merged
35 |
36 | Go to the repository on GitHub, click `Pull requests`, and then `New pull request`. Make sure that `base` is set to `master`, and set `compare` to your branch. Click `Create pull request`, add appropriate `Reviewers`, and add yourself as `Assignees`.
37 |
38 | ### 3. Make a release tag for the merged pull request
39 |
40 | Once your pull request has been merged, you need to fetch the new merged commit in `master` to create the release tag:
41 |
42 | ```
43 | $ git checkout master
44 | $ git fetch
45 | $ git merge --ff-only
46 | $ git tag release/1.0.0
47 | $ git push origin release/1.0.0
48 | ```
49 |
--------------------------------------------------------------------------------
/.github/workflows/release-on-push.yml:
--------------------------------------------------------------------------------
1 | name: Release on Push
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | release-on-push:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v2
12 | with:
13 | persist-credentials: false
14 |
15 | - name: Set up JDK
16 | uses: actions/setup-java@v2
17 | with:
18 | distribution: adopt
19 | java-version: 11
20 | check-latest: true
21 |
22 | - name: Configure AWS Credentials
23 | uses: aws-actions/configure-aws-credentials@v1
24 | with:
25 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
26 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27 | aws-region: eu-central-1
28 |
29 | - name: Build jar
30 | run: mvn -B clean package -PsecuriCAD
31 |
32 | - name: Set up malc
33 | run: ./tools/scripts/setup-malc.sh
34 |
35 | - name: Build mar
36 | run: cd target && malc -i ../src/main/resources/icons -l ../LICENSE -n ../NOTICE ../src/main/mal/exampleLang.mal
37 |
38 | - name: Delete previous tag and release 'latest'
39 | uses: dev-drprasad/delete-tag-and-release@v0.2.0
40 | with:
41 | delete_release: true
42 | tag_name: latest
43 | env:
44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 |
46 | - name: Create tag 'latest'
47 | uses: actions/github-script@v4
48 | with:
49 | script: |
50 | github.git.createRef({
51 | owner: context.repo.owner,
52 | repo: context.repo.repo,
53 | ref: "refs/tags/latest",
54 | sha: context.sha,
55 | });
56 |
57 | - name: Create release 'latest'
58 | uses: softprops/action-gh-release@v1
59 | with:
60 | prerelease: true
61 | files: |
62 | target/examplelang-*.jar
63 | target/org.mal-lang.examplelang-*.mar
64 | tag_name: latest
65 | env:
66 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 |
--------------------------------------------------------------------------------
/src/test/java/org/mal_lang/examplelang/test/TestExampleLang.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-2022 Foreseeti AB
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.mal_lang.examplelang.test;
17 |
18 | import core.Attacker;
19 | import org.junit.jupiter.api.Test;
20 |
21 | public class TestExampleLang extends ExampleLangTest {
22 | private static class ExampleLangModel {
23 | public final Network internet = new Network("internet");
24 | public final Host server = new Host("server");
25 | public final Password password123 = new Password("password123");
26 |
27 | public ExampleLangModel() {
28 | internet.addHosts(server);
29 | server.addPasswords(password123);
30 | }
31 | }
32 |
33 | @Test
34 | public void testAccess() {
35 | var model = new ExampleLangModel();
36 |
37 | var attacker = new Attacker();
38 | attacker.addAttackPoint(model.internet.access);
39 | attacker.addAttackPoint(model.password123.obtain);
40 | attacker.attack();
41 |
42 | model.server.access.assertCompromisedInstantaneously();
43 | }
44 |
45 | @Test
46 | public void testNoPassword() {
47 | var model = new ExampleLangModel();
48 |
49 | var attacker = new Attacker();
50 | attacker.addAttackPoint(model.internet.access);
51 | attacker.attack();
52 |
53 | model.server.access.assertUncompromised();
54 | }
55 |
56 | @Test
57 | public void testNoNetwork() {
58 | var model = new ExampleLangModel();
59 |
60 | var attacker = new Attacker();
61 | attacker.addAttackPoint(model.password123.obtain);
62 | attacker.attack();
63 |
64 | model.server.access.assertUncompromised();
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | ================================================================================
2 | == exampleLang ==
3 | ================================================================================
4 |
5 | exampleLang
6 | Copyright © 2020-2022 Foreseeti AB
7 |
8 | Licensed under the Apache License, Version 2.0
9 | .
10 |
11 | ================================================================================
12 | == Host.svg ==
13 | ================================================================================
14 |
15 | "Computer" icon
16 | by ✦ Shmidt Sergey ✦
17 | from the Noun Project
18 | is licensed under CC BY 3.0 .
19 |
20 | ================================================================================
21 | == Network.svg ==
22 | ================================================================================
23 |
24 | "Network" icon
25 | by ✦ Shmidt Sergey ✦
26 | from the Noun Project
27 | is licensed under CC BY 3.0 .
28 |
29 | ================================================================================
30 | == Password.svg ==
31 | ================================================================================
32 |
33 | "Lock" icon
34 | by ✦ Shmidt Sergey ✦
35 | from the Noun Project
36 | is licensed under CC BY 3.0 .
37 |
38 | ================================================================================
39 | == User.svg ==
40 | ================================================================================
41 |
42 | "User" icon
43 | by ✦ Shmidt Sergey ✦
44 | from the Noun Project
45 | is licensed under CC BY 3.0 .
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # exampleLang
2 |
3 | exampleLang is a MAL language intended to demonstrate the Maven
4 | project structure of a MAL language.
5 |
6 | This project has the following structure:
7 |
8 | * The file `pom.xml` is the Maven configuration file of the project.
9 | * The directory `src/main/mal` contains the MAL specification
10 | `exampleLang.mal`, which is the MAL specification of exampleLang.
11 | * The directory `src/main/resources/icons` contains SVG icons for the
12 | assets in exampleLang.
13 | * The directory `src/test/java/org/mal_lang/examplelang/test`
14 | contains the unit tests of exampleLang.
15 |
16 | ## Apache Maven
17 |
18 | [Apache Maven](https://maven.apache.org/) is a build tool and
19 | dependency management tool for Java projects. You can read more about
20 | Maven at . Follow the
21 | instructions at to download
22 | Maven, and follow the instructions at
23 | to install Maven.
24 |
25 | ## Building exampleLang and running the unit tests
26 |
27 | The
28 | [MAL compiler](https://github.com/meta-attack-language/malcompiler)
29 | compiles MAL specifications (`.mal` files) into different formats,
30 | using different backends. The reference backend generates Java code
31 | that is suitable for testing purposes and evaluating your language.
32 |
33 | ### Building with the reference backend and running the unit tests
34 |
35 | To compile exampleLang with the reference backend of the MAL compiler
36 | and then run the unit tests, execute the following command from the
37 | `exampleLang` directory:
38 |
39 | ```
40 | mvn test
41 | ```
42 |
43 | This will invoke the MAL compiler's reference backend to generate
44 | `.java` files under `target/generated-test-sources`. These `.java`
45 | files and the unit tests in `src/test/java` will then be compiled
46 | into `.class` files under `target/test-classes`. The unit tests will
47 | then finally be executed.
48 |
49 | To only compile exampleLang into `.java` files, execute the following
50 | command:
51 |
52 | ```
53 | mvn generate-test-sources
54 | ```
55 |
56 | To compile exampleLang into `.java` files and then compile these
57 | `.java` files and the unit tests in `src/test/java` into `.class`
58 | files, execute the following command:
59 |
60 | ```
61 | mvn test-compile
62 | ```
63 |
64 | To run a specific test class, execute the following command:
65 |
66 | ```
67 | mvn test -Dtest=TestExampleLang
68 | ```
69 |
70 | Where `TestExampleLang` is the test class.
71 |
72 | To run a specific test method in a test class, execute the following
73 | command:
74 |
75 | ```
76 | mvn test -Dtest=TestExampleLang#testNoPassword
77 | ```
78 |
79 | Where `TestExampleLang` is the test class and `testNoPassword` is the
80 | test method.
81 |
82 | ## Using exampleLang as a template MAL language
83 |
84 | To create a new language using exampleLang as a template, you need to
85 | do the following:
86 |
87 | * Create a new MAL language project using exampleLang as the template
88 | * `cp -r exampleLang/ myLang/`
89 | * Enter the directory of the new MAL language project
90 | * `cd myLang/`
91 | * Update `LICENSE` with a license of your choice
92 | * Update copyright notices to reflect your license in
93 | * `NOTICE`
94 | * `README.md`
95 | * `pom.xml`
96 | * `src/main/mal/exampleLang.mal`
97 | * `src/test/java/org/mal_lang/examplelang/test/*.java`
98 | * Update `README.md` with relevant information about your language.
99 | Information about how to use Markdown can be found at
100 | .
101 | * Update `pom.xml` to reflect your project
102 | * Update `` with a reverse domain name that you can use
103 | * Example: `com.example`
104 | * Update `` with a suitable name
105 | * Example: `mylang`
106 | * Update `` with the version of your language
107 | * Example: `1.0.0`
108 | * Update `` with the name of your language
109 | * Example: `myLang`
110 | * Update `` with the name of the main MAL specification
111 | of your language
112 | * Example: `myLang.mal`
113 | * Update `` with the test package name of
114 | your language
115 | * Example: `com.example.mylang.test`
116 | * Rename `src/main/mal/exampleLang.mal` to the name of the main MAL
117 | specification of your language
118 | * `mv src/main/mal/exampleLang.mal src/main/mal/myLang.mal`
119 | * Update your main MAL specification's `#id` and `#version`
120 | * Example: `#id: "com.example.mylang"`, `#version: "1.0.0"`
121 | * Rename unit tests in `src/test/java` to reflect your language
122 | * Change the package name of the unit tests to the test package name
123 | of your language
124 | * Example: `package com.example.mylang.test;`
125 |
126 | ## License
127 |
128 | Copyright © 2020-2022 [Foreseeti AB](https://foreseeti.com)
129 |
130 | All files distributed in the exampleLang project are licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), except for the following files:
131 |
132 | | File | License |
133 | | --- | --- |
134 | | [`Host.svg`](src/main/resources/icons/Host.svg) |
"[Computer](https://thenounproject.com/term/computer/576625/)" icon by [✦ Shmidt Sergey ✦](https://thenounproject.com/monstercritic/) from [the Noun Project](https://thenounproject.com/) is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). |
135 | | [`Network.svg`](src/main/resources/icons/Network.svg) |
"[Network](https://thenounproject.com/term/network/691907/)" icon by [✦ Shmidt Sergey ✦](https://thenounproject.com/monstercritic/) from [the Noun Project](https://thenounproject.com/) is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). |
136 | | [`Password.svg`](src/main/resources/icons/Password.svg) |
"[Lock](https://thenounproject.com/term/lock/576530/)" icon by [✦ Shmidt Sergey ✦](https://thenounproject.com/monstercritic/) from [the Noun Project](https://thenounproject.com/) is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). |
137 | | [`User.svg`](src/main/resources/icons/User.svg) |
"[User](https://thenounproject.com/term/user/581261/)" icon by [✦ Shmidt Sergey ✦](https://thenounproject.com/monstercritic/) from [the Noun Project](https://thenounproject.com/) is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). |
138 |
139 | See [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE) for details.
140 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | 4.0.0
19 |
20 | org.mal-lang
21 | examplelang
22 | 1.0.0
23 | jar
24 |
25 | exampleLang
26 | A MAL language that demonstrates the Maven project structure
27 | https://github.com/mal-lang/exampleLang
28 | 2020
29 |
30 | MAL
31 | https://mal-lang.org
32 |
33 |
34 |
35 | Apache-2.0
36 | https://apache.org/licenses/LICENSE-2.0.txt
37 | manual
38 |
39 |
40 |
41 |
42 |
43 | maxwalls
44 | Max Wällstedt
45 | max.wallstedt@foreseeti.com
46 | https://github.com/maxwalls
47 | foreseeti
48 | https://foreseeti.com
49 |
50 | developer
51 |
52 | Europe/Stockholm
53 |
54 | https://www.gravatar.com/avatar/f32021f9158fb3e2fc06414d056f46ec?size=64
55 |
56 |
57 |
58 |
59 |
60 | scm:git:git://github.com/mal-lang/exampleLang.git
61 | scm:git:ssh://git@github.com/mal-lang/exampleLang.git
62 | HEAD
63 | https://github.com/mal-lang/exampleLang
64 |
65 |
66 | GitHub Issues
67 | https://github.com/mal-lang/exampleLang/issues
68 |
69 |
70 |
71 | UTF-8
72 | UTF-8
73 | 11
74 | 11
75 | 11
76 | 0.1.0-SNAPSHOT
77 | 1.6.4
78 | ${kernelcad.version}
79 | ${kernelcad.version}
80 | exampleLang.mal
81 | org.mal_lang.examplelang
82 | org.mal_lang.examplelang.test
83 |
84 |
85 |
86 |
87 | org.junit.jupiter
88 | junit-jupiter
89 | 5.8.2
90 | test
91 |
92 |
93 |
94 |
95 |
96 | maven.foreseeti.com-release
97 | s3://maven.foreseeti.com/release
98 |
99 | true
100 |
101 |
102 | false
103 |
104 |
105 |
106 | maven.foreseeti.com-snapshot
107 | s3://maven.foreseeti.com/snapshot
108 |
109 | false
110 |
111 |
112 | true
113 |
114 |
115 |
116 | ossrh
117 | https://oss.sonatype.org/content/repositories/snapshots
118 |
119 | false
120 |
121 |
122 | true
123 |
124 |
125 |
126 |
127 |
128 | ossrh
129 | https://oss.sonatype.org/content/repositories/snapshots
130 |
131 | false
132 |
133 |
134 | true
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | false
143 | ${project.basedir}/src/main/resources
144 |
145 | icons/**
146 |
147 |
148 |
149 | META-INF
150 | false
151 | ${project.basedir}
152 |
153 | LICENSE
154 | NOTICE
155 |
156 |
157 |
158 |
159 |
160 |
161 | org.apache.maven.plugins
162 | maven-clean-plugin
163 | 3.1.0
164 |
165 |
166 | org.apache.maven.plugins
167 | maven-resources-plugin
168 | 3.2.0
169 |
170 |
171 | org.apache.maven.plugins
172 | maven-compiler-plugin
173 | 3.9.0
174 |
175 |
176 | -Xlint:all,-cast,-path,-processing
177 |
178 | true
179 | true
180 | true
181 |
182 |
183 |
184 | org.apache.maven.plugins
185 | maven-surefire-plugin
186 | 3.0.0-M5
187 |
188 |
189 | org.apache.maven.plugins
190 | maven-jar-plugin
191 | 3.2.2
192 |
193 | true
194 |
195 |
196 | true
197 | true
198 | true
199 | ${mal.securicad.package}
200 |
201 |
202 |
203 |
204 |
205 | org.apache.maven.plugins
206 | maven-install-plugin
207 | 3.0.0-M1
208 |
209 | true
210 |
211 |
212 |
213 | org.apache.maven.plugins
214 | maven-deploy-plugin
215 | 3.0.0-M2
216 |
217 | true
218 |
219 |
220 |
221 | org.mal-lang
222 | mal-maven-plugin
223 | ${malcompiler.version}
224 |
225 |
226 | com.allogy.maven.wagon
227 | maven-s3-wagon
228 | 1.2.0
229 |
230 |
231 | au.com.acegi
232 | xml-format-maven-plugin
233 | 3.2.0
234 |
235 |
236 |
237 |
238 |
239 | org.mal-lang
240 | mal-maven-plugin
241 |
242 |
243 | generate-test-code
244 |
245 | reference
246 |
247 |
248 |
249 |
250 |
251 | com.allogy.maven.wagon
252 | maven-s3-wagon
253 | true
254 |
255 |
256 |
257 |
258 |
259 |
260 | securiCAD
261 |
262 |
263 | com.foreseeti
264 | corelib
265 | ${corelib.version}
266 |
267 |
268 | com.foreseeti
269 | simulator
270 | ${simulator.version}
271 |
272 |
273 |
274 |
275 |
276 | org.mal-lang
277 | mal-maven-plugin
278 |
279 |
280 | generate-code
281 |
282 | securicad
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ================================================================================
2 | == Apache License, Version 2.0 ==
3 | == ==
4 | == ==
5 | == This license applies to all files distributed in the exampleLang project, ==
6 | == unless otherwise stated in this file. ==
7 | ================================================================================
8 |
9 | Apache License
10 | Version 2.0, January 2004
11 | http://www.apache.org/licenses/
12 |
13 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14 |
15 | 1. Definitions.
16 |
17 | "License" shall mean the terms and conditions for use, reproduction,
18 | and distribution as defined by Sections 1 through 9 of this document.
19 |
20 | "Licensor" shall mean the copyright owner or entity authorized by
21 | the copyright owner that is granting the License.
22 |
23 | "Legal Entity" shall mean the union of the acting entity and all
24 | other entities that control, are controlled by, or are under common
25 | control with that entity. For the purposes of this definition,
26 | "control" means (i) the power, direct or indirect, to cause the
27 | direction or management of such entity, whether by contract or
28 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
29 | outstanding shares, or (iii) beneficial ownership of such entity.
30 |
31 | "You" (or "Your") shall mean an individual or Legal Entity
32 | exercising permissions granted by this License.
33 |
34 | "Source" form shall mean the preferred form for making modifications,
35 | including but not limited to software source code, documentation
36 | source, and configuration files.
37 |
38 | "Object" form shall mean any form resulting from mechanical
39 | transformation or translation of a Source form, including but
40 | not limited to compiled object code, generated documentation,
41 | and conversions to other media types.
42 |
43 | "Work" shall mean the work of authorship, whether in Source or
44 | Object form, made available under the License, as indicated by a
45 | copyright notice that is included in or attached to the work
46 | (an example is provided in the Appendix below).
47 |
48 | "Derivative Works" shall mean any work, whether in Source or Object
49 | form, that is based on (or derived from) the Work and for which the
50 | editorial revisions, annotations, elaborations, or other modifications
51 | represent, as a whole, an original work of authorship. For the purposes
52 | of this License, Derivative Works shall not include works that remain
53 | separable from, or merely link (or bind by name) to the interfaces of,
54 | the Work and Derivative Works thereof.
55 |
56 | "Contribution" shall mean any work of authorship, including
57 | the original version of the Work and any modifications or additions
58 | to that Work or Derivative Works thereof, that is intentionally
59 | submitted to Licensor for inclusion in the Work by the copyright owner
60 | or by an individual or Legal Entity authorized to submit on behalf of
61 | the copyright owner. For the purposes of this definition, "submitted"
62 | means any form of electronic, verbal, or written communication sent
63 | to the Licensor or its representatives, including but not limited to
64 | communication on electronic mailing lists, source code control systems,
65 | and issue tracking systems that are managed by, or on behalf of, the
66 | Licensor for the purpose of discussing and improving the Work, but
67 | excluding communication that is conspicuously marked or otherwise
68 | designated in writing by the copyright owner as "Not a Contribution."
69 |
70 | "Contributor" shall mean Licensor and any individual or Legal Entity
71 | on behalf of whom a Contribution has been received by Licensor and
72 | subsequently incorporated within the Work.
73 |
74 | 2. Grant of Copyright License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | copyright license to reproduce, prepare Derivative Works of,
78 | publicly display, publicly perform, sublicense, and distribute the
79 | Work and such Derivative Works in Source or Object form.
80 |
81 | 3. Grant of Patent License. Subject to the terms and conditions of
82 | this License, each Contributor hereby grants to You a perpetual,
83 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84 | (except as stated in this section) patent license to make, have made,
85 | use, offer to sell, sell, import, and otherwise transfer the Work,
86 | where such license applies only to those patent claims licensable
87 | by such Contributor that are necessarily infringed by their
88 | Contribution(s) alone or by combination of their Contribution(s)
89 | with the Work to which such Contribution(s) was submitted. If You
90 | institute patent litigation against any entity (including a
91 | cross-claim or counterclaim in a lawsuit) alleging that the Work
92 | or a Contribution incorporated within the Work constitutes direct
93 | or contributory patent infringement, then any patent licenses
94 | granted to You under this License for that Work shall terminate
95 | as of the date such litigation is filed.
96 |
97 | 4. Redistribution. You may reproduce and distribute copies of the
98 | Work or Derivative Works thereof in any medium, with or without
99 | modifications, and in Source or Object form, provided that You
100 | meet the following conditions:
101 |
102 | (a) You must give any other recipients of the Work or
103 | Derivative Works a copy of this License; and
104 |
105 | (b) You must cause any modified files to carry prominent notices
106 | stating that You changed the files; and
107 |
108 | (c) You must retain, in the Source form of any Derivative Works
109 | that You distribute, all copyright, patent, trademark, and
110 | attribution notices from the Source form of the Work,
111 | excluding those notices that do not pertain to any part of
112 | the Derivative Works; and
113 |
114 | (d) If the Work includes a "NOTICE" text file as part of its
115 | distribution, then any Derivative Works that You distribute must
116 | include a readable copy of the attribution notices contained
117 | within such NOTICE file, excluding those notices that do not
118 | pertain to any part of the Derivative Works, in at least one
119 | of the following places: within a NOTICE text file distributed
120 | as part of the Derivative Works; within the Source form or
121 | documentation, if provided along with the Derivative Works; or,
122 | within a display generated by the Derivative Works, if and
123 | wherever such third-party notices normally appear. The contents
124 | of the NOTICE file are for informational purposes only and
125 | do not modify the License. You may add Your own attribution
126 | notices within Derivative Works that You distribute, alongside
127 | or as an addendum to the NOTICE text from the Work, provided
128 | that such additional attribution notices cannot be construed
129 | as modifying the License.
130 |
131 | You may add Your own copyright statement to Your modifications and
132 | may provide additional or different license terms and conditions
133 | for use, reproduction, or distribution of Your modifications, or
134 | for any such Derivative Works as a whole, provided Your use,
135 | reproduction, and distribution of the Work otherwise complies with
136 | the conditions stated in this License.
137 |
138 | 5. Submission of Contributions. Unless You explicitly state otherwise,
139 | any Contribution intentionally submitted for inclusion in the Work
140 | by You to the Licensor shall be under the terms and conditions of
141 | this License, without any additional terms or conditions.
142 | Notwithstanding the above, nothing herein shall supersede or modify
143 | the terms of any separate license agreement you may have executed
144 | with Licensor regarding such Contributions.
145 |
146 | 6. Trademarks. This License does not grant permission to use the trade
147 | names, trademarks, service marks, or product names of the Licensor,
148 | except as required for reasonable and customary use in describing the
149 | origin of the Work and reproducing the content of the NOTICE file.
150 |
151 | 7. Disclaimer of Warranty. Unless required by applicable law or
152 | agreed to in writing, Licensor provides the Work (and each
153 | Contributor provides its Contributions) on an "AS IS" BASIS,
154 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155 | implied, including, without limitation, any warranties or conditions
156 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157 | PARTICULAR PURPOSE. You are solely responsible for determining the
158 | appropriateness of using or redistributing the Work and assume any
159 | risks associated with Your exercise of permissions under this License.
160 |
161 | 8. Limitation of Liability. In no event and under no legal theory,
162 | whether in tort (including negligence), contract, or otherwise,
163 | unless required by applicable law (such as deliberate and grossly
164 | negligent acts) or agreed to in writing, shall any Contributor be
165 | liable to You for damages, including any direct, indirect, special,
166 | incidental, or consequential damages of any character arising as a
167 | result of this License or out of the use or inability to use the
168 | Work (including but not limited to damages for loss of goodwill,
169 | work stoppage, computer failure or malfunction, or any and all
170 | other commercial damages or losses), even if such Contributor
171 | has been advised of the possibility of such damages.
172 |
173 | 9. Accepting Warranty or Additional Liability. While redistributing
174 | the Work or Derivative Works thereof, You may choose to offer,
175 | and charge a fee for, acceptance of support, warranty, indemnity,
176 | or other liability obligations and/or rights consistent with this
177 | License. However, in accepting such obligations, You may act only
178 | on Your own behalf and on Your sole responsibility, not on behalf
179 | of any other Contributor, and only if You agree to indemnify,
180 | defend, and hold each Contributor harmless for any liability
181 | incurred by, or claims asserted against, such Contributor by reason
182 | of your accepting any such warranty or additional liability.
183 |
184 | END OF TERMS AND CONDITIONS
185 |
186 | APPENDIX: How to apply the Apache License to your work.
187 |
188 | To apply the Apache License to your work, attach the following
189 | boilerplate notice, with the fields enclosed by brackets "[]"
190 | replaced with your own identifying information. (Don't include
191 | the brackets!) The text should be enclosed in the appropriate
192 | comment syntax for the file format. We also recommend that a
193 | file or class name and description of purpose be included on the
194 | same "printed page" as the copyright notice for easier
195 | identification within third-party archives.
196 |
197 | Copyright [yyyy] [name of copyright owner]
198 |
199 | Licensed under the Apache License, Version 2.0 (the "License");
200 | you may not use this file except in compliance with the License.
201 | You may obtain a copy of the License at
202 |
203 | http://www.apache.org/licenses/LICENSE-2.0
204 |
205 | Unless required by applicable law or agreed to in writing, software
206 | distributed under the License is distributed on an "AS IS" BASIS,
207 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208 | See the License for the specific language governing permissions and
209 | limitations under the License.
210 |
211 |
212 |
213 |
214 | ================================================================================
215 | == Creative Commons Attribution 3.0 Unported License ==
216 | == ==
217 | == ==
218 | == This license applies to the following files: ==
219 | == - src/main/resources/icons/Host.svg ==
220 | == - src/main/resources/icons/Network.svg ==
221 | == - src/main/resources/icons/Password.svg ==
222 | == - src/main/resources/icons/User.svg ==
223 | == ==
224 | == See NOTICE for details. ==
225 | ================================================================================
226 |
227 | Creative Commons Legal Code
228 |
229 | Attribution 3.0 Unported
230 |
231 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
232 | LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
233 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
234 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
235 | REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
236 | DAMAGES RESULTING FROM ITS USE.
237 |
238 | License
239 |
240 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
241 | COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
242 | COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
243 | AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
244 |
245 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
246 | TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
247 | BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
248 | CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
249 | CONDITIONS.
250 |
251 | 1. Definitions
252 |
253 | a. "Adaptation" means a work based upon the Work, or upon the Work and
254 | other pre-existing works, such as a translation, adaptation,
255 | derivative work, arrangement of music or other alterations of a
256 | literary or artistic work, or phonogram or performance and includes
257 | cinematographic adaptations or any other form in which the Work may be
258 | recast, transformed, or adapted including in any form recognizably
259 | derived from the original, except that a work that constitutes a
260 | Collection will not be considered an Adaptation for the purpose of
261 | this License. For the avoidance of doubt, where the Work is a musical
262 | work, performance or phonogram, the synchronization of the Work in
263 | timed-relation with a moving image ("synching") will be considered an
264 | Adaptation for the purpose of this License.
265 | b. "Collection" means a collection of literary or artistic works, such as
266 | encyclopedias and anthologies, or performances, phonograms or
267 | broadcasts, or other works or subject matter other than works listed
268 | in Section 1(f) below, which, by reason of the selection and
269 | arrangement of their contents, constitute intellectual creations, in
270 | which the Work is included in its entirety in unmodified form along
271 | with one or more other contributions, each constituting separate and
272 | independent works in themselves, which together are assembled into a
273 | collective whole. A work that constitutes a Collection will not be
274 | considered an Adaptation (as defined above) for the purposes of this
275 | License.
276 | c. "Distribute" means to make available to the public the original and
277 | copies of the Work or Adaptation, as appropriate, through sale or
278 | other transfer of ownership.
279 | d. "Licensor" means the individual, individuals, entity or entities that
280 | offer(s) the Work under the terms of this License.
281 | e. "Original Author" means, in the case of a literary or artistic work,
282 | the individual, individuals, entity or entities who created the Work
283 | or if no individual or entity can be identified, the publisher; and in
284 | addition (i) in the case of a performance the actors, singers,
285 | musicians, dancers, and other persons who act, sing, deliver, declaim,
286 | play in, interpret or otherwise perform literary or artistic works or
287 | expressions of folklore; (ii) in the case of a phonogram the producer
288 | being the person or legal entity who first fixes the sounds of a
289 | performance or other sounds; and, (iii) in the case of broadcasts, the
290 | organization that transmits the broadcast.
291 | f. "Work" means the literary and/or artistic work offered under the terms
292 | of this License including without limitation any production in the
293 | literary, scientific and artistic domain, whatever may be the mode or
294 | form of its expression including digital form, such as a book,
295 | pamphlet and other writing; a lecture, address, sermon or other work
296 | of the same nature; a dramatic or dramatico-musical work; a
297 | choreographic work or entertainment in dumb show; a musical
298 | composition with or without words; a cinematographic work to which are
299 | assimilated works expressed by a process analogous to cinematography;
300 | a work of drawing, painting, architecture, sculpture, engraving or
301 | lithography; a photographic work to which are assimilated works
302 | expressed by a process analogous to photography; a work of applied
303 | art; an illustration, map, plan, sketch or three-dimensional work
304 | relative to geography, topography, architecture or science; a
305 | performance; a broadcast; a phonogram; a compilation of data to the
306 | extent it is protected as a copyrightable work; or a work performed by
307 | a variety or circus performer to the extent it is not otherwise
308 | considered a literary or artistic work.
309 | g. "You" means an individual or entity exercising rights under this
310 | License who has not previously violated the terms of this License with
311 | respect to the Work, or who has received express permission from the
312 | Licensor to exercise rights under this License despite a previous
313 | violation.
314 | h. "Publicly Perform" means to perform public recitations of the Work and
315 | to communicate to the public those public recitations, by any means or
316 | process, including by wire or wireless means or public digital
317 | performances; to make available to the public Works in such a way that
318 | members of the public may access these Works from a place and at a
319 | place individually chosen by them; to perform the Work to the public
320 | by any means or process and the communication to the public of the
321 | performances of the Work, including by public digital performance; to
322 | broadcast and rebroadcast the Work by any means including signs,
323 | sounds or images.
324 | i. "Reproduce" means to make copies of the Work by any means including
325 | without limitation by sound or visual recordings and the right of
326 | fixation and reproducing fixations of the Work, including storage of a
327 | protected performance or phonogram in digital form or other electronic
328 | medium.
329 |
330 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce,
331 | limit, or restrict any uses free from copyright or rights arising from
332 | limitations or exceptions that are provided for in connection with the
333 | copyright protection under copyright law or other applicable laws.
334 |
335 | 3. License Grant. Subject to the terms and conditions of this License,
336 | Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
337 | perpetual (for the duration of the applicable copyright) license to
338 | exercise the rights in the Work as stated below:
339 |
340 | a. to Reproduce the Work, to incorporate the Work into one or more
341 | Collections, and to Reproduce the Work as incorporated in the
342 | Collections;
343 | b. to create and Reproduce Adaptations provided that any such Adaptation,
344 | including any translation in any medium, takes reasonable steps to
345 | clearly label, demarcate or otherwise identify that changes were made
346 | to the original Work. For example, a translation could be marked "The
347 | original work was translated from English to Spanish," or a
348 | modification could indicate "The original work has been modified.";
349 | c. to Distribute and Publicly Perform the Work including as incorporated
350 | in Collections; and,
351 | d. to Distribute and Publicly Perform Adaptations.
352 | e. For the avoidance of doubt:
353 |
354 | i. Non-waivable Compulsory License Schemes. In those jurisdictions in
355 | which the right to collect royalties through any statutory or
356 | compulsory licensing scheme cannot be waived, the Licensor
357 | reserves the exclusive right to collect such royalties for any
358 | exercise by You of the rights granted under this License;
359 | ii. Waivable Compulsory License Schemes. In those jurisdictions in
360 | which the right to collect royalties through any statutory or
361 | compulsory licensing scheme can be waived, the Licensor waives the
362 | exclusive right to collect such royalties for any exercise by You
363 | of the rights granted under this License; and,
364 | iii. Voluntary License Schemes. The Licensor waives the right to
365 | collect royalties, whether individually or, in the event that the
366 | Licensor is a member of a collecting society that administers
367 | voluntary licensing schemes, via that society, from any exercise
368 | by You of the rights granted under this License.
369 |
370 | The above rights may be exercised in all media and formats whether now
371 | known or hereafter devised. The above rights include the right to make
372 | such modifications as are technically necessary to exercise the rights in
373 | other media and formats. Subject to Section 8(f), all rights not expressly
374 | granted by Licensor are hereby reserved.
375 |
376 | 4. Restrictions. The license granted in Section 3 above is expressly made
377 | subject to and limited by the following restrictions:
378 |
379 | a. You may Distribute or Publicly Perform the Work only under the terms
380 | of this License. You must include a copy of, or the Uniform Resource
381 | Identifier (URI) for, this License with every copy of the Work You
382 | Distribute or Publicly Perform. You may not offer or impose any terms
383 | on the Work that restrict the terms of this License or the ability of
384 | the recipient of the Work to exercise the rights granted to that
385 | recipient under the terms of the License. You may not sublicense the
386 | Work. You must keep intact all notices that refer to this License and
387 | to the disclaimer of warranties with every copy of the Work You
388 | Distribute or Publicly Perform. When You Distribute or Publicly
389 | Perform the Work, You may not impose any effective technological
390 | measures on the Work that restrict the ability of a recipient of the
391 | Work from You to exercise the rights granted to that recipient under
392 | the terms of the License. This Section 4(a) applies to the Work as
393 | incorporated in a Collection, but this does not require the Collection
394 | apart from the Work itself to be made subject to the terms of this
395 | License. If You create a Collection, upon notice from any Licensor You
396 | must, to the extent practicable, remove from the Collection any credit
397 | as required by Section 4(b), as requested. If You create an
398 | Adaptation, upon notice from any Licensor You must, to the extent
399 | practicable, remove from the Adaptation any credit as required by
400 | Section 4(b), as requested.
401 | b. If You Distribute, or Publicly Perform the Work or any Adaptations or
402 | Collections, You must, unless a request has been made pursuant to
403 | Section 4(a), keep intact all copyright notices for the Work and
404 | provide, reasonable to the medium or means You are utilizing: (i) the
405 | name of the Original Author (or pseudonym, if applicable) if supplied,
406 | and/or if the Original Author and/or Licensor designate another party
407 | or parties (e.g., a sponsor institute, publishing entity, journal) for
408 | attribution ("Attribution Parties") in Licensor's copyright notice,
409 | terms of service or by other reasonable means, the name of such party
410 | or parties; (ii) the title of the Work if supplied; (iii) to the
411 | extent reasonably practicable, the URI, if any, that Licensor
412 | specifies to be associated with the Work, unless such URI does not
413 | refer to the copyright notice or licensing information for the Work;
414 | and (iv) , consistent with Section 3(b), in the case of an Adaptation,
415 | a credit identifying the use of the Work in the Adaptation (e.g.,
416 | "French translation of the Work by Original Author," or "Screenplay
417 | based on original Work by Original Author"). The credit required by
418 | this Section 4 (b) may be implemented in any reasonable manner;
419 | provided, however, that in the case of a Adaptation or Collection, at
420 | a minimum such credit will appear, if a credit for all contributing
421 | authors of the Adaptation or Collection appears, then as part of these
422 | credits and in a manner at least as prominent as the credits for the
423 | other contributing authors. For the avoidance of doubt, You may only
424 | use the credit required by this Section for the purpose of attribution
425 | in the manner set out above and, by exercising Your rights under this
426 | License, You may not implicitly or explicitly assert or imply any
427 | connection with, sponsorship or endorsement by the Original Author,
428 | Licensor and/or Attribution Parties, as appropriate, of You or Your
429 | use of the Work, without the separate, express prior written
430 | permission of the Original Author, Licensor and/or Attribution
431 | Parties.
432 | c. Except as otherwise agreed in writing by the Licensor or as may be
433 | otherwise permitted by applicable law, if You Reproduce, Distribute or
434 | Publicly Perform the Work either by itself or as part of any
435 | Adaptations or Collections, You must not distort, mutilate, modify or
436 | take other derogatory action in relation to the Work which would be
437 | prejudicial to the Original Author's honor or reputation. Licensor
438 | agrees that in those jurisdictions (e.g. Japan), in which any exercise
439 | of the right granted in Section 3(b) of this License (the right to
440 | make Adaptations) would be deemed to be a distortion, mutilation,
441 | modification or other derogatory action prejudicial to the Original
442 | Author's honor and reputation, the Licensor will waive or not assert,
443 | as appropriate, this Section, to the fullest extent permitted by the
444 | applicable national law, to enable You to reasonably exercise Your
445 | right under Section 3(b) of this License (right to make Adaptations)
446 | but not otherwise.
447 |
448 | 5. Representations, Warranties and Disclaimer
449 |
450 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
451 | OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
452 | KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
453 | INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
454 | FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
455 | LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
456 | WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
457 | OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
458 |
459 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
460 | LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
461 | ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
462 | ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
463 | BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
464 |
465 | 7. Termination
466 |
467 | a. This License and the rights granted hereunder will terminate
468 | automatically upon any breach by You of the terms of this License.
469 | Individuals or entities who have received Adaptations or Collections
470 | from You under this License, however, will not have their licenses
471 | terminated provided such individuals or entities remain in full
472 | compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
473 | survive any termination of this License.
474 | b. Subject to the above terms and conditions, the license granted here is
475 | perpetual (for the duration of the applicable copyright in the Work).
476 | Notwithstanding the above, Licensor reserves the right to release the
477 | Work under different license terms or to stop distributing the Work at
478 | any time; provided, however that any such election will not serve to
479 | withdraw this License (or any other license that has been, or is
480 | required to be, granted under the terms of this License), and this
481 | License will continue in full force and effect unless terminated as
482 | stated above.
483 |
484 | 8. Miscellaneous
485 |
486 | a. Each time You Distribute or Publicly Perform the Work or a Collection,
487 | the Licensor offers to the recipient a license to the Work on the same
488 | terms and conditions as the license granted to You under this License.
489 | b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
490 | offers to the recipient a license to the original Work on the same
491 | terms and conditions as the license granted to You under this License.
492 | c. If any provision of this License is invalid or unenforceable under
493 | applicable law, it shall not affect the validity or enforceability of
494 | the remainder of the terms of this License, and without further action
495 | by the parties to this agreement, such provision shall be reformed to
496 | the minimum extent necessary to make such provision valid and
497 | enforceable.
498 | d. No term or provision of this License shall be deemed waived and no
499 | breach consented to unless such waiver or consent shall be in writing
500 | and signed by the party to be charged with such waiver or consent.
501 | e. This License constitutes the entire agreement between the parties with
502 | respect to the Work licensed here. There are no understandings,
503 | agreements or representations with respect to the Work not specified
504 | here. Licensor shall not be bound by any additional provisions that
505 | may appear in any communication from You. This License may not be
506 | modified without the mutual written agreement of the Licensor and You.
507 | f. The rights granted under, and the subject matter referenced, in this
508 | License were drafted utilizing the terminology of the Berne Convention
509 | for the Protection of Literary and Artistic Works (as amended on
510 | September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
511 | Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
512 | and the Universal Copyright Convention (as revised on July 24, 1971).
513 | These rights and subject matter take effect in the relevant
514 | jurisdiction in which the License terms are sought to be enforced
515 | according to the corresponding provisions of the implementation of
516 | those treaty provisions in the applicable national law. If the
517 | standard suite of rights granted under applicable copyright law
518 | includes additional rights not granted under this License, such
519 | additional rights are deemed to be included in the License; this
520 | License is not intended to restrict the license of any rights under
521 | applicable law.
522 |
523 |
524 | Creative Commons Notice
525 |
526 | Creative Commons is not a party to this License, and makes no warranty
527 | whatsoever in connection with the Work. Creative Commons will not be
528 | liable to You or any party on any legal theory for any damages
529 | whatsoever, including without limitation any general, special,
530 | incidental or consequential damages arising in connection to this
531 | license. Notwithstanding the foregoing two (2) sentences, if Creative
532 | Commons has expressly identified itself as the Licensor hereunder, it
533 | shall have all rights and obligations of Licensor.
534 |
535 | Except for the limited purpose of indicating to the public that the
536 | Work is licensed under the CCPL, Creative Commons does not authorize
537 | the use by either party of the trademark "Creative Commons" or any
538 | related trademark or logo of Creative Commons without the prior
539 | written consent of Creative Commons. Any permitted use will be in
540 | compliance with Creative Commons' then-current trademark usage
541 | guidelines, as may be published on its website or otherwise made
542 | available upon request from time to time. For the avoidance of doubt,
543 | this trademark restriction does not form part of this License.
544 |
545 | Creative Commons may be contacted at https://creativecommons.org/.
546 |
--------------------------------------------------------------------------------