-
Notifications
You must be signed in to change notification settings - Fork 2
Update README.md #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update README.md #151
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f4438aa
Update README.md
mbaluda f99f58c
Update README.md
mbaluda c5c6804
Update README.md
mbaluda 365fe36
Update README.md
mbaluda 458585d
391366
mbaluda 79e006c
Update README.md
mbaluda f4c2ea6
Update README.md
mbaluda e7a7fff
Update README.md
mbaluda 293c48e
Update README.md
mbaluda b462794
Update README.md
mbaluda c64ecb6
Update README.md
mbaluda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,92 @@ | ||
# Overview | ||
[CodeQL](https://codeql.github.com/) models and queries for the SAP frameworks: | ||
# CodeQL: SAP JavaScript frameworks | ||
This repository contains [CodeQL](https://codeql.github.com/) models and queries for SAP JavaScript frameworks: | ||
- [CAP](javascript/frameworks/cap) (https://cap.cloud.sap/) | ||
- [UI5](javascript/frameworks/ui5) (https://sapui5.hana.ondemand.com/) | ||
- [XSJS](javascript/frameworks/xsjs) (https://www.npmjs.com/package/@sap/async-xsjs) | ||
- [XSJS](javascript/frameworks/xsjs) (https://www.npmjs.com/package/@sap/async-xsjs) | ||
|
||
### Published CodeQl packs | ||
- [advanced-security/javascript-sap-cap-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-cap-queries) | ||
- [advanced-security/javascript-sap-ui5-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-ui5-queries) | ||
- [advanced-security/javascript-sap-async-xsjs-queries](https://github.com/advanced-security/codeql-sap-js/pkgs/container/javascript-sap-async-xsjs-queries) | ||
|
||
## Usage | ||
|
||
### 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) | ||
Example workflow file: | ||
```yaml | ||
jobs: | ||
analyze-javascript: | ||
name: Analyze | ||
runs-on: 'ubuntu-latest' | ||
permissions: | ||
security-events: write | ||
|
||
- name: Compile CDS files | ||
run: | | ||
npm install -g @sap/cds-dk | ||
for cds_file in $(find . -type f \( -iname '*.cds' \) -print) | ||
do | ||
cds compile $cds_file \ | ||
-2 json \ | ||
-o "$cds_file.json" \ | ||
--locations | ||
done | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: javascript | ||
config-file: .github/codeql/codeql-config.yaml | ||
|
||
- name: Perform CodeQL Analysis | ||
id: analyze | ||
uses: github/codeql-action/analyze@v3 | ||
``` | ||
Example configuration file: | ||
```yaml | ||
name: "My CodeQL config" | ||
|
||
packs: | ||
# Use these packs for JavaScript and TypeScript analysis | ||
javascript: | ||
- codeql/javascript-queries:codeql-suites/javascript-security-extended.qls | ||
- advanced-security/javascript-sap-async-xsjs-queries:codeql-suites/javascript-security-extended.qls | ||
- advanced-security/javascript-sap-cap-queries:codeql-suites/javascript-security-extended.qls | ||
- advanced-security/javascript-sap-ui5-queries:codeql-suites/javascript-security-extended.qls | ||
|
||
paths-ignore: | ||
- "**/node_modules" | ||
``` | ||
### Building and analyzing the CodeQL database with the CodeQL CLI | ||
|
||
1. Include and index XML, JSON and CDS files by setting the necessary environment variables: | ||
``` | ||
export LGTM_INDEX_XML_MODE='ALL' | ||
export LGTM_INDEX_FILETYPES=$'.json:JSON\n.cds:JSON' | ||
``` | ||
2. Compile all the CDS files using the SAP cds toolkit | ||
``` | ||
npm install -g @sap/cds-dk | ||
for cds_file in $(find . -type f \( -iname '*.cds' \) -print) | ||
do | ||
cds compile $cds_file \ | ||
-2 json \ | ||
-o "$cds_file.json" \ | ||
--locations | ||
done | ||
``` | ||
3. Build the database [as usual](https://docs.github.com/en/code-security/codeql-cli/codeql-cli-manual/database-create) | ||
``` | ||
codeql database create <DB_NAME> --language=javascript | ||
``` | ||
4. Analyze the database using one or more packs | ||
``` | ||
codeql database analyze <DB_NAME> --format=sarif-latest --output=<OUTPUT_FILE> \ | ||
--download advanced-security/javascript-sap-cap-queries \ | ||
advanced-security/javascript-sap-ui5-queries \ | ||
advanced-security/javascript-sap-async-xsjs-queries | ||
``` | ||
|
||
## License | ||
|
||
The code in this repository is licensed under the [MIT License](LICENSE) by [GitHub](https://github.com). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.