Definizione del supporto SAF JWT per il servizio profilo di debug

Questa sezione fornisce alcuni esempi di comandi RACF che creano un nuovo SAF Identify Token (IDT) firmato nel formato JSON Web Token (JWT) con ID applicazione (APPLID) EQAAPPL. Per ulteriori informazioni sui requisiti di sicurezza, vedere Aggiunta del supporto per l'API del servizio di autenticazione.

Nota:
  • Per configurare l'ambiente di sistema operativo ( z/OS ) per la Cryptographic Service Facility (ICSF), vedere Cryptographic Services ICSF: System Programmer's Guide.
  • Per avviare l'ICSF, il task ICSF o CSF deve essere attivo.
  • Creare il set di dati Token (TKDS) per il supporto PCKS#11.
  • In un Sysplex, è necessario creare un database RACF e configurare ICSF per condividere i set di dati TKDS tra gli LPAR membri. Per informazioni dettagliate, vedere Esecuzione in un ambiente Sysplex.
  1. (Facoltativo) creare un profilo di classe CRYPTOZ con il valore ** e impostare UACC su NONE.
    RDEFINE CRYPTOZ SO.** UACC(NONE)
    RDEFINE CRYPTOZ USER.** UACC(NONE)
    RDEFINE CRYPTOZ CLEARKEY.** UACC(NONE)
    
    Questa impostazione garantisce che ICSF generi messaggi di errore significativi e semplifica l'identificazione degli errori.
  2. Creare un token PKCS#11 z/OS.
    Identify Token Support (ITS) utilizza dati riservati memorizzati nel token ICSF PKCS#11. L'accesso al token PKCS#11 all'interno di ICSF è regolato dalla classe CRYPTOZ.
    Nota: ricordate il valore del tokenname, perché dovrete usarlo nei passaggi 3 e 4.
    1. Attivare la classe CRYPTOZ.
      SETROPTS GENERIC(CRYPTOZ) 
      SETROPTS CLASSACT(CRYPTOZ) RACLIST(CRYPTOZ) 
      SETROPTS RACLIST(CRYPTOZ) REFRESH
      
    2. Sostituite #crypto con gli ID utente o i nomi di gruppo RACF validi degli amministratori crittografici per creare il token PKCS#11 che contiene la chiave privata.
    3. Sostituire #tokename con il nome desiderato o con il nome predefinito del token JWTTOK.EQAAPPL.
      RDEFINE CRYPTOZ SO.#tokenname UACC(NONE) DATA('CREATE PKCS#11 TOKEN')
      PERMIT SO.#tokenname CLASS(CRYPTOZ) ACCESS(CONTROL) ID(#crypto) 
      RDEFINE CRYPTOZ CLEARKEY.#tokenname UACC(NONE) DATA('CREATE PKCS#11 KEY') 
      PERMIT CLEARKEY.#tokenname CLASS(CRYPTOZ) ACCESS(READ) ID(#crypto) 
      
    4. Implementare le modifiche di CRYPTOZ.
      SETROPTS RACLIST(CRYPTOZ) REFRESH
    5. Creare un token PKCS#11.
      RACDCERT ADDTOKEN(#tokenname)
  3. Definire un nuovo profilo di classe IDTDATA per definire le applicazioni e gli utenti che utilizzano il supporto per i token di identificazione.
    Per ulteriori informazioni, vedere Attivazione e utilizzo del parametro IDTA in RACROUTE REQUEST=VERIFY e initACEE.
    1. Attivare la classe IDTDATA.
      SETROPTS GENERIC(IDTDATA) 
      SETROPTS CLASSACT(IDTDATA) RACLIST(IDTDATA) 
      SETROPTS RACLIST(IDTDATA) REFRESH
      
    2. Creare un provider SAF JWT generico di nome EQAAPPL.
      • Il formato del profilo è <Identity Token (IDT) type>.<application ID>.<user ID>.<IDT issuer name> dove Identity Token (IDT) è JWT, Application ID è EQAAPPL, User ID è un filtro dove un asterisco (*) è un pass-through che consente a tutti gli ID utente di generare e convalidare un JWT SAF o di definire un ID utente valido per limitare gli utenti, e IDT issue name è SAF.
      • SIGTOKEN specifica il token PKCS#11 per la generazione e la convalida delle firme dei token di identità. Sostituire #tokename con il nome desiderato.
      • SIGALG è il tipo di algoritmo utilizzato per generare le firme dei token di identità.
      • ANYAPPL specifica se l'IDT può essere utilizzato da qualsiasi nome di applicazione.
      • IDTTIMEOUT specifica il numero di minuti di validità del token di identità.
      RDEFINE IDTDATA JWT.EQAAPPL.*.SAF IDTPARMS(SIGTOKEN(#tokenname) SIGALG(HS512) ANYAPPL(YES) IDTTIMEOUT(30)) UACC(NONE) DATA('Debug Profile Service')
    3. Implementare le modifiche a IDTDATA.
      SETROPTS RACLIST(IDTDATA) REFRESH
  4. Creare la chiave privata per il token PKCS#11.
    Per completare questo passaggio, utilizzare il programma di esempio " EQAW.SEQASAMP(EQAPKCS1). L'amministratore crittografico può personalizzare e inviare il membro EQAPKCS1.
    //EQAPKCS1 JOB <job parameters>
    //*********************************************************************
    //* Licensed materials - Property of IBM                              *
    //*                                                                   *
    //* 5724-T07: IBM z/OS Debugger                                       *
    //* Copyright IBM Corp. 2024, 2024 All Rights Reserved                *
    //*                                                                   *
    //* US Government Users Restricted Rights - Use, duplication or       *
    //* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *
    //*                                                                   *
    //* This JCL creates a private key for a PKCS#11 token.               *
    //*                                                                   *
    //*                                                                   *
    //* CAUTIONS:                                                         *
    //* A) This job contains case sensitive path statements.              *
    //* B) This is neither a JCL procedure nor a complete job.            *
    //*    Before using this JCL, you will have to make the following     *
    //*    modifications:                                                 *
    //*                                                                   *
    //* 1) Add the job parameters to meet your system requirements.       *
    //*                                                                   *
    //* 2) Provide, in variable BASE, the home directory of the           *
    //*    product install (default is /usr/lpp/IBM/debug).               *
    //*                                                                   *
    //* 3) Provide, in variable TOKEN, the PKCS#11 token name defined     *
    //*    during security setup (default is JWTTOK.EQAAPPL).             *
    //*                                                                   *
    //* 4) Provide, in variable KEYTYPE, the type of private key that     *
    //*    must be created. Valid values are CLEAR and SECURE (default    *
    //*    is CLEAR).                                                     *
    //*                                                                   *
    //* 5) Provide, in variable KEYSIZE, the size of the private key,     *
    //*    in bits. The value must be a multiple of 8 and minimum 128     *
    //*    (default is 256).                                              *
    //*                                                                   *
    //* 6) If hlq.SCSFMOD0 is not in LINKLIST, provide in variable HLQ    *
    //*    the high level qualifier used during the installation of ICSF. *
    //*                                                                   *
    //* Note(s):                                                          *
    //*                                                                   *
    //* 1. THE USER ID THAT RUNS THIS JOB MUST HAVE SUFFICIENT ICSF       *
    //*    AUTHORITY.                                                     *
    //*                                                                   *
    //* 2. KEYTYPE=SECURE requires that the Crypto Express Coprocessor    *
    //*    is in EP11 mode.                                               *
    //*                                                                   *
    //* 3. For security, the KEYSIZE value should be at least half of     *
    //*    the size of the hash used by the signing algorithm defined     *
    //*    during the security setup. For example. if SIGALG(HS512) was   *
    //*    used during security setup, KEYSIZE should be at least 256.    *
    //*    See IDTPARMS SIGALG keyword in RACF PKCS#11 definition.        *
    //*                                                                   *
    //* 4. This job should complete with a return code 0.                 *
    //*                                                                   *
    //*********************************************************************
    //         EXPORT SYMLIST=*
    //*
    //         SET BASE='/usr/lpp/IBM/debug'
    //         SET TOKEN=JWTTOK.EQAAPPL
    //         SET KEYTYPE=CLEAR
    //         SET KEYSIZE=256
    //         SET HLQ=CSF
    //*
    //USS      EXEC PGM=BPXBATCH,REGION=0M,TIME=NOLIMIT
    //STDPARM  DD *,SYMBOLS=JCLONLY
    SH &BASE./bin/eqa.csfpgsk.rex
    -NAME=&TOKEN
    -SIZE=&KEYSIZE
    -TYPE=&KEYTYPE
    -DEBUG
    //STDENV   DD *,SYMBOLS=JCLONLY
    STEPLIB=&HLQ..SCSFMOD0
    //STDOUT   DD SYSOUT=*
    //STDERR   DD SYSOUT=*
    //*
    
  5. Verificare le impostazioni di sicurezza:
    • RLIST APPL EQAAPPL
    • RLIST CRYPTOZ SO.JWTTOK.EQAAPPL ALL
    • RLIST CRYPTOZ CLEARKEY.JWTTOK.EQAAPPL ALL
    • RACDCERT LISTTOKEN(JWTTOK.EQAAPPL)
    • RLIST IDTDATA JWT.EQAAPPL.*.SAF ALL IDTPARMS