Skip to content

Commit f749225

Browse files
authored
4.4.0 (StrongKey#89)
* updating to 4.4.0 * updating to 4.4.0 * updating to 4.4.0 * adding docker file for 4.4 JWT generation will only work on standalone instances as default keystore is being copied over * updating to 4.4.0 * updating to 4.4.0 * updating to 4.4.0 * updating SACL document Co-authored-by: Pushkar Marathe <[email protected]>
1 parent a16d786 commit f749225

File tree

1,090 files changed

+452722
-7772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,090 files changed

+452722
-7772
lines changed

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ server/fidoserverbeans/target/
2323
server/keymanager/target/
2424
sampleapps/java/basic/server/target/
2525
sampleapps/java/poc/server/target/
26+
sampleapps/java/sacl/sfaboaserver/target/
27+
sampleapps/java/sacl/sfaeco/target/
28+
sampleapps/java/poc/angular/tools/node_modules/
29+
sampleapps/java/poc/angular/dist/demo6/dist/
30+
sampleapps/java/poc/angular/dist/demo6/node_modules/
31+
sampleapps/java/sacl/sfaboa/angular/demo6/node_modules/
32+
sampleapps/java/sacl/sfakma/angular/demo6/node_modules/
33+
sampleapps/java/sacl/sfaboa/angular/demo6/dist/
34+
sampleapps/java/sacl/sfakma/angular/demo6/dist/
35+
sampleapps/java/poc/angular/dist/assets/
36+
sampleapps/java/poc/angular/dist/vendors/
2637
server/skfe/nbproject/
2738
server/skfs/nbproject/
2839
server/skfe/target/
@@ -31,3 +42,12 @@ server/apiclient/target/
3142
server/FIDO2Simulator/target/
3243
server/FIDO2SimulatorClient/target/
3344
server/skfsclient/target/
45+
server/FIDO2JWTVerify/target/
46+
/sampleapps/java/poc/angular/dist/demo6/nbproject/private/
47+
/sampleapps/java/sacl/sfaboaserver/target/
48+
/sampleapps/java/sacl/sfaeco/sfaeco-web/target/
49+
/sampleapps/java/sacl/sfaeco/sfaeco-client/target/
50+
/sampleapps/java/sacl/sfaeco/sfaeco-ear/target/
51+
/sampleapps/java/sacl/sfaeco/sfaeco-ejb/target/
52+
/sampleapps/java/sacl/sfakma/sfakmaserver/target/
53+
/sampleapps/java/sacl/sfaboa/sfaboaserver/target/

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,21 @@ The following links provide some background on FIDO, the FIDO Alliance, and FIDO
1717
* Follow [the clustering instructions](docs/Clustering_Guide_Linux.md) to download the FIDO2 Server and get it running as a cluster.
1818

1919
## Upgrade
20-
Follow [the upgrade instructions](docs/Upgrade_Guide_Linux.md) to upgrade your current FIDO Server version to the latest.
20+
Follow [the upgrade instructions](docs/Upgrade_Guide_Linux.md) to upgrade your current version of fido server to the latest.
2121

2222
## Sample Applications
2323
Sample code is provided with a brief explanation of what each sample does:
2424

2525
* Java Samples
26-
* [Demo](https://demo4.strongkey.com/fido2poc): A basic Java application demonstrating FIDO2 registration and authentication
26+
* [DEMO](https://demo5.strongkey.com): A basic Java application demonstrating FIDO2 registration and authentication
2727
* [Basic](https://github.com/StrongKey/fido2/tree/master/sampleapps/java/basic/): Basic Java sample application
2828
* [PoC](https://github.com/StrongKey/fido2/tree/master/sampleapps/java/poc/): Proof of concept (PoC) Java application
29-
30-
## Tutorial
31-
A step-by-step guide to FIDO-enable your application is provided:
32-
* [Node.js](https://github.com/StrongKey/fido2/tree/master/tutorial/node/): Node.js and SQLite tutorial
29+
* [SSO](https://github.com/StrongKey/fido2/tree/master/sampleapps/java/sacl/): FIDO Enabled sample applications demonstrating SSO
3330

3431
## Sample Client
3532
StrongKey FIDO2 Server client offers examples of the various API calls using different available methods. Read the [skfsclient docs](https://github.com/StrongKey/fido2/blob/master/server/skfsclient/skfsclient.md) for commands to test FIDO2 functionality against your sandbox.
3633

37-
The skfsclient uses a FIDO2 simulator instead of an actual Authenticator to demonstrate the web services on the command line. Feel free to download the [simulator source code](https://github.com/StrongKey/fido2/tree/master/server/FIDO2Simulator) for your own use.
34+
The skfsclient uses a FIDO2 simulator instead of an actual authenticator to demonstrate the web services on the command line. Feel free to download the [simulator source code](https://github.com/StrongKey/fido2/tree/master/server/FIDO2Simulator) for your own use.
3835

3936
## API docs
4037
[Interactive OpenAPI documentation for FIDO2 Server](https://strongkey.github.io/fido2/)

docker/Dockerfile

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
###############################################################
2+
## /**
3+
## * Copyright StrongAuth, Inc. All Rights Reserved.
4+
## *
5+
## * Use of this source code is governed by the GNU Lesser General Public License v2.1
6+
## * The license can be found at https://github.com/StrongKey/fido2/blob/master/LICENSE
7+
## */
8+
################################################################
9+
10+
FROM centos:7
11+
12+
# Default payara ports to expose
13+
# 8181: https
14+
# 7001-7003: StrongKey FIDO2 Server Replication
15+
EXPOSE 8181 7001 7002 7003
16+
17+
# Set up environment variables
18+
ENV STRONGKEY_HOME=/usr/local/strongkey\
19+
SKFS_HOME=/usr/local/strongkey/skfs\
20+
GLASSFISH_HOME=/usr/local/strongkey/payara5/glassfish\
21+
GLASSFISH_CONFIG=${GLASSFISH_HOME}/domains/domain1/config\
22+
MARIACONJAR=mariadb-java-client-2.2.6.jar\
23+
XMXSIZE=512m
24+
25+
# Create strongkey user
26+
RUN groupadd -g 1000 strongkey &&\
27+
useradd -u 1000 -m -s /bin/bash -d ${STRONGKEY_HOME} strongkey -g strongkey
28+
29+
# Add to PATH and set up useful aliases for strongkey user
30+
RUN echo "\
31+
export GLASSFISH_HOME=${GLASSFISH_HOME} ; \
32+
export STRONGKEY_HOME=${STRONGKEY_HOME} ; \
33+
export PATH=${GLASSFISH_HOME}/bin:${STRONGKEY_HOME}/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin ; \
34+
\
35+
alias str='cd ${STRONGKEY_HOME}' ; \
36+
alias dist='cd ${STRONGKEY_HOME}/dist' ; \
37+
alias aslg='cd ${GLASSFISH_HOME}/domains/domain1/logs' ; \
38+
alias ascfg='cd ${GLASSFISH_HOME}/domains/domain1/config' ; \
39+
alias tsl='tail --follow=name ${GLASSFISH_HOME}/domains/domain1/logs/server.log' ; \
40+
alias mys='mysql -u skfsdbuser -p\`dbpass 2> /dev/null\` skfs' ; \
41+
alias java='java -Djavax.net.ssl.trustStore=${STRONGKEY_HOME}/certs/cacerts'"\
42+
>> /etc/skfsrc &&\
43+
if [ -f /etc/bashrc ]; then echo ". /etc/skfsrc" >> /etc/bashrc; else echo ". /etc/skfsrc" >> /etc/bash.bashrc; fi
44+
45+
# Install and download necessary libraries and fidoserver files
46+
RUN yum -y install wget unzip libaio java-1.8.0-openjdk ncurses-compat-libs rng-tools curl sudo >/dev/null 2>&1 &&\
47+
yum clean all &&\
48+
rm -rf /var/cache/yum &&\
49+
mkdir fidoserver &&\
50+
cd fidoserver &&\
51+
wget https://repo1.maven.org/maven2/fish/payara/distributions/payara/5.2020.7/payara-5.2020.7.zip -q &&\
52+
wget https://downloads.mariadb.com/Connectors/java/connector-java-2.2.6/mariadb-java-client-2.2.6.jar -q &&\
53+
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jemalloc-3.6.0-1.el7.x86_64.rpm -q &&\
54+
wget https://github.com/StrongKey/fido2/raw/master/fido2server-v4.4.0-dist.tgz -q &&\
55+
tar xzf fido2server-v4.4.0-dist.tgz
56+
57+
# Create necessary directories
58+
RUN mkdir -p ${STRONGKEY_HOME}/certs ${STRONGKEY_HOME}/Desktop ${STRONGKEY_HOME}/dbdumps ${STRONGKEY_HOME}/lib ${STRONGKEY_HOME}/bin ${STRONGKEY_HOME}/appliance/etc ${STRONGKEY_HOME}/crypto/etc ${SKFS_HOME}/etc ${SKFS_HOME}/keystores ${STRONGKEY_HOME}/skce/etc
59+
60+
# Perform certificate/keystore tasks
61+
RUN cd fidoserver &&\
62+
cp certimport.sh ${STRONGKEY_HOME}/bin &&\
63+
exec bash
64+
65+
# Install and set up Glassfish
66+
RUN cd fidoserver &&\
67+
unzip payara-5.2020.7.zip -d ${STRONGKEY_HOME} >/dev/null &&\
68+
chown -R strongkey. /usr/local/strongkey &&\
69+
${GLASSFISH_HOME}/bin/asadmin start-domain &&\
70+
cp ${MARIACONJAR} ${GLASSFISH_HOME}/lib &&\
71+
sed -ri 's|^(com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=).*|\1true|' ${GLASSFISH_HOME}/domains/domain1/config/logging.properties &&\
72+
sed -ri 's|^(com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=).*|\1200000000|' ${GLASSFISH_HOME}/domains/domain1/config/logging.properties &&\
73+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.network-listeners.network-listener.http-listener-1.enabled=false &&\
74+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.http.request-timeout-seconds=7200 &&\
75+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.ssl.ssl3-tls-ciphers=+TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,+TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,+TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,+TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,+TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,+TLS_DHE_RSA_WITH_AES_256_CBC_SHA &&\
76+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.ssl.ssl2-enabled=false &&\
77+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.ssl.ssl3-enabled=false &&\
78+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.ssl.tls-enabled=false &&\
79+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.ssl.tls11-enabled=false &&\
80+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.http.trace-enabled=false &&\
81+
${GLASSFISH_HOME}/bin/asadmin set server.network-config.protocols.protocol.http-listener-2.http.xpowered-by=false &&\
82+
${GLASSFISH_HOME}/bin/asadmin delete-jvm-options $(${GLASSFISH_HOME}/bin/asadmin list-jvm-options | sed -n '/\(-XX:NewRatio\|-XX:MaxPermSize\|-XX:PermSize\|-client\|-Xmx\|-Xms\)/p' | sed 's|:|\\\\:|' | tr '\n' ':') &&\
83+
${GLASSFISH_HOME}/bin/asadmin create-jvm-options -Djtss.tcs.ini.file=${STRONGKEY_HOME}/lib/jtss_tcs.ini:-Djtss.tsp.ini.file=${STRONGKEY_HOME}/lib/jtss_tsp.ini:-Xmx${XMXSIZE}:-Xms${XMXSIZE}:-Djdk.tls.ephemeralDHKeySize=2048:-Dproduct.name="":-XX\\:-DisableExplicitGC &&\
84+
cp fidoserver.ear /usr/local/strongkey &&\
85+
cp signingkeystore.bcfks /usr/local/strongkey &&\
86+
cp signingtruststore.bcfks /usr/local/strongkey &&\
87+
cp jwtsigningkeystore.bcfks /usr/local/strongkey &&\
88+
cp jwtsigningtruststore.bcfks /usr/local/strongkey &&\
89+
cp -r keymanager/ /usr/local/strongkey &&\
90+
cp -r skfsclient/ /usr/local/strongkey &&\
91+
cp keygen-jwt.sh /usr/local/strongkey &&\
92+
chown -R strongkey. /usr/local/strongkey &&\
93+
cd ../ &&\
94+
rm -rf fidoserver
95+
96+
# Copy entrypoint script to image to run when container is initialized
97+
COPY ./entrypoint.sh ${STRONGKEY_HOME}
98+
RUN chown -R strongkey. /usr/local/strongkey/entrypoint.sh
99+
100+
# All operations from here on should be run as strongkey user
101+
USER strongkey
102+
WORKDIR ${STRONGKEY_HOME}
103+
ENTRYPOINT ["/usr/local/strongkey/entrypoint.sh"]

docker/README.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
# FIDO2 Server, Community Edition, Dockerized
3+
## Overview:
4+
This branch contains a Dockerized version of StrongKey's Certified FIDO2 Server, Community Edition. This implementation allows for the creation of a FIDO2 server within a container, which allows for the ability to be deployed in any environment. This README will focus on the Docker portion of the StrongKey FIDO2 Server; please refer to the main [README](https://github.com/StrongKey/fido2) for anything related to the FIDO side of the server.
5+
6+
## Prerequisites: Host machine/VM
7+
Docker must be installed and enabled to build and use the StrongKey FIDO2 Server image.
8+
It is recommended that you have a machine or VM with the following minimum requirements:
9+
10+
* 10 GB storage
11+
* 4 GB memory
12+
13+
These values are also the recommended minimums for each container. CPUs and memory for each container may be manually allocated at runtime (see [example usage](https://github.com/StrongKey/fido2/blob/docker/docker/example-usage.txt)). If these flags are not set, "[by default, a container has no resource constraints and can use as much of a given resource as the host’s kernel scheduler allows](https://docs.docker.com/config/containers/resource_constraints/)."
14+
15+
The host machine's firewall should open port 8181 (or the port bound to the Docker container's port 8181) as well as ports 7001-7003 if clustering containers.
16+
17+
## Prerequisites: External DB and LDAP/AD
18+
In this specific version of the Dockerized StrongKey FIDO2 Server, both the MySQL database and LDAP are not included, so an external MySQL 5 database and LDAP/AD are required for setup. The containers can be configured to use the external database and LDAP/AD in the *base64-input.sh* script.
19+
20+
The database configuration should be sourced from the FIDO2 Server's *create.txt* in the server's [*fidoserverSQL* directory](https://github.com/StrongKey/fido2/tree/master/server/fidoserverInstall/fidoserverSQL). Additionally, any database insert commands found in the install-skfs.sh from a regular StrongKey FIDO2 Server should be performed on this database.
21+
22+
Theexternal LDAP/AD must be configured in the same way as a normal FIDO2 Server as described in the distribution's *.ldif* files.
23+
24+
## Getting Started
25+
1. **Build the image**.
26+
```sh
27+
[sudo] docker build -t fidoserver .
28+
```
29+
2. **Configure the image settings**. Here you may configure the external LDAP/AD database, and clustering.
30+
```sh
31+
vi base64-input.sh
32+
```
33+
3. Get base64 input for the container. **Save the output** of the *base64-input.sh* script somewhere for the next step.
34+
```sh
35+
./base64-input.sh
36+
```
37+
4. **Run the image in a container** with the output from the *base64-input.sh* script as its only argument. The hostname flag (-h) and bound port 8181 are necessary. To debug any issues with glassfish, it may be a good idea to remove the -d (detach) flag to be able to view the logs
38+
```sh
39+
[sudo] docker run -dit -h fido01.strongkey.com -p 8181:8181 fidoserver <base64-input>
40+
```
41+
To enter into a bash terminal within the container, perform the following additional steps:
42+
43+
5. **Find the container ID**.
44+
```sh
45+
[sudo] docker container ls
46+
```
47+
6. To enter into a bash terminal in the container, **execute the following**:
48+
```sh
49+
[sudo] docker exec -it <CONTAINER-ID> /bin/bash
50+
```
51+
52+
## Clustering
53+
When clustering, for replication to work properly, open ports 7001-7003 on the container when running it. For example,
54+
```sh
55+
[sudo] docker run -dit -h fido01.strongkey.com -p 8181:8181 -p 7001-7003:7001-7003 fidoserver <base64-input>
56+
```
57+
Further instructions on clustering can be found in the *base64-input.sh* when configuring the image settings on *Step 2* of the *Getting Started* section.
58+
59+
60+

docker/base64-input.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
###############################################################
3+
# /**
4+
# * Copyright StrongAuth, Inc. All Rights Reserved.
5+
# *
6+
# * Use of this source code is governed by the GNU Lesser General Public License v2.1
7+
# * The license can be found at https://github.com/StrongKey/fido2/blob/master/LICENSE
8+
# */
9+
###############################################################
10+
11+
DB_URL='fido-docker.cluster-c9iyctxcjygt.us-west-1.rds.amazonaws.com'
12+
DB_USER='root'
13+
DB_PASS='BigKahuna'
14+
MARIA_SKFSDBUSER_PASSWORD='AbracaDabra'
15+
16+
LDAP_URLPORT='ldap://3.236.203.121:1389'
17+
LDAP_TYPE='LDAP'
18+
LDAP_BINDDN='[email protected]'
19+
LDAP_PASS='dne(!nPCiVJ'
20+
LDAP_DNPREFIX='cn='
21+
LDAP_DNSUFFIX=',ou=users,ou=v2,ou=SKCE,ou=StrongAuth,ou=Applications,dc=strongkey,dc=com'
22+
LDAP_BASEDN='dc=strongkey,dc=com'
23+
LDAP_GROUPSUFFIX=',ou=groups,ou=v2,ou=SKCE,ou=StrongAuth,ou=Applications,dc=strongkey,dc=com'
24+
25+
JWT_CREATE=false
26+
JWT_KEYGEN_DN='/C=US/ST=California/L=Cupertino/O=StrongAuth/OU=Engineering'
27+
JWT_CLUSTER_SIZE=1
28+
JWT_CERTS_PER_SERVER=3
29+
JWT_DID=1
30+
JWT_KEYSTORE_PASS='Abcd1234!'
31+
JWT_KEY_VALIDITY=365
32+
33+
# Steps to clustering:
34+
# 1. Add *container* hostname entries to servers table in db, taking note of which serverid belongs to which hostname
35+
# 2. Set $CLUSTER to true
36+
# 3. Change $HOSTS and $SERVERID variables appropriately
37+
CLUSTER=false
38+
HOSTS='54.183.213.1 fido01.strongkey.com%18.144.34.248 fido02.strongkey.com' # /etc/hosts file entries delimited by '%'
39+
SERVERID=1 # Same as serverid in db for this container
40+
41+
if [ $CLUSTER = true ]
42+
then
43+
echo $(echo "$DB_URL;$DB_USER;$DB_PASS;$MARIA_SKFSDBUSER_PASSWORD;$LDAP_URLPORT;$LDAP_TYPE;$LDAP_BINDDN;$LDAP_PASS;$LDAP_DNPREFIX;$LDAP_DNSUFFIX;$LDAP_BASEDN;$LDAP_GROUPSUFFIX;$JWT_CREATE;$JWT_KEYGEN_DN;$JWT_CLUSTER_SIZE;$JWT_CERTS_PER_SERVER;$JWT_DID;$JWT_KEYSTORE_PASS;$JWT_KEY_VALIDITY;$HOSTS;$SERVERID"| base64 --wrap=0)
44+
else
45+
echo $(echo "$DB_URL;$DB_USER;$DB_PASS;$MARIA_SKFSDBUSER_PASSWORD;$LDAP_URLPORT;$LDAP_TYPE;$LDAP_BINDDN;$LDAP_PASS;$LDAP_DNPREFIX;$LDAP_DNSUFFIX;$LDAP_BASEDN;$LDAP_GROUPSUFFIX;$JWT_CREATE;$JWT_KEYGEN_DN;$JWT_CLUSTER_SIZE;$JWT_CERTS_PER_SERVER;$JWT_DID;$JWT_KEYSTORE_PASS;$JWT_KEY_VALIDITY"| base64 --wrap=0)
46+
fi

0 commit comments

Comments
 (0)