Running in a Docker Container
RegScale CLI with Docker
Pull latest image
docker pull regscale/regscale-cli:latest
- The commands above may be run in a docker container by simply using the example script at the bottom of the page and executed like so:
-
$ ./docker_run.sh 'regscale about'
- The users data will persist in the current working directory and the script will create a blank init.yaml file if one is not available.
-
Example Docker Run Script:
#!/usr/bin/env bash
set -eu
# Enter commands as a bash parameter
# ./docker_run.sh 'regscale wiz issues'
# The RegScale CLI tool will take environment variables over the init.yaml file if they are available.
FILE='init.yaml'
touch -a $FILE
[ -s $FILE ] || cat << EOF > init.yaml
adAccessToken: Bearer <my token>
adAuthUrl: https://login.microsoftonline.com/
adClientId: <myclientidgoeshere>
adGraphUrl: myUrl
adSecret: <mysecretgoeshere>
adTenantId: <mytenantidgoeshere>
domain: https://mycompany.regscale.com/
jiraApiToken: <jiraAPIToken>
jiraUrl: myjiraUrl
jiraUserName: VALUE
oscalLocation: /opt/OSCAL
saxonPath: /opt/saxon-he-11.4.jar
snowPassword: VALUE
snowUrl: myUrl
snowUserName: VALUE
token: empty
userId: d61f9c73-8744-4277-8e45-5df462f32834
wizAccessToken: <createdProgrammatically>
wizAuthUrl: VALUE
wizClientId: VALUE
wizClientSecret: VALUE
wizExcludes: VALUE
wizScope: VALUE
wizUrl: https://auth.wiz.io/oauth/token
EOF
if [ -s $FILE ]; then
docker run --user regscale -v ${2:-$(pwd):/data} -w /data --rm -t -i --name='regscale-cli' \
-e domain='https://mycompany.regscale.com/' \
-e wizClientId='VALUE' \
-e wizClientSecret='VALUE' \
-e wizScope='VALUE' \
-e wizUrl='https://auth.wiz.io/oauth/token' \
-e wizAuthUrl='VALUE' \
-e wizExcludes='VALUE' \
-e adGraphUrl='myUrl' \
-e jiraUrl='myjiraUrl' \
-e jiraUserName='VALUE' \
-e snowUrl='myUrl' \
-e snowUserName='VALUE' \
-e snowPassword='VALUE' \
-e LOGLEVEL='INFO' \
-v $(pwd)/init.yaml:/init.yaml \
regscale/regscale-cli:latest ${1:-regscale about}
fi
Updated 11 months ago