Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Beispiel: Event-Service MSGTAC

Der MSGTAC-Event-Service NOHACK zählt die Anzahl der Fehlversuche in einem TLS. Wenn openUTM ein KDCSIGN akzeptiert (d.h. Meldung K008 oder K033), so wird dieser TLS wieder gelöscht.

Falls nach drei ungültigen KDCSIGN-Versuchen der 4. KDCSIGN-Versuch wieder fehlerhaft ist, so soll das entsprechende Terminal automatisch diskonnektiert werden, und zwar per FPUT-Aufruf mit KCRN="KDCPTRMA". Der Nachrichtenbereich enthält die Parameter des Administrationskommando KDCPTRMA, siehe auch openUTM-Handbuch „Anwendungen administrieren“:

PTERM=pterm,PRO=proname,ACT=DIS

Die K-Meldungen werden jeweils mit FGET vom MSGTAC-Teilprogramm gelesen. Nach der "Verarbeitung" einer K-Meldung wird mit FGET sofort die nächste K-Meldung gelesen, innerhalb desselben Teilprogrammlaufs.

Event-Service MSGTAC
#include <stdio.h>
#include <kcmac.h>
#include <kcmsg.h>
#define _K008 (memcmp (NR, "K008", 4) == 0)
#define _K033 (memcmp (NR, "K033", 4) == 0)
/* K008: KDCSIGN accepted                                                */
/* K033: Start-Format                                                    */
#define MESSAGE_OK (_K008 || _K033)
#define _K004 (memcmp (NR, "K004", 4) == 0)
#define _K006 (memcmp (NR, "K006", 4) == 0)
#define _K031 (memcmp (NR, "K031", 4) == 0)
/* K004: Invalid Identification                                          */
/* K006: Invalid password                                                */
/* K031: Card not ok                                                     */
#define OTHER_MESSAGE !(_K004 || _K006 || _K008 || _K031 || _K033)
#define HACK_MAX 3
#define PTERM " PTERM="
#define PRONAM ",PRONAM="
#define DIS ",ACTION=DIS"
#define OFF ",STATUS=OFF"
#define kcrc_ca->ca return.kcrccc
#define pa spab->param
#define NR spab->ma.kcmsgs.msghdr.MSGNR
#define MSG spab->ma.kcmsgs.msg
#define LTERM spab->ma.lterm
#define hacknr spab->hack_nr
#define admin spab->ma.adm

  struct adm_line
      { char pterm_t[6];
        char pterm[8];
        char pronam_t[8];
        char pronam[8];
        char dis_t[11];
        char off_t[11];
      };
  struct ca_area
    { struct ca_hdr ca_head;
      struct ca_rti ca_return;
    };
  struct work
    { struct kc_pa param;
      short hack_nr;
      struct msg_area
         { char lterm[8];
           struct adm_line adm;
           struct KCMSGS kcmsgs;
         } ma;
      char  buffer[100];
    };
static void set_lterm( struct work * );
static void set_pterm( struct work * );
void NOHACK (struct ca_area *ca, struct work *spab )
{
  int other_message = 0;
/* INIT-Operation                                                        */
KDCS_SET (&spab->param, &ca->ca_head, &ca->ca_return);
KDCS_INIT (0,512);
/*************************************************************************/
/* while-loop: reading and processing all messages                       */
/*************************************************************************/
  while (KCRCC == 0 )
   {
/* FGET-Operation: reading the message                                   */
   KDCS_FGET (&spab->ma.kcmsgs,132,KDCS_SPACES);
   if (KCRCC != 0 )
      break;
     if (OTHER_MESSAGE)
       { other_message = 1;
         break;
       }
     set_lterm ( spab );
/* read TLSB                                                         */
     KDCS_GTDA (&hacknr,2,"TLSB",LTERM);
     if (KCRCC != 0 )
        break;
       if ((hacknr < 0) || (hacknr > HACK_MAX))
          hacknr = 0;                       /* Initialize TLS              */
  /* If KDCSIGN is correct, initialize the TLS, if not, count the number   */
  /* of failed attempts. After the fourth invalid KDCSIGN disconnect the   */
  /* correspondending terminal.                                            */
       if ((hacknr < HACK_MAX) && MESSAGE_OK)
          hacknr = 0;                          /* Initialize TLS           */
       else                                    /* invalid KDCSIGN          */
         {
           if (hacknr < HACK_MAX)
              ++hacknr;
           else
             { memcpy (admin.pterm_t, PTERM, 7);
               memcpy (admin.pronam_t, PRONAM, 8);
               set_pterm ( spab );
  /* Disconnect the terminal by asynchronous administration                */
               memcpy (admin.dis_t, DIS, 11);
               memcpy (admin.off_t, OFF, 11);
     KDCS_FPUTNE (&admin,sizeof(struct adm_line),"KDCPTRMA",KDCS_SPACES,KCNODF)
;
     if (KCRCC != 0 )
        break;
               hacknr = 0;
  /* log on User logging                                                   */
     KDCS_LPUT (&admin,sizeof(struct adm_line));
     if (KCRCC != 0 )
        break;
             }
        }
  /* set up TLSB                                                       */
     KDCS_PTDA (&hacknr,2,"TLSB",LTERM);
     }
  /* ************************************************************************/
  /*                        End of while loop                               */
  /**************************************************************************/
   if ( KCRCC != 10  ||  other_message)
  /* other message or error in the while loop                              */
     {
  /* error line                                                            */
     sprintf(spab->buffer, "Error in program unit - conversation  %8.8s"\
                           ", TAC:  %8.8s  because %4.4s. RC= %3.3s " ,
                           ca->ca_head.kccv_tac , ca->ca_head.kcpr_tac ,
                           pa.kcop , KDCS_ERR  );
/* RSET-Operation                                                        */
     KDCS_RSET();
/* LPUT-Operation: log on user logging                                   */
     KDCS_LPUT( spab->buffer , strlen( spab->buffer ) );
   }
/* PEND FI-Operation                                                     */
 KDCS_PENDFI();
  }
/**************************************************************************/
/*                       function set_lterm ()                            */
/**************************************************************************/
void set_lterm ( struct work * spab )
  { if _K004
       { memcpy (LTERM,MSG.K004.LTRM, 8);
         return;
       }
    if _K006
       { memcpy (LTERM, MSG.K006.LTRM, 8);
         return;
       }
    if _K008
       { memcpy (LTERM, MSG.K008.LTRM, 8);
         return;
       }
    if _K031
       { memcpy (LTERM, MSG.K031.LTRM, 8);
         return;
       }
    if _K033
       { memcpy (LTERM, MSG.K033.LTRM, 8);
         return;
       }
   }
/**************************************************************************/
/*                       function set_pterm ()                            */
/**************************************************************************/
void set_pterm ( struct work *spab )
  { if _K004
       { memcpy (admin.pterm, MSG.K004.PTRM, 8);
         memcpy (admin.pronam, MSG.K004.PRNM, 8);
         return;
       }
    if _K006
       { memcpy (admin.pterm, MSG.K006.PTRM, 8);
         memcpy (admin.pronam, MSG.K006.PRNM, 8);
        return;
      }
   if _K031
      { memcpy (admin.pterm, MSG.K031.PTRM, 8);
        memcpy (admin.pronam, MSG.K031.PRNM, 8);
        return;
      }
}


Das obige Beispiel des MSGTAC-Event-Service zeigt lediglich die Möglichkeiten auf, wie Meldungen geeignet ausgewertet und die Anwendung administriert werden kann.

Zur Überwachung von Sicherheitsverletzungen sollte jedoch die K094-Meldung genutzt werden (SIGNON SILENT-ALARM), da hier auch UPIC- und OSI TP-Clients eingeschlossen sind. Außerdem kann die UTM-Anwendung umfassender über die programmierte Administration (ADMI-Schnittstelle) administriert werden.