Skip to content

Instantly share code, notes, and snippets.

@crashGoBoom
Last active October 27, 2023 05:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save crashGoBoom/04e30ba343948a5c84e8079cf4c64dd2 to your computer and use it in GitHub Desktop.
Save crashGoBoom/04e30ba343948a5c84e8079cf4c64dd2 to your computer and use it in GitHub Desktop.
Install codeql for MacOS (BigSur)
#!/bin/bash
# Check for latest release: https://github.com/github/codeql-cli-binaries/releases
_version='v2.4.1'
_arch='osx'
_zip_url="https://github.com/github/codeql-cli-binaries/releases/download/${_version}/codeql-${_arch}64.zip"
_dir='codeql-home'
_cores=2
pushd "${HOME}" || exit
# Download and extract into
curl -o "${_dir}.zip" "${_zip_url}" -L
# Unzips to codeql/
unzip "${_dir}.zip"
# Change the name
mv codeql/ "${_dir}/"
pushd "${_dir}/" || exit
# Grab the repo for the examples and query suites. You'll need these!
git clone https://github.com/github/codeql.git codeql-repo
ln -s "${HOME}/${_dir}/codeql" /usr/local/bin/codeql
echo "YAY! codeql is now installed!"
codeql --help
echo "Now run the following to create a db:"
echo "cd yourrepo/; codeql database create yourrepo-db --language=javascript"
echo "Now you can analyze!"
echo "codeql database analyze /yourrepo/yourrepo-db $HOME/codeql-home/codeql-repo/javascript/ql/src/codeql-suites/javascript-security-and-quality.qls --format=csv --output=sec-quality.csv -j $_cores"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment