Nueva publicación

Encontrar

Artículo
· 25 nov, 2024 Lectura de 3 min

Programmatic configuration of SSL Connections with the Superserver

Greetings dear community members!

I have recently been deploying an IRIS for Health image on a Docker with a preconfigured Webgateway image and I have come across the problem of the SSL configurations that allow us to connect to the IRIS instance using HTTPS and going through our Webgateway.

Until now I had always deployed IRIS for Health with a Community license, which still has the Private Web Server installed, so I only needed to configure the Webgateway connection with the deployed IRIS instance:

Access the management portal using the URL provided by the PWS and enable access to the Superserver from its configuration screen:

By selecting port 1972 we could see the security information and we only needed to enable SSL connections with the previously created %SuperServer SSL/TLS configuration:

Well, with non-Community versions the last step of the configuration is not feasible, since we do not have web access to our IRIS instance, therefore, we will have to do it programmatically so that when deploying our Docker it not only creates the SSL/TLS configuration but also enables SSL connections with the superserver that the webgateway will use for the connection.

To do this we must use the  Security.Servers  class that allows us to perform the same configuration. Below you can see a class method that will create the SSL connection %SuperServer and then enable said connections with port 1972:

Method EnableSSLSuperServer(password="")
{
    New $NAMESPACE
    zn "%SYS"
    set certdir=..SSLDirectory
    set CAfile = ..SSLCertAuth
    set certfile = ..SSLCertificate
    set keyfile = ..SSLKey
    set sslconfig = ##class(Security.SSLConfigs).%New()
    do sslconfig.CAFileSet(certdir_CAfile)
    do sslconfig.CertificateFileSet(certdir_certfile)
    do sslconfig.PrivateKeyFileSet(certdir_keyfile)
    if password'="" do sslconfig.PrivateKeyPasswordSet(password)
    do sslconfig.DescriptionSet("SuperServer configuration")
    do sslconfig.EnabledSet(1)
    do sslconfig.TypeSet(1)
    do sslconfig.NameSet("%SuperServer")
    set sc=sslconfig.%Save()
    If (sc'=1) {
        Write !, "WARNING: Creating and saving the %SuperServer SSL configuration failed!"
        Write !, $system.Status.GetErrorText(sc)
    }

    If (sc'=1) {
        Write !, "WARNING: Getting the system security settings failed!"
        Write !, $system.Status.GetErrorText(sc)
    }
    set sc = ##class(Security.Servers).Get("1972",,.propsSuperServer)
    set propsSuperServer("Enabled") = 1
    set propsSuperServer("SSLSupportLevel") = 1
    set propsSuperServer("SSLConfig") = "%SuperServer"
    set sc = ##class(Security.Servers).Modify("1972",,.propsSuperServer)

    If (sc'=1) {
        Write !, "WARNING: Modifying the system's SSLSuperServer property failed!"
        Write !, $system.Status.GetErrorText(sc)    
    }
    Write !, "Done enabling SSL for the SuperServer"
}

In more detail, this will be the code snippet that enables SSL for 1972:

set sc = ##class(Security.Servers).Get("1972",,.propsSuperServer)
    set propsSuperServer("Enabled") = 1
    set propsSuperServer("SSLSupportLevel") = 1
    set propsSuperServer("SSLConfig") = "%SuperServer"
    set sc = ##class(Security.Servers).Modify("1972",,.propsSuperServer)

I hope you find it useful!

1 Comentario
Comentarios (1)2
Inicie sesión o regístrese para continuar
Artículo
· 25 nov, 2024 Lectura de 3 min

Configurando programáticamente conexiones SSL con el Superserver

¡Saludos estimados miembros de la comunidad!

Recientemente he estado desplegando una imagen de IRIS for Health en un Docker con una imagen de Webgateway preconfigurado y me he dado de morros con el problema de las configuraciones SSL que nos permitan conectarnos a la instancia de IRIS mediante HTTPS y pasando por nuestro Webgateway.

Hasta ahora siempre había desplegado IRIS for Health con licencia Community, que cuenta aún con el Private Web Server instalado, por lo que sólo necesitaba configurar la conexión de Webgateway con la instancia de IRIS desplegada:

Acceder al portal de gestión usando la url que proporcionaba el PWS y habilitaba el acceso al Superserver desde la pantalla de configuración del mismo:

Seleccionando el puerto 1972 podíamos ver la información de seguridad y sólo necesitábamos habilitar las conexiones SSL con la configuración de la SSL/TLS %SuperServer previamente creada:

