Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [zos_job_submit] JCL submitted that results in a security exception returns no job log. #684

Closed
2 tasks done
ddimatos opened this issue Mar 24, 2023 · 1 comment
Closed
2 tasks done
Assignees
Labels
Bug Something isn't working as designed.

Comments

@ddimatos
Copy link
Collaborator

Is there an existing issue for this?

  • There are no existing issues.

Are the dependencies a supported version?

  • The dependencies are supported.

IBM Z Open Automation Utilities

v1.2.2

IBM Enterprise Python

v3.11.x

IBM z/OS Ansible core Version

v1.5.0

ansible-version

latest

z/OS version

v2.5

Ansible module

zos_job_submit

Bug description

When submitting JCL that will through a security exception it will yield a response that is slightly incorrect but more importantly it could have returned the JCL with should have 1 DD in it.

I was given this in the response:

{
   "changed":false,
   "checksum":"2c575222b83b7a9f9e8f4f83c80e0056f13471c4",
   "dest":"/tmp/ansible.qvsmz1je",
   "duration":10,
   "gid":1,
   "group":"OMVSGRP",
   "jobs":[
      {
         "class":"",
         "content_type":"",
         "ddnames":[
            {
               "byte_count":"0",
               "ddname":"unavailable",
               "id":"",
               "procstep":"",
               "record_count":"0",
               "stepname":null
            }
         ],
         "job_id":"JOB00526",
         "job_name":"*",
         "owner":"*",
         "ret_code":{
            "code":null,
            "msg":null,
            "msg_code":null,
            "msg_txt":"The job could not be found."
         },
         "subsystem":null,
         "system":null
      }
   ],
   "md5sum":"c6b211bcead28fcfddad15ab3cdc4b93",
   "mode":"0600",
   "msg":"The JCL submitted with job id JOB00526 but appears to be a long running job that exceeded its maximum wait time of 10 second(s). Consider using module zos_job_query to poll for a long running job or increase option 'wait_times_s` to a value greater than 10.",
   "owner":"OBAGAOI",
   "size":1011,
   "src":"/.ansible/tmp/ansible-tmp-1679633673.2033558-19624-74872113450596/source",
   "state":"file",
   "uid":0
}

sec error

JCL which just has an invalid user FOOBAR

//HELLO    JOB (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',
//             MSGCLASS=X,MSGLEVEL=1,NOTIFY=&SYSUID,USER=FOOBAR
//STEP0001 EXEC PGM=IEBGENER
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD *
HELLO, WORLD
/*
//SYSUT2   DD SYSOUT=*
//

Playbook verbosity output.

No response

Ansible configuration.

No response

Contents of the inventory

No response

Contents of group_vars or host_vars

No response

@ddimatos ddimatos added the Bug Something isn't working as designed. label Mar 24, 2023
@ddimatos ddimatos moved this from 📗In plan to 🏗 In progress in IBM Ansible z/OS Core Collection Mar 24, 2023
@ddimatos ddimatos moved this from 🏗 In progress to 🔍 Validation in IBM Ansible z/OS Core Collection Mar 24, 2023
@ddimatos
Copy link
Collaborator Author

Updates now yield the job log and the correct context:

{
   "changed":false,
   "checksum":"2c575222b83b7a9f9e8f4f83c80e0056f13471c4",
   "dest":"/tmp/ansible.wt4m5bmq",
   "duration":0,
   "gid":1,
   "group":"OMVSGRP",
   "jobs":[
      {
         "class":"",
         "content_type":"",
         "ddnames":[
            {
               "byte_count":"133",
               "content":[
                  "1                       J E S 2  J O B  L O G  --  S Y S T E M  S T L 1  --  N O D E  S T L 1",
                  "0     ",
                  " 23.32.05 JOB00464 ---- THURSDAY,  23 MAR 2023 ----",
                  " 23.32.05 JOB00464  ICH408I USER(FOOBAR  ) GROUP(        ) NAME(???                 )",
                  "                      LOGON/JOB INITIATION - USER AT TERMINAL  23.32.05 JOB00464  IRR012I  VERIFICATION FAILED. USER PROFILE NOT FOUND.",
                  "-$HASP106 JOB DELETED BY JES2 OR CANCELLED BY OPERATOR BEFORE EXECUTION",
                  "0------ JES2 JOB STATISTICS ------",
                  "0           16 CARDS READ",
                  "0           13 SYSOUT PRINT RECORDS",
                  "0            0 SYSOUT PUNCH RECORDS",
                  "0            0 SYSOUT SPOOL KBYTES",
                  "0         0.00 MINUTES EXECUTION TIME"
               ],
               "ddname":"JESMSGLG",
               "id":"2",
               "proctep":null,
               "record_count":"13",
               "stepname":"JES2"
            }
         ],
         "duration":0,
         "job_id":"JOB00464",
         "job_name":"HELLO",
         "owner":"FOOBAR",
         "ret_code":{
            "code":null,
            "msg":"SEC ?",
            "msg_code":"?",
            "msg_text":"SEC",
            "steps":[
               
            ]
         },
         "subsystem":"STL1",
         "system":"STL1"
      }
   ],
   "md5sum":"c6b211bcead28fcfddad15ab3cdc4b93",
   "mode":"0600",
   "msg":"The JCL submitted with job id JOB00464 but there was an error, please review the error for further details: The job return code was not available in the job log, please review the job log and error SEC ?.",
   "owner":"BPXROOT",
   "size":1011,
   "src":"/.ansible/tmp/ansible-tmp-1679639517.612864-27377-254004227704731/source",
   "state":"file",
   "uid":0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as designed.
Projects
Development

No branches or pull requests

2 participants