Spend Management Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
danielgonzalez1
Explorer
749

More than once you need download the Ariba audit logs to make more analysis but you find that is not going to be easy because there is a key requested.

You find the help sap site explaning about it but it's no easy make all the described steps, here I will explain with details and step by step this process.

The steps to obtain the audit reports are the following:

  1. Download and install the Git program, only we need the Git Bash app but I recommend you install all by default (SAP recommends use Cygwin but Git works also). This program is neccesary to create the keys and decrypt the logs we need to export.danielgonzalez1_2-1734386323406.png

     

  2. Open the Git Bash program to create your private key and input the following command: openssl genrsa -out myPrivateKey.pem 2048.danielgonzalez1_5-1734387873742.png

     

  3.  Now you need to create your public key typing this command: 
    openssl rsa -in myPrivateKey.pem -pubout -out myPublicKey.pem.
    danielgonzalez1_6-1734388507755.png
  4. Open a file explorer window and find the folder in the path C:\Users\<<name of your user>> to check the 2 pem files were created.danielgonzalez1_7-1734389155584.png

    or type ls -l *.pem in the Git Bash console to check the existance of the files 

    danielgonzalez1_9-1734389801265.png

     

  5.  Login to Ariba and access to Intelligent Configuration Manager to generate the audit report. Depending the solution you have the access is diferent this site explains how to access and generate in detail.
  6. Using your favorite text editor, open the myPublicKey.pem file and copy all the content.
  7. Paste the content in the Public key box, make sure there are no empty spaces at the beginning and end of the Pulbic key box.danielgonzalez1_0-1734467641455.png

     

  8. Click in Generate report buttom, if all was made right the report is being generated until complete status and with download link in action colum, otherwise review the previous steps and generate new public and private keys if is necessary.danielgonzalez1_0-1734535557989.png

     

  9. Click in download link, a new window appears and click in download icon now the report zip encrypted is in your download folder.danielgonzalez1_1-1734536102396.png

     

  10. This zip file must have 3 files contained in it:
    • Key
    • IV
    • aes file
  11. Move this zip file to your user folder C:\Users\<<name of your user>> (were your pem files were created).
  12. Now you need decrypt the aes file using your private key file, IV file and Key file. For this you can use the code sample here from Help SAP site and continue to the step 16 or you can use my method that I will explain in the next step.
  13. Unzip the zip file in the same folder C:\Users\<<name of your user>> and don't delete the zip file.
  14. Using your favorite text editor paste this bash code:
    #!/bin/bash
    # Parameters
    PRIVATEKEY="myPrivateKey.pem"
    ZIPFILE="zip file you downloaded from Ariba Intelligent Configuration Manager"
    ENCSUFFIX=".aes"
    echo $ZIPFILE
    # Decrypt the Key and IV
    IV=$(openssl pkeyutl -decrypt -inkey myPrivateKey.pem -in IV)
    KEY=$(openssl pkeyutl -decrypt -inkey myPrivateKey.pem -in Key)
    # Look in the ZIP for files ending in .aes
    # This is the convention used to identify encrypted files
    FILELIST=$(unzip -Z1 "$ZIPFILE" | grep $ENCSUFFIX)
    #echo $FILELIST
    echo $KEY
    echo $IV
    # Decrypt the files that were found
    # Remove the .aes extension from the saved file
    for ENCFILE in $FILELIST
    do
    DECFILE=${ENCFILE%$ENCSUFFIX}
    echo $DECFILE
    echo $ENCFILE
    echo "Decrypting File: $ENCFILE --> $DECFILE"
    openssl enc -aes-256-cbc -d -K $KEY -iv $IV -in $FILELIST -out "$DECFILE"
    done
  15. Only modify the ZIPFILE parameter and add your zip file name like this.danielgonzalez1_2-1734471601891.png

     

  16. Save the file as decrypt.sh in your user folder C:\Users\<<name of your user>>, or use any name you want but make sure save it with .sh extension.
  17. Open again the Git Bash console and run the script: ./decrypt.sh danielgonzalez1_3-1734471964772.png

     

  18. If everything was right you notice the existence of new zip file with the same name as aes file.
  19. Open or unzip this zip file and finally you will be able to open the excel audit report. 

Some considerations you may take are:

  • It's no neccesary create the pem files everytime you need generate the report.
  • Delete or overwrite the IV and Key file when you need decrypt the a new report.

And that's it, I hope it help you. 😉

This Article is complementary to SAP Help articles; Generating Audit Reports and Decrypting Audit Reports.