Note
Here we will use
Assessor Appfor 'CIS-CAT Pro Assessor' Application andCCPD Appfor 'CIS-CAT Pro Dashboard' Application
- Clone the repo
git clone https://github.com/cloud-simple/docker-ciscat.git
- Change to the
smbdirectory within the cloned repo directorycd docker-ciscat/smb
- Create
.envfile defining the following variables (the provided values are used as examples, please change them accordingly)
SAMBA_SHARE_NAME=CIS
SAMBA_SERVER_NAME=samba.example.org
CCPD_URL=http://ciscat.example.org/CCPD
CCPD_TOKEN=11112222333344445555666677778888
- The meanings of the above variables are the following
SAMBA_SERVER_NAME- the name of the SMB server serving Assessor App in 'Centralized Workflow' modeSAMBA_SHARE_NAME- the name of the SMB share on the above SMB server for Assessor App contentCCPD_URL- the URL for the CCPD App API to which Assessor App reports are POST'edCCPD_TOKEN- the 'Authentication Token' generated for anAPIuser in CCPD App- Currently this token have to be created via CCPD App Web Interface and used here
- Create the directory
/srv/docker/smb/downloadswith the following directory structure within it and add there the corresponding content./assessor/place here the distributionzipfile with Assessor App, like:./assessor/CIS-CAT-Assessor-v4.23.0.zip./license/place herezipfile with License Key, like:./license/NewMember-LicenseKey-ClientConfigurationBundle.zip./jre/place here the distributionzipfile with Java Runtime Env bundle for Windows x86-32 Architecture, like:./jre/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.17_8.zip./jre64/place here the distributionzipfile with Java Runtime Env bundle for Windows x64 Architecture, like:./jre64/OpenJDK11U-jre_x64_windows_hotspot_11.0.17_8.zip
- The following is an exemplary content of possible directory structure - more details on how the container processes the directory structure are available in the section 'Deployment details - smb' below
$ tree /srv/docker/smb/downloads
/srv/docker/smb/downloads
├── assessor
│ └── CIS-CAT-Assessor-v4.23.0.zip
├── jre
│ └── OpenJDK11U-jre_x86-32_windows_hotspot_11.0.17_8.zip
├── jre64
│ └── OpenJDK11U-jre_x64_windows_hotspot_11.0.17_8.zip
└── license
└── NewMember-LicenseKey-ClientConfigurationBundle.zip
- Run the following command
docker compose up -d
- See the applications log with the following command
docker compose logs
- Now end users should be able to run assessment from the Shared Folder using the appropriate batch file, like
\\samba.example.org\CIS\cis-cat-centralized-ccpd.bat
- Clone the repo - this is the same repo which is used for 'Samba server and Shared Folder to serve Assessor App content' above
git clone https://github.com/cloud-simple/docker-ciscat.git
- Change to the
ccpddirectory within the cloned repo directorycd docker-ciscat/ccpd
- Create
.envfile defining the following variables (the provided values are used as examples, please change them accordingly)
MYSQL_USER=my-ccpd-user
MYSQL_PASSWORD=my-ccpd-pass
MYSQL_DATABASE=ccpd
MYSQL_ROOT_PASSWORD=my-root-pass
CCPD_URL=http://ciscat.example.org/CCPD
CCPD_TOKEN=11112222333344445555666677778888
SMTP_HOST=smtp.example.org
SMTP_PORT=25
SMTP_USER=smtp-ccpd-user
SMTP_PASS=smtp-ccpd-pass
DEFAULT_SENDER_EMAIL_ADDRESS=noreply@smtp.example.org
- The meanings of the above variables are the following
MYSQL_USER- CCPD DB container MySQL user name, also used by CCPD App container to connect to the mentioned DBMYSQL_PASSWORD- CCPD DB container MySQL password, also used by CCPD App container to connect to the mentioned DBMYSQL_DATABASE- CCPD DB container MySQL DB name, also used by CCPD App container to connect to the mentioned DBMYSQL_ROOT_PASSWORD- CCPD DB container MySQL server root user passwordCCPD_URL- Server URL the CCPD App to be configured to listen toCCPD_TOKEN- ❗ this is not used for CCPD App container deployment now ❗- Assessor App uses this CCPD token to authenticate to CCPD App when it posts assessment reports to CCPD App
- Currently this token is created via CCPD App Web Interface and passed to
smbcontainer for Assessor App during deployment as a variable- TODO: try to initialize CCPD token in CCPD DB via
entrypoint.shscript
- TODO: try to initialize CCPD token in CCPD DB via
SMTP_HOST- SMTP HOST parameter of CCPD AppSMTP_PORT- SMTP PORT parameter of CCPD AppSMTP_USER- SMTP USER parameter of CCPD AppSMTP_PASS- SMTP PASS parameter of CCPD AppDEFAULT_SENDER_EMAIL_ADDRESS- default address for 'forgot password' email messages
- Create the directory
certs(withinccpddirectory) and place the following files within it to be able to use TLSccpd/certs/chain.pem- the server's certificate, if it is signed by a CA, this certificate file should be a bundle: a concatenation of the server's certificate followed by the CA'sccpd/certs/key.pem- the server's private key file which matches the certificate file
- Create the directory
/srv/docker/ccpd/downloadswith the following directory structure within it and add there corresponding content./dashboard/place here the distributionzipfile with CCPD App, like:./dashboard/CIS-CAT-Pro-Dashboard-v2.3.2-unix.zip
- The following is an exemplary content of possible directory structure - more details on how the container processes the directory structure are available in the section 'Deployment details - ccpd' below
$ tree /srv/docker/ccpd/downloads
/srv/docker/ccpd/downloads
└── dashboard
└── CIS-CAT-Pro-Dashboard-v2.3.2-unix.zip
- Create the directory
/srv/docker/my4ccpdwhich will be used as a persistent storage for CCPD App data managed by MySQL DB container - this will be bound to MySQL container'sMySQL Data Directorydirectory - more details onmy4ccpdcontainer are available in the section 'Deployment details - my4ccpd' below - Run the following command
docker compose up -d
- See the applications log with the following command
docker compose logs
- Now you should be able to access CCPD App Web Interface via the provided
CCPD_URL
- The container runs
samba (smbd)service which serves Assessor App content in 'Centralized Workflow' mode - According to
docker-compose.yamlfile the container is started with the host path/srv/docker/smbmounted as the container volume with path/data - To serve Assessor App the container ENTRYPOINT script (
entrypoint.sh) creates (and fills with approprate content) the directory structure for SMB foder used as Assessor App Shared Folder (available within container file system at/data/shares/${SAMBA_SHARE_NAME}path) and make all necessary changes forsmbdconfiguration - All the required content of Assessor App Shared Folder direcory structure (below the
/data/shares/${SAMBA_SHARE_NAME}directory) is based on the structure and content of 'downloads' directory (available within container file system at/data/downloadspath, and provided via the mentioned above container volume) and formed in the following way- If a component of Assessor App Shared Folder direcory structure exists (available via the mentioned above container volume on
/data/shares/${SAMBA_SHARE_NAME}path) the component content is not recreated and is left as is - If a component of Assessor App Shared Folder direcory structure doesn't exist, the component content is created from the corresponding
.zipfile provided via the mentioned above container volume on/data/downloadspath - The ENTRYPOINT script expects the following direcory structure present within container file system at
/data/downloadspath with the corresponding distribution.zipfiles, where one directory contains only one.zipfile./assessor/*.zip- distribution for Assessor App./license/*.zip- file with License Key./jre/*.zip- distribution for Java Runtime Env for Windows x86-32 Architecture./jre64/*.zip- distribution for Java Runtime Env for Windows x64 Architecture
- If a component of Assessor App Shared Folder direcory structure exists (available via the mentioned above container volume on
- The corresponding directory
/srv/docker/smb/downloadshas to be prepared on host OS and mounted to thesmbcontainer as part of its/datavolume- It can be done the way provided in
docker-compose.yamlfile or using correspondingdockercommand with-vflag, like:-v "/srv/docker/smb:/data"
- It can be done the way provided in
- The container is
tomcatservice which runs Java application with CCPD App - According to
docker-compose.yamlfile the container is started with the host path/srv/docker/ccpdmounted as the container volume with path/data - To run Java application with help of
tomcatthe container ENTRYPOINT script (entrypoint.sh) does the following- Copies the application
.warfile into corresponding location according totomcatconfiguration (${CATALINA_HOME}/webapps/) - Make all necessary changes to
tomcatconfiguration files
- Copies the application
- The application
.warfile is extracted from CCPD App.zipdistribution file provided to the container from the 'downloads' directory available within container file system at/data/downloadspath (provided there via the mentioned above container volume) - If the application
.warfile exists in the corresponding location (${CATALINA_HOME}/webapps/CCPD.war) it is not recreated and is left as is - If the application
.warfile doesn't exist, it is created from the provided.zipfile - The ENTRYPOINT script expects the distribution file for CCPD App present as
/data/downloads/dashboard/*.zip - The corresponding directory
/srv/docker/ccpd/downloadshas to be prepared on host OS and mounted to theccpdcontainer as part of its/datavolume- It can be done the way provided in
docker-compose.yamlfile or using correspondingdockercommand with-vflag, like: `-v "/srv/docker/ccpd:/data"
- It can be done the way provided in
- The container is
mysqlDB service which stores data for CCPD App - According to
docker-compose.yamlfile the container is started with the host path/srv/docker/my4ccpdmounted as the container volume with path/var/lib/mysql- This volume is used as
MySQL Data Directorywhere information managed by the MySQL server is stored - If
mysqlcontainer instance starts with emptyData Directoryall the necessary data in theData Directorywill be created and initialized - If
mysqlcontainer instance starts with aData Directorythat already contains a database, the pre-existing database will not be changed in any way - Binding a directory on the host into a container in the described way provides the persistent storage for the application data managed by MySQL
- This volume is used as
- The corresponding directory
/srv/docker/my4ccpdhas to be prepared on host OS and mounted to themy4ccpdcontainer as/var/lib/mysqlvolume- It can be done the way provided in
docker-compose.yamlfile or using correspondingdockercommand with-vflag, like:-v "/srv/docker/my4ccpd:/var/lib/mysql"
- It can be done the way provided in
To run Assessor App tool on Windows OS, an end user can create a batch file with specified below commands and run it as Administrator. In the following steps a file with name ciscat.bat is created as an example on Windows Desktop of Windows 10 Pro OS
- Right Click on Windows Desktop -> Click
New-> ClickText Document - Provide
ciscat.batas the name for the file -> PressEnter-> ClickYesin theRenameconfirmation window - Right Click on the created file -> Click
Edit - Copy the following commands and Paste them to the file as the content
net use /delete s:
net use s: \\samba.example.org\CIS /user:ciscat ciscat
\\samba.example.org\CIS\cis-cat-centralized-ccpd.bat
net use /delete s: