|
| 1 | +version: '3' |
| 2 | + |
| 3 | +services: |
| 4 | + mockoauth: |
| 5 | + image: testsuite/mock-oauth-server |
| 6 | + ports: |
| 7 | + - "8090:8090" |
| 8 | + - "8091:8091" |
| 9 | + - "5005:5005" |
| 10 | + volumes: |
| 11 | + - ${PWD}/../docker/certificates:/application/config |
| 12 | + |
| 13 | + environment: |
| 14 | + #- JAVA_DEBUG=y |
| 15 | + #- DEBUG_SUSPEND_FLAG=y |
| 16 | + #- JAVA_DEBUG_PORT=0.0.0.0:5005 |
| 17 | + |
| 18 | + - KEYSTORE_ONE_PATH=/application/config/mockoauth.server.keystore.p12 |
| 19 | + - KEYSTORE_ONE_PASSWORD=changeit |
| 20 | + - KEYSTORE_TWO_PATH=/application/config/mockoauth.server.keystore_2.p12 |
| 21 | + - KEYSTORE_TWO_PASSWORD=changeit |
| 22 | + - KEYSTORE_EXPIRED_PATH=/application/config/mockoauth.server.keystore_expired.p12 |
| 23 | + - KEYSTORE_EXPIRED_PASSWORD=changeit |
| 24 | + |
| 25 | + kafka: |
| 26 | + image: ${KAFKA_DOCKER_IMAGE} |
| 27 | + ports: |
| 28 | + - "9091:9091" |
| 29 | + - "9092:9092" |
| 30 | + - "9093:9093" |
| 31 | + - "9094:9094" |
| 32 | + - "9095:9095" |
| 33 | + - "9096:9096" |
| 34 | + - "9097:9097" |
| 35 | + - "9098:9098" |
| 36 | + - "9099:9099" |
| 37 | + - "9404:9404" |
| 38 | + |
| 39 | + # Debug port |
| 40 | + - "5006:5006" |
| 41 | + volumes: |
| 42 | + - ${PWD}/../docker/target/kafka/libs:/opt/kafka/libs/strimzi |
| 43 | + - ${PWD}/../docker/kafka/config:/opt/kafka/config/strimzi |
| 44 | + - ${PWD}/../docker/target/kafka/certs:/opt/kafka/config/strimzi/certs |
| 45 | + - ${PWD}/../docker/kafka/scripts:/opt/kafka/strimzi |
| 46 | + - ${PWD}/../docker/kerberos/krb5.conf:/etc/krb5.conf |
| 47 | + - ${PWD}/../docker/kerberos/kafka_server_jaas.conf:/opt/kafka/kafka_server_jaas.conf |
| 48 | + - ${PWD}/../docker/kerberos/keys:/opt/kafka/keytabs |
| 49 | + command: |
| 50 | + - /bin/bash |
| 51 | + - -c |
| 52 | + #- sleep 10000 |
| 53 | + - cd /opt/kafka/strimzi && ./start_no_wait.sh |
| 54 | + environment: |
| 55 | + #- KAFKA_DEBUG=y |
| 56 | + #- DEBUG_SUSPEND_FLAG=y |
| 57 | + #- JAVA_DEBUG_PORT=0.0.0.0:5006 |
| 58 | + |
| 59 | + - KAFKA_BROKER_ID=1 |
| 60 | + - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 |
| 61 | + - KAFKA_LISTENERS=INTERBROKER://kafka:9091,JWT://kafka:9092,INTROSPECT://kafka:9093,JWTPLAIN://kafka:9094,PLAIN://kafka:9095,INTROSPECTTIMEOUT://kafka:9096,FAILINGINTROSPECT://kafka:9097,FAILINGJWT://kafka:9098,KERBEROS://kafka:9099 |
| 62 | + - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERBROKER:PLAINTEXT,JWT:SASL_PLAINTEXT,INTROSPECT:SASL_PLAINTEXT,JWTPLAIN:SASL_PLAINTEXT,PLAIN:SASL_PLAINTEXT,INTROSPECTTIMEOUT:SASL_PLAINTEXT,FAILINGINTROSPECT:SASL_PLAINTEXT,FAILINGJWT:SASL_PLAINTEXT,KERBEROS:SASL_PLAINTEXT |
| 63 | + - KAFKA_SASL_ENABLED_MECHANISMS=OAUTHBEARER |
| 64 | + - KAFKA_INTER_BROKER_LISTENER_NAME=INTERBROKER |
| 65 | + |
| 66 | + # Common settings for all the listeners |
| 67 | + # username extraction from JWT token claim |
| 68 | + - KAFKA_PRINCIPAL_BUILDER_CLASS=io.strimzi.kafka.oauth.server.OAuthKafkaPrincipalBuilder |
| 69 | + - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 |
| 70 | + |
| 71 | + # Configuration of individual listeners |
| 72 | + - KAFKA_LISTENER_NAME_INTROSPECT_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"INTROSPECT\" oauth.introspection.endpoint.uri=\"https://mockoauth:8090/introspect\" oauth.client.id=\"unused\" oauth.client.secret=\"unused-secret\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 73 | + - KAFKA_LISTENER_NAME_INTROSPECT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 74 | + #- KAFKA_LISTENER_NAME_INTROSPECT_OAUTHBEARER_SASL_LOGIN_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler |
| 75 | + |
| 76 | + - KAFKA_LISTENER_NAME_JWT_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"JWT\" oauth.fail.fast=\"false\" oauth.jwks.endpoint.uri=\"https://mockoauth:8090/jwks\" oauth.jwks.refresh.seconds=\"10\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" oauth.check.access.token.type=\"false\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 77 | + - KAFKA_LISTENER_NAME_JWT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 78 | + |
| 79 | + - KAFKA_LISTENER_NAME_JWTPLAIN_SASL_ENABLED_MECHANISMS=OAUTHBEARER,PLAIN |
| 80 | + - KAFKA_LISTENER_NAME_JWTPLAIN_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"JWTPLAIN\" oauth.fail.fast=\"false\" oauth.jwks.endpoint.uri=\"https://mockoauth:8090/jwks\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 81 | + - KAFKA_LISTENER_NAME_JWTPLAIN_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 82 | + |
| 83 | + - KAFKA_LISTENER_NAME_JWTPLAIN_PLAIN_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required oauth.config.id=\"JWTPLAIN\" oauth.token.endpoint.uri=\"https://mockoauth:8090/token\" oauth.fail.fast=\"false\" oauth.jwks.endpoint.uri=\"https://mockoauth:8090/jwks\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 84 | + - KAFKA_LISTENER_NAME_JWTPLAIN_PLAIN_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.plain.JaasServerOauthOverPlainValidatorCallbackHandler |
| 85 | + |
| 86 | + - KAFKA_LISTENER_NAME_PLAIN_SASL_ENABLED_MECHANISMS=PLAIN |
| 87 | + - KAFKA_LISTENER_NAME_PLAIN_PLAIN_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required username=\"admin\" password=\"admin-password\" user_admin=\"admin-password\" ; |
| 88 | + |
| 89 | + # The 'oauth.connect.timeout.seconds' should be overridden by env var OAUTH_CONNECT_TIMEOUT_SECONDS, so it should be 10 seconds |
| 90 | + - KAFKA_LISTENER_NAME_INTROSPECTTIMEOUT_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"INTROSPECTTIMEOUT\" oauth.connect.timeout.seconds=\"5\" oauth.introspection.endpoint.uri=\"https://mockoauth:8090/introspect\" oauth.client.id=\"kafka\" oauth.client.secret=\"kafka-secret\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 91 | + - KAFKA_LISTENER_NAME_INTROSPECTTIMEOUT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 92 | + |
| 93 | + - KAFKA_LISTENER_NAME_FAILINGINTROSPECT_SASL_ENABLED_MECHANISMS=OAUTHBEARER,PLAIN |
| 94 | + - KAFKA_LISTENER_NAME_FAILINGINTROSPECT_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"FAILINGINTROSPECT\" oauth.introspection.endpoint.uri=\"https://mockoauth:8090/failing_introspect\" oauth.userinfo.endpoint.uri=\"https://mockoauth:8090/failing_userinfo\" oauth.username.claim=\"uid\" oauth.client.id=\"kafka\" oauth.client.secret=\"kafka-secret\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" oauth.http.retries=\"1\" oauth.http.retry.pause.millis=\"3000\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 95 | + - KAFKA_LISTENER_NAME_FAILINGINTROSPECT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 96 | + |
| 97 | + - KAFKA_LISTENER_NAME_FAILINGINTROSPECT_PLAIN_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required oauth.config.id=\"FAILINGINTROSPECT\" oauth.token.endpoint.uri=\"https://mockoauth:8090/failing_token\" oauth.introspection.endpoint.uri=\"https://mockoauth:8090/failing_introspect\" oauth.userinfo.endpoint.uri=\"https://mockoauth:8090/failing_userinfo\" oauth.username.claim=\"uid\" oauth.client.id=\"kafka\" oauth.client.secret=\"kafka-secret\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" oauth.http.retries=\"1\" oauth.http.retry.pause.millis=\"3000\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 98 | + - KAFKA_LISTENER_NAME_FAILINGINTROSPECT_PLAIN_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.plain.JaasServerOauthOverPlainValidatorCallbackHandler |
| 99 | + |
| 100 | + - KAFKA_LISTENER_NAME_FAILINGJWT_SASL_ENABLED_MECHANISMS=OAUTHBEARER,PLAIN |
| 101 | + - KAFKA_LISTENER_NAME_FAILINGJWT_OAUTHBEARER_SASL_JAAS_CONFIG=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required oauth.config.id=\"FAILINGJWT\" oauth.fail.fast=\"false\" oauth.check.access.token.type=\"false\" oauth.jwks.endpoint.uri=\"https://mockoauth:8090/jwks\" oauth.jwks.refresh.seconds=\"10\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 102 | + - KAFKA_LISTENER_NAME_FAILINGJWT_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.JaasServerOauthValidatorCallbackHandler |
| 103 | + |
| 104 | + - KAFKA_LISTENER_NAME_FAILINGJWT_PLAIN_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required oauth.config.id=\"FAILINGJWT\" oauth.fail.fast=\"false\" oauth.check.access.token.type=\"false\" oauth.jwks.endpoint.uri=\"https://mockoauth:8090/jwks\" oauth.jwks.refresh.seconds=\"10\" oauth.valid.issuer.uri=\"https://mockoauth:8090\" oauth.token.endpoint.uri=\"https://mockoauth:8090/failing_token\" oauth.http.retries=\"1\" oauth.http.retry.pause.millis=\"3000\" unsecuredLoginStringClaim_sub=\"admin\" ; |
| 105 | + - KAFKA_LISTENER_NAME_FAILINGJWT_PLAIN_SASL_SERVER_CALLBACK_HANDLER_CLASS=io.strimzi.kafka.oauth.server.plain.JaasServerOauthOverPlainValidatorCallbackHandler |
| 106 | + |
| 107 | + |
| 108 | + # Truststore config for connecting to secured authorization server |
| 109 | + - OAUTH_SSL_TRUSTSTORE_LOCATION=/opt/kafka/config/strimzi/certs/ca-truststore.p12 |
| 110 | + - OAUTH_SSL_TRUSTSTORE_PASSWORD=changeit |
| 111 | + - OAUTH_SSL_TRUSTSTORE_TYPE=pkcs12 |
| 112 | + - OAUTH_CONNECT_TIMEOUT_SECONDS=10 |
| 113 | + - OAUTH_READ_TIMEOUT_SECONDS=10 |
| 114 | + |
| 115 | + |
| 116 | + # OAuth metrics configuration |
| 117 | + |
| 118 | + - OAUTH_ENABLE_METRICS=true |
| 119 | + # When enabling metrics we also have to explicitly configure JmxReporter to have metrics available in JMX |
| 120 | + # The following value will be available as env var STRIMZI_OAUTH_METRIC_REPORTERS |
| 121 | + - STRIMZI_OAUTH_METRIC_REPORTERS=org.apache.kafka.common.metrics.JmxReporter |
| 122 | + |
| 123 | + # The following value will turn into 'strimzi.oauth.metric.reporters=...' in 'strimzi.properties' file |
| 124 | + # However, that won't work as the value may be filtered to the component that happens to initialise OAuthMetrics |
| 125 | + #- KAFKA_STRIMZI_OAUTH_METRIC_REPORTERS=org.apache.kafka.common.metrics.JmxReporter |
| 126 | + - KAFKA_LISTENER_NAME_KERBEROS_SASL_KERBEROS_SERVICE_NAME=kafka |
| 127 | + - KAFKA_LISTENER_NAME_KERBEROS_SASL_ENABLED_MECHANISMS=GSSAPI |
| 128 | + - KAFKA_OPTS=-Djava.security.krb5.conf=/etc/krb5.conf -Djava.security.auth.login.config=/opt/kafka/kafka_server_jaas.conf |
| 129 | + |
| 130 | + zookeeper: |
| 131 | + image: ${KAFKA_DOCKER_IMAGE} |
| 132 | + ports: |
| 133 | + - "2181:2181" |
| 134 | + volumes: |
| 135 | + - ${PWD}/../docker/zookeeper/scripts:/opt/kafka/strimzi |
| 136 | + - ${PWD}/../docker/kafka/kerberos/keys:/keytabs |
| 137 | + command: |
| 138 | + - /bin/bash |
| 139 | + - -c |
| 140 | + - cd /opt/kafka/strimzi && ./start.sh |
| 141 | + environment: |
| 142 | + - LOG_DIR=/tmp/logs |
| 143 | + kerberos: |
| 144 | + build: ${PWD}/../docker/kerberos |
| 145 | + hostname: 'kerberos' |
| 146 | + environment: |
| 147 | + - REALM=KERBEROS |
| 148 | + - DOMAIN_REALM=kerberos |
| 149 | + - KERB_MASTER_KEY=masterkey |
| 150 | + - KERB_ADMIN_USER=admin |
| 151 | + - KERB_ADMIN_PASS=admin |
| 152 | + volumes: |
| 153 | + - ${PWD}/../docker/kerberos/keys:/keytabs |
| 154 | + ports: |
| 155 | + - "749:749" |
| 156 | + - "88:88/udp" |
0 commit comments