Skip to content

Commit 3b7585e

Browse files
authored
Merge pull request #167 from data-douser/data-douser/markdownlint
Apply markdownlint fixes for project .md files
2 parents df92915 + f4d9332 commit 3b7585e

File tree

7 files changed

+119
-66
lines changed

7 files changed

+119
-66
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
## Contributing
1+
# Contributing
22

33
[fork]: https://github.com/advanced-security/codeql-sap-js/fork
4-
[pr]: https://github.com/advanced-security/codeql-sap-js/compare
54
[style]: https://github.com/github/codeql/blob/main/docs/ql-style-guide.md
65

76
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
@@ -10,24 +9,26 @@ Contributions to this project are [released](https://help.github.com/articles/gi
109

1110
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
1211

13-
## Submitting a pull request
12+
## Submitting a Pull Request
1413

15-
1. [Fork][fork] and clone the repository
16-
1. Configure and install the [CodeQL CLI](https://github.com/github/codeql-cli-binaries/releases) specified in the `qlt.conf.json` file
17-
1. Create a new branch: `git checkout -b my-branch-name`
18-
1. Make your changes
19-
1. Make sure the QL tests pass on your machine
20-
1. Ensure the files are appropriately formatted (QL files should be formatted with `codeql query format`)
21-
1. Push to your fork and [submit a draft pull request](https://github.com/advanced-security/codeql-sap-js/compare). Make sure to select **Create Draft Pull Request**.
22-
7. Address failed checks, if any.
23-
8. Mark the [pull request ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review).
24-
9. Pat your self on the back and wait for your pull request to be reviewed and merged.
14+
1. [Fork][fork] and clone the repository.
15+
1. Configure and install the [CodeQL CLI](https://github.com/github/codeql-cli-binaries/releases) specified in the `qlt.conf.json` file.
16+
1. Create a new branch: `git checkout -b my-branch-name`.
17+
1. Make your changes.
18+
1. Make sure the QL tests pass on your machine.
19+
1. Ensure the files are appropriately formatted (QL files should be formatted with `codeql query format`).
20+
1. Push to your fork and [submit a draft Pull Request](https://github.com/advanced-security/codeql-sap-js/compare). Make sure to select **Create Draft Pull Request**.
21+
1. Address failed checks, if any.
22+
1. Mark the [Pull Request ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review).
23+
1. Pat yourself on the back and wait for your Pull Request to be reviewed and merged.
2524

26-
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
25+
## Helping Your Pull Request Get Accepted
26+
27+
Here are a few things you can do that will increase the likelihood of your Pull Request being accepted:
2728

2829
- Follow the [CodeQL style guide][style].
2930
- Write good tests.
30-
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
31+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate Pull Requests.
3132
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
3233

3334
## Resources

README.md

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# CodeQL: SAP JavaScript frameworks
2+
3+
[cloud-cap-samples]: https://github.com/SAP-samples/cloud-cap-samples
4+
25
This repository contains [CodeQL](https://codeql.github.com/) models and queries for SAP JavaScript frameworks:
3-
- [CAP](javascript/frameworks/cap) (https://cap.cloud.sap/)
4-
- [UI5](javascript/frameworks/ui5) (https://sapui5.hana.ondemand.com/)
5-
- [XSJS](javascript/frameworks/xsjs) (https://www.npmjs.com/package/@sap/async-xsjs)
66

7-
### Published CodeQl packs
7+
- [CAP](javascript/frameworks/cap) [https://cap.cloud.sap](https://cap.cloud.sap/)
8+
- [UI5](javascript/frameworks/ui5) [https://sapui5.hana.ondemand.com](https://sapui5.hana.ondemand.com/)
9+
- [XSJS](./javascript/frameworks/xsjs/README.md) [https://www.npmjs.com/package/@sap/async-xsjs](https://www.npmjs.com/package/@sap/async-xsjs)
10+
11+
## Published CodeQl packs
12+
813
- [advanced-security/javascript-sap-cap-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-cap-queries)
914
- [advanced-security/javascript-sap-ui5-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-ui5-queries)
1015
- [advanced-security/javascript-sap-async-xsjs-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-async-xsjs-queries)
1116

12-
## Usage
17+
## Usage
1318

1419
### Analyzing a repository with [Code Scanning](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#using-query-packs)
20+
1521
Example workflow file:
22+
1623
```yaml
1724
jobs:
1825
analyze-javascript:
@@ -45,7 +52,9 @@ jobs:
4552
LGTM_INDEX_XML_MODE: all
4653
LGTM_INDEX_FILETYPES: ".json:JSON\n.cds:JSON"
4754
```
55+
4856
Example configuration file:
57+
4958
```yaml
5059
name: "My CodeQL config"
5160

@@ -60,15 +69,19 @@ packs:
6069
paths-ignore:
6170
- "**/node_modules"
6271
```
72+
6373
### Building and analyzing the CodeQL database with the CodeQL CLI
6474
6575
1. Include and index XML, JSON and CDS files by setting the necessary environment variables:
66-
```
76+
77+
```shell
6778
export LGTM_INDEX_XML_MODE='ALL'
6879
export LGTM_INDEX_FILETYPES=$'.json:JSON\n.cds:JSON'
6980
```
81+
7082
2. Compile all the CDS files using the SAP cds toolkit
71-
```
83+
84+
```shell
7285
npm install -g @sap/cds-dk
7386
for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
7487
do
@@ -78,27 +91,56 @@ for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
7891
--locations
7992
done
8093
```
94+
8195
3. Build the database [as usual](https://docs.github.com/en/code-security/codeql-cli/codeql-cli-manual/database-create)
82-
```
96+
97+
```shell
8398
codeql database create <DB_NAME> --language=javascript
8499
```
100+
85101
4. Analyze the database using one or more packs
86-
```
102+
103+
```shell
87104
codeql database analyze <DB_NAME> --format=sarif-latest --output=<OUTPUT_FILE> \
88105
--download advanced-security/javascript-sap-cap-queries \
89106
advanced-security/javascript-sap-ui5-queries \
90107
advanced-security/javascript-sap-xsjs-queries
91108
```
92109

93-
## License
110+
### Example `codeql database create` with CDS Extractor Invocation
111+
112+
The following example invocation of `codeql database create` includes the `--command` option to invoke the CDS extractor as an extension of the `javascript` extractor, which is used by `codeql` to create the database. The `pre-finalize.sh` script is a minimal wrapper around the `codeql database index-files` command, which we expect to run the `extractors/cds/tools/index-files.js` script to index the JSON files pre-generated by the CDS extractor.
113+
114+
The below example assumes that:
115+
116+
- The [`SAP-samples/cloud-cap-samples`][cloud-cap-samples] repository has been cloned to a sibling directory of the one containing the this repository.
117+
- The [`SAP-samples/cloud-cap-samples`][cloud-cap-samples] repository is intended as the source code root (i.e. target project) for the database.
118+
- The database directory (e.g., `~/codeql-home/databases/cloud-cap-samples-real`) is either absent or empty.
119+
120+
```shell
121+
_d="$(pwd)" && codeql database create \
122+
--command="${_d}/extractors/javascript/tools/pre-finalize.sh" \
123+
--language="javascript" \
124+
--search-path="${_d}/extractors/" \
125+
--source-root="${_d}/../cloud-cap-samples/" \
126+
-- ~/codeql-home/databases/cloud-cap-samples-real
127+
```
128+
129+
NOTES:
130+
131+
- The `--source-root` option must be adjusted to match the actual location of the target project (e.g., GitHub repository).
132+
- The database directory path (last argument) must be adjusted to match the desired location of the created database.
133+
- Running the above command multiple times with the same database directory will result in an error. The `--overwrite` command-line option can be used to avoid this error.
134+
- See `codeql database create -h -v` for verbose command help.
135+
136+
## License
94137

95138
This project is licensed under the terms of the MIT open source license. Please refer to [MIT](LICENSE.txt) for the full terms.
96139

97-
## Maintainers
140+
## Maintainers
98141

99-
See [CODEOWNERS](CODEOWNERS)
142+
See [CODEOWNERS](CODEOWNERS).
100143

101144
## Support
102145

103-
See [SUPPORT](SUPPORT.md)
104-
146+
See [SUPPORT](SUPPORT.md).

SECURITY.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Thanks for helping make GitHub safe for everyone.
2-
31
# Security
42

3+
Thanks for helping make GitHub safe for everyone.
4+
55
GitHub takes the security of our software products and services seriously, including all of the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub).
66

7-
Even though [open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope) and therefore not eligible for bounty rewards, we will ensure that your finding gets passed along to the appropriate maintainers for remediation.
7+
Even though [open source repositories are outside of the scope of our bug bounty program](https://bounty.github.com/index.html#scope) and therefore not eligible for bounty rewards, we will ensure that your finding gets passed along to the appropriate maintainers for remediation.
88

99
## Reporting Security Issues
1010

@@ -16,16 +16,16 @@ Instead, please send an email to opensource-security[@]github.com.
1616

1717
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
1818

19-
* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
20-
* Full paths of source file(s) related to the manifestation of the issue
21-
* The location of the affected source code (tag/branch/commit or direct URL)
22-
* Any special configuration required to reproduce the issue
23-
* Step-by-step instructions to reproduce the issue
24-
* Proof-of-concept or exploit code (if possible)
25-
* Impact of the issue, including how an attacker might exploit the issue
19+
* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
20+
* Full paths of source file(s) related to the manifestation of the issue
21+
* The location of the affected source code (tag/branch/commit or direct URL)
22+
* Any special configuration required to reproduce the issue
23+
* Step-by-step instructions to reproduce the issue
24+
* Proof-of-concept or exploit code (if possible)
25+
* Impact of the issue, including how an attacker might exploit the issue
2626

2727
This information will help us triage your report more quickly.
2828

2929
## Policy
3030

31-
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms)
31+
See [GitHub's Safe Harbor Policy](https://docs.github.com/en/site-policy/security-policies/github-bug-bounty-program-legal-safe-harbor#1-safe-harbor-terms).

SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Support
1+
# Support
22

33
## How to file issues and get help
44

javascript/frameworks/cap/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
CodeQL queries and supporting models for the SAP CAP JavaScript framework
44

5-
### Queries
5+
## Queries
6+
67
- [CQL Injection](src/cqlinjection)
78
- [Log Injection](src/loginjection)
89
- [Sensitive Data Exposure](src/sensitive-exposure)
910
- [Authentication Issues](src/bad-authn-authz)
1011

11-
### Modeled CAP framework elements
12-
- CQL (CAP Query Language) fluent API
13-
- CDS (Core Data Services) declarative service specification
14-
- Service composition API
15-
- Event handlers
12+
## Modeled CAP framework elements
13+
14+
- CQL (CAP Query Language) fluent API
15+
- CDS (Core Data Services) declarative service specification
16+
- Service composition API
17+
- Event handlers

javascript/frameworks/ui5/README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@
22

33
CodeQL queries and supporting models for the SAP UI5 JavaScript framework
44

5-
### Queries
5+
## Queries
6+
67
- [XSS](src/UI5Xss)
78
- [Log Injection](src/UI5LogInjection)
89
- [Clickjacking](src/UI5Clickjacking)
9-
10-
### Modeled UI5 framework elements
11-
- UI5 AMD-style components (also via jQuery)
12-
- MVC elements:
13-
- UI5 Controllers and Data Models (literal/external JSON models)
14-
- UI5 [declarative Views](DeclarativeApp.png) (XML/JSON/HTML/JS)
15-
- Library/custom UI5 Controls
16-
- Project naming conventions (e.g. Control-Renderer)
17-
- Source/Sink definition via [ModelAsData extensions](ext/ui5.model.yml#L61-L97)
18-
- Controls inheritance via [ModelAsData extensions](ext/ui5.model.yml#L42-L59)
19-
20-
### Supported Features with tests
10+
11+
## Modeled UI5 framework elements
12+
13+
- UI5 AMD-style components (also via jQuery)
14+
- MVC elements:
15+
- UI5 Controllers and Data Models (literal/external JSON models)
16+
- UI5 [declarative Views](DeclarativeApp.png) (XML/JSON/HTML/JS)
17+
- Library/custom UI5 Controls
18+
- Project naming conventions (e.g. Control-Renderer)
19+
- Source/Sink definition via [ModelAsData extensions](ext/ui5.model.yml#L61-L97)
20+
- Controls inheritance via [ModelAsData extensions](ext/ui5.model.yml#L42-L59)
21+
22+
## Supported Features with tests
23+
2124
The following tables list the main supported features with corresponding test cases
22-
#### Detecting XSS and Log injection vulnerabilities
25+
26+
### Detecting XSS and Log injection vulnerabilities
27+
2328
|test | library controls | [MaD sources sinks](ext/ui5.model.yml#L61-L97) | custom controls | UI5View | JS dataflow | HTML APIs | sanitizer | acc.path via handler |
2429
| - | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
2530
| [xss-html-control](https://github.com/advanced-security/codeql-sap-js/security/code-scanning/1033) | ✅︎ | ✅︎ | | XMLView |
@@ -30,7 +35,8 @@ The following tables list the main supported features with corresponding test ca
3035
| [sanitized](https://github.com/advanced-security/codeql-sap-js/security/code-scanning/277)| ✅︎ | ✅︎ | ✅︎ | XMLView | ✅︎ | DOM | ✅︎ |
3136
| [xss-event-handlers](https://github.com/advanced-security/codeql-sap-js/security/code-scanning/335)| ✅︎ | ✅︎ | ✅︎ | XMLView | | | | ✅︎ |
3237

33-
#### Detecting Clickjacking vulnerabilities
38+
### Detecting Clickjacking vulnerabilities
39+
3440
| test | secure | insecure frameOptions | missing frameOptions |
3541
| - | :-: | :-: | :-: |
3642
| [clickjacking-deny-all](test/queries/UI5Clickjacking/clickjacking-deny-all/index.html#L10) | ✅︎ | |

javascript/frameworks/xsjs/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
CodeQL queries and supporting models for the SAP XSJS JavaScript framework
44

5-
### Queries
5+
## Queries
6+
67
- [XSS](src/XSJSReflectedXss)
78
- [SQL Injection](src/XSJSSqlInjection)
89
- [URL Redirection](src/XSJSUrlRedirect)
910
- [ZipSlip](src/XSJSZipSlip)
1011
- [Authentication Issues](src/XSJSAuthentication)
1112
- [Disabled CSRF Protection](src/XSJSCsrfDisabled)
1213

13-
### Modeled XSJS framework elements (From CodeQL v2.18.4)
14-
- XSJS NPM components
15-
- XSJSLib modules
14+
## Modeled XSJS framework elements (From CodeQL v2.18.4)
15+
16+
- XSJS NPM components
17+
- XSJSLib modules

0 commit comments

Comments
 (0)