Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

I want to write code audit tool... need help

Former Member
0 Likes
1,261

I want to write a simple source code audit tool, which can find errors. It is very important for me because I write master degree work. Please, help...

I want to write a simple source code audit tool, which can find errors. It is very important for me because I write master degree work. Please, help...

11 REPLIES 11
Read only

Former Member
0 Likes
1,232

You need to define the objectives of the tool more clearly. When you say, you want to audit the source code what exactly do you intend to do. Define the functionalities of the tool and then we can give you some ideas as to how go about the same.

Regards,

Ravi

Read only

0 Likes
1,232

Ravi, thanks for responding to the call!

The functionality of tool:

- parsing of code;

- checking for unsafe/error programming constructs, such as strcpy() or printf() in C, and/or declaring of objects without usage, etc;

- validating this constructs and generating errors or warnings;

It is very important for me, please help.

I'm waiting for your response...

Read only

0 Likes
1,232

When you write a program in ABAP and do a syntax check / generate the program it parses the code.

I would suggest you to look at SE30, Code Inspector (SCI) to see what functionality is already existing so that you can accordingly design your tool. Most of the functions you are asking for already built in SAP.

If you still want to do it

1. You can scan the program code, and figure out what commands you want to give a error / warning for. For this you will have to decide upon a list of commands for which you wnat to throw a error.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
1,232

Hello Artem

As I said already the code inspector does most of the coding checks you are looking for.

Regards

Uwe

Read only

0 Likes
1,232

Thanks Uwe

You must also understand that I'm a student, which is looking not for complete comercial solution of other developers such as SCI. But I want to create graduate work at the university - simple auditing tool, which may be checks one or two errors only... I spent a lot of time in reseaching different inspection methodologies and want to apply one of them. Also I understood that source code auditing for ABAP very important because of language fields of usage.

P.S. if you have time, please answer: what kind of error may be checked automatically?

Read only

0 Likes
1,232

Hello Artem

Even if the code inspector is a free and integral part of the ABAP workbench I believe you could write an interesting graduate work on this topic.

For example, you could analyze the various ABAP tools and feature to improve the quality of ABAP coding like

- code inspector (SCI)

- Coverage analyzer (SCOV)

- eCATT testing (SECATT)

- ABAP Unit Testing

- Checkpoint Groups & Assertions

However, you could also focus on possible shortcomings of the code inspector. For example, you write a report with as many coding errors (not syntax errors) as possible and see which of them are found by the code inspector and which not. A typical coding error would be a SELECT statment with option FOR ALL ENTRIES IN <itab> without checking if <itab> is not initial.

You could extend this work by finding out if and how the code inspector could be enhanced.

Hope I could give you some more insights.

Regards

Uwe

Read only

0 Likes
1,232

you could as well check for performance problems in joins:

Is an existing index used...

What is the restricting sequence in the from clause

What is the restricting sequence in the where clause

What does the DB access tree say...

Enjoy

Read only

0 Likes
1,232

I need to define more exactly my question. I need to check any part of source code written on ABAP for <b>security threats</b>. From my investigations I find only one example of such threat - not explicit or absence of usages of authority_check in new developed modules. Please? give me more examples and I try to investigate the direction, which you show.

Read only

0 Likes
1,232

Hello Artem

Other examples of security threats are:

(1) Are there hard-coded checks on SY-UNAME,e.g.:

   IF ( sy-uname = '<specific user name'> ).
*    execute functions others users are not allowed to to
   ENDIF.

  CHECK ( sy-uname = '<specific user name'> ).
*    execute functions others users are not allowed to to

(2) Are there hard-coded checks on sy-sysid, e.g.:

   IF ( sy-sysid = '<specific SAP system ID'> ).
*    execute functions not allowed on others SAP systems
   ENDIF.

  CHECK ( sy-sysid = '<specific SAP system ID'> ).
*    execute functions not allowed on others SAP systems

While the threat in case (1) is obvious I would be suspicious if functions are linked to certain SAP systems. However, please note that a smart (evil) developer will easily circumvent checks on such security threats.

Regards

Uwe

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,232

Hello Artem

The <i>code inspector</i> (transaction <b>SCI</b>) is already a quite powerful ABAP coding "audit" tool.

Regards

Uwe

Read only

SergioFerrari
Active Contributor
0 Likes
1,232

This message was moderated.