Skip to content

Commit b9b1568

Browse files
committed
Apply markdownlint fixes for project .md files
Fixes most markdownlint-related errors and warnings for *.md files in this project. Improves consistency of markdown documentation, including these files: - `CONTRIBUTING.md` - `README.md` - `SECURITY.md` - `SUPPORT.md` - `javascript/frameworks/*/README.md`
1 parent fe6937a commit b9b1568

File tree

7 files changed

+103
-66
lines changed

7 files changed

+103
-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: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# CodeQL: SAP JavaScript frameworks
2+
23
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)
64

7-
### Published CodeQl packs
5+
- [CAP](javascript/frameworks/cap) [https://cap.cloud.sap](https://cap.cloud.sap/)
6+
- [UI5](javascript/frameworks/ui5) [https://sapui5.hana.ondemand.com](https://sapui5.hana.ondemand.com/)
7+
- [XSJS](./javascript/frameworks/xsjs/README.md) [https://www.npmjs.com/package/@sap/async-xsjs](https://www.npmjs.com/package/@sap/async-xsjs)
8+
9+
## Published CodeQl packs
10+
811
- [advanced-security/javascript-sap-cap-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-cap-queries)
912
- [advanced-security/javascript-sap-ui5-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-ui5-queries)
1013
- [advanced-security/javascript-sap-async-xsjs-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-async-xsjs-queries)
1114

12-
## Usage
15+
## Usage
1316

1417
### 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)
18+
1519
Example workflow file:
20+
1621
```yaml
1722
jobs:
1823
analyze-javascript:
@@ -45,7 +50,9 @@ jobs:
4550
LGTM_INDEX_XML_MODE: all
4651
LGTM_INDEX_FILETYPES: ".json:JSON\n.cds:JSON"
4752
```
53+
4854
Example configuration file:
55+
4956
```yaml
5057
name: "My CodeQL config"
5158

@@ -60,15 +67,19 @@ packs:
6067
paths-ignore:
6168
- "**/node_modules"
6269
```
70+
6371
### Building and analyzing the CodeQL database with the CodeQL CLI
6472
6573
1. Include and index XML, JSON and CDS files by setting the necessary environment variables:
66-
```
74+
75+
```shell
6776
export LGTM_INDEX_XML_MODE='ALL'
6877
export LGTM_INDEX_FILETYPES=$'.json:JSON\n.cds:JSON'
6978
```
79+
7080
2. Compile all the CDS files using the SAP cds toolkit
71-
```
81+
82+
```shell
7283
npm install -g @sap/cds-dk
7384
for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
7485
do
@@ -78,27 +89,42 @@ for cds_file in $(find . -type f \( -iname '*.cds' \) -print)
7889
--locations
7990
done
8091
```
92+
8193
3. Build the database [as usual](https://docs.github.com/en/code-security/codeql-cli/codeql-cli-manual/database-create)
82-
```
94+
95+
```shell
8396
codeql database create <DB_NAME> --language=javascript
8497
```
98+
8599
4. Analyze the database using one or more packs
86-
```
100+
101+
```shell
87102
codeql database analyze <DB_NAME> --format=sarif-latest --output=<OUTPUT_FILE> \
88103
--download advanced-security/javascript-sap-cap-queries \
89104
advanced-security/javascript-sap-ui5-queries \
90105
advanced-security/javascript-sap-xsjs-queries
91106
```
92107

93-
## License
108+
### Example `codeql database create` with CDS Extractor Invocation
109+
110+
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.
111+
112+
```shell
113+
codeql database create \
114+
--search-path ./extractors/ \
115+
--language javascript \
116+
--command "./extractors/javascript/tools/pre-finalize.sh" \
117+
~/codeql-home/databases/cloud-cap-samples-real
118+
```
119+
120+
## License
94121

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

97-
## Maintainers
124+
## Maintainers
98125

99-
See [CODEOWNERS](CODEOWNERS)
126+
See [CODEOWNERS](CODEOWNERS).
100127

101128
## Support
102129

103-
See [SUPPORT](SUPPORT.md)
104-
130+
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)