-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into andre/enable-case-insensitive-php-tests
- Loading branch information
Showing
16 changed files
with
921 additions
and
424 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Use an official Ubuntu 20.04 as base image | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# ok: no-sudo-in-dockerfile | ||
RUN apt-get update && apt-get upgrade -y | ||
|
||
# ok: no-sudo-in-dockerfile | ||
RUN apt-get install -y sudo | ||
|
||
RUN useradd -ms /bin/bash newuser | ||
|
||
RUN echo "newuser ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
USER newuser | ||
|
||
# ruleid: no-sudo-in-dockerfile | ||
RUN sudo apt-get install -y curl | ||
|
||
CMD ["echo", "Hello, Docker!"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
rules: | ||
- id: no-sudo-in-dockerfile | ||
patterns: | ||
- pattern: | | ||
RUN sudo ... | ||
message: >- | ||
Avoid using sudo in Dockerfiles. Running processes as a non-root user can help | ||
reduce the potential impact of configuration errors and security vulnerabilities. | ||
metadata: | ||
category: security | ||
technology: | ||
- dockerfile | ||
cwe: | ||
- 'CWE-250: Execution with Unnecessary Privileges' | ||
owasp: | ||
- A05:2021 - Security Misconfiguration | ||
references: | ||
- https://cwe.mitre.org/data/definitions/250.html | ||
- https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user | ||
subcategory: | ||
- audit | ||
likelihood: LOW | ||
impact: LOW | ||
confidence: HIGH | ||
languages: | ||
- dockerfile | ||
severity: WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
let username = getUsername() | ||
let passphrase = getPass() | ||
|
||
|
||
// okid: swift-user-defaults | ||
UserDefaults.standard.set(username, forKey: "userName") | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(passphrase, forKey: "passphrase") | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(passWord, forKey: "userPassword") | ||
|
||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set("12717-127163-a71367-127ahc", forKey: "apiKey") | ||
|
||
let apiKey = "12717-127163-a71367-127ahc" | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(apiKey, forKey: "GOOGLE_TOKEN") | ||
|
||
|
||
let key = "1sdad3SADSD33131" | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(key, forKey: "cryptoKey") | ||
|
||
|
||
let key = "foobar" | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(key, forKey: "clientSecret") | ||
|
||
|
||
let key = "foobar" | ||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(key, forKey: "rsaPrivateKey") | ||
|
||
// ruleid: swift-user-defaults | ||
UserDefaults.standard.set(passphrase, forKey: "pass_phrase") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
rules: | ||
- id: swift-user-defaults | ||
message: >- | ||
Potentially sensitive data was observed to be stored in UserDefaults, which is not adequate protection | ||
of sensitive information. For data of a sensitive nature, applications should leverage the Keychain. | ||
severity: WARNING | ||
metadata: | ||
likelihood: LOW | ||
impact: HIGH | ||
confidence: MEDIUM | ||
category: security | ||
cwe: | ||
- 'CWE-311: Missing Encryption of Sensitive Data' | ||
masvs: | ||
- 'MASVS-STORAGE-1: The app securely stores sensitive data' | ||
owasp: | ||
- A03:2017 - Sensitive Data Exposure | ||
- A04:2021 - Insecure Design | ||
references: | ||
- https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/ValidatingInput.html | ||
- https://mas.owasp.org/MASVS/controls/MASVS-STORAGE-1/ | ||
subcategory: | ||
- vuln | ||
technology: | ||
- ios | ||
- macos | ||
languages: | ||
- swift | ||
options: | ||
taint_propagation: true | ||
patterns: | ||
- pattern-either: | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $VALUE | ||
regex: (?i).*(passcode|password|pass_word|passphrase|pass_code|pass_word|pass_phrase)$ | ||
- focus-metavariable: $VALUE | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $KEY | ||
regex: (?i).*(passcode|password|pass_word|passphrase|pass_code|pass_word|pass_phrase)$ | ||
- focus-metavariable: $KEY | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $VALUE | ||
regex: (?i).*(api_key|apikey)$ | ||
- focus-metavariable: $VALUE | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $KEY | ||
regex: (?i).*(api_key|apikey)$ | ||
- focus-metavariable: $KEY | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $VALUE | ||
regex: (?i).*(secretkey|secret_key|secrettoken|secret_token|clientsecret|client_secret)$ | ||
- focus-metavariable: $VALUE | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $KEY | ||
regex: (?i).*(secretkey|secret_key|secrettoken|secret_token|clientsecret|client_secret)$ | ||
- focus-metavariable: $KEY | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $VALUE | ||
regex: (?i).*(cryptkey|cryptokey|crypto_key|cryptionkey|symmetrickey|privatekey|symmetric_key|private_key)$ | ||
- focus-metavariable: $VALUE | ||
- patterns: | ||
- pattern-either: | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set("$VALUE", forKey: $KEY) | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: "$KEY") | ||
- pattern: | | ||
UserDefaults.standard.set($VALUE, forKey: $KEY) | ||
- metavariable-regex: | ||
metavariable: $KEY | ||
regex: (?i).*(cryptkey|cryptokey|crypto_key|cryptionkey|symmetrickey|privatekey|symmetric_key|private_key)$ | ||
- focus-metavariable: $KEY |
Oops, something went wrong.