Pues bien, con las versiones que no son Community el último paso de la configuración no es factible, ya que no disponemos de acceso vía web a nuestra instancia de IRIS, por lo tanto, deberemos hacerlo programáticamente para que al desplegar nuestro Docker no sólo cree la configuración SSL/TLS sino para que nos habilite las conexiones SSL con el superserver que usará el webgateway para la conexión.

Para ello debemos hacer uso de la clase Security.Servers que nos permite realizar esa misma configuración, a continuación podéis ver un método de clase que nos creará la conexión SSL %SuperServer y a continuación habilitará dichas conexiones con el puerto 1972:

Method EnableSSLSuperServer(password="")
{
    New $NAMESPACE
    zn "%SYS"

    set certdir=..SSLDirectory
    set CAfile = ..SSLCertAuth
    set certfile = ..SSLCertificate
    set keyfile = ..SSLKey

    set sslconfig = ##class(Security.SSLConfigs).%New()
    do sslconfig.CAFileSet(certdir_CAfile)
    do sslconfig.CertificateFileSet(certdir_certfile)
    do sslconfig.PrivateKeyFileSet(certdir_keyfile)
    if password'="" do sslconfig.PrivateKeyPasswordSet(password)
    do sslconfig.DescriptionSet("SuperServer configuration")
    do sslconfig.EnabledSet(1)
    do sslconfig.TypeSet(1)
    do sslconfig.NameSet("%SuperServer")
    set sc=sslconfig.%Save()
    If (sc'=1) {
        Write !, "WARNING: Creating and saving the %SuperServer SSL configuration failed!"
        Write !, $system.Status.GetErrorText(sc)
    }

    If (sc'=1) {
        Write !, "WARNING: Getting the system security settings failed!"
        Write !, $system.Status.GetErrorText(sc)
    }
    set sc = ##class(Security.Servers).Get("1972",,.propsSuperServer)
    set propsSuperServer("Enabled") = 1
    set propsSuperServer("SSLSupportLevel") = 1
    set propsSuperServer("SSLConfig") = "%SuperServer"
    set sc = ##class(Security.Servers).Modify("1972",,.propsSuperServer)

    If (sc'=1) {
        Write !, "WARNING: Modifying the system's SSLSuperServer property failed!"
        Write !, $system.Status.GetErrorText(sc)    
    }
    Write !, "Done enabling SSL for the SuperServer"
}

Más en detalle, este será el fragmento de código que habilita el SSL para el 1972:

set sc = ##class(Security.Servers).Get("1972",,.propsSuperServer)
    set propsSuperServer("Enabled") = 1
    set propsSuperServer("SSLSupportLevel") = 1
    set propsSuperServer("SSLConfig") = "%SuperServer"
    set sc = ##class(Security.Servers).Modify("1972",,.propsSuperServer)

¡Espero que os sea de utilidad!

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
InterSystems Official
· 25 nov, 2024

InterSystems System Alerting and Monitoring (SAM) será eliminado

El 4 de diciembre de 2024, System Alerting and Monitoring (SAM) será eliminado de los sitios de descarga de InterSystems, el registro de contenedores y la wed de documentación.

InterSystems anunció el año pasado que había dejado de desarrollar SAM y, al mismo tiempo, lo marcó como obsoleto. InterSystems continuará brindando soporte a los clientes existentes que utilicen esta tecnología de la misma manera que lo hace con las versiones de producto más allá de la ventana de Versiones Mínimas Soportadas.

InterSystems ha observado que la mayoría de los clientes interesados en la observabilidad que ofrece SAM han optado por conectar la API de métricas de InterSystems IRIS y los registros estructurados a la plataforma de observabilidad existente de su organización para obtener una visión más completa de su plataforma operativa.

Si tenéis preguntas sobre el uso actual o planificado de SAM, poneos en contacto con vuestro equipo de cuenta o escribid a dbpprodmgrs@intersystems.com.

Comentarios (0)1
Inicie sesión o regístrese para continuar
Anuncio
· 25 nov, 2024

[Vidéo] Java External Language Gateway

Salut la Communauté!

Profitez de regarder la nouvelle vidéo sur la chaîne Youtube d'InterSystems France :

📺 Java External Language Gateway

Découvrez les bases de la configuration et de l'utilisation de Java External Language Gateway dans InterSystems IRIS.

🗣 Intervenante : @Iryna Mykhailova, Professeur à l'Igor Sikorsky Institut Polytechnique de Kyiv

Abonnez-vous à notre chaîne youtube pour plus de vidéos !

Comentarios (0)0
Inicie sesión o regístrese para continuar
Resumen
· 25 nov, 2024

Publications des développeurs d'InterSystems, semaine Novembre 18 - 24, 2024, Résumé

Novembre 18 - 24, 2024Week at a GlanceInterSystems Developer Community