Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34047 - request for RATS ebuild
Summary: request for RATS ebuild
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: The Gentoo Linux Hardened Team
URL: http://www.securesoftware.com/rats/
Whiteboard:
Keywords:
Depends on:
Blocks: 6009 17872
  Show dependency tree
 
Reported: 2003-11-21 11:43 UTC by Nilanjan De
Modified: 2004-02-13 00:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
rats-2.1.ebuild (rats-2.1.ebuild,654 bytes, text/plain)
2003-12-25 12:34 UTC, solar (RETIRED)
Details
rats-2.1.ebuild (rats-2.1.ebuild,798 bytes, text/plain)
2003-12-25 13:13 UTC, solar (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nilanjan De 2003-11-21 11:43:14 UTC
could RATS( Rough Auditing Tool for Security) be added to the gentoo portage tree.

http://www.securesoftware.com/rats/



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2003-11-22 00:57:21 UTC
this something you guys are interested in?
Comment 2 Nilanjan De 2003-11-22 12:23:33 UTC
Well Debian has a .deb for it, i would love to see it in Gentoo portage also.
Comment 3 solar (RETIRED) gentoo-dev 2003-12-10 14:00:58 UTC
Seems you/we must fill out an online form in order to download the RATS 
evaluation version. I don't know what legal ramifications it would have
if we bypassed this step.  

Reporter please research what license RATS is released under and if file
mirroring is allowed.
Comment 4 Nilanjan De 2003-12-16 23:44:43 UTC
RATS is distributed under the GNU GENERAL PUBLIC LICENSE version 2.

http://www.securesoftware.com/distributing.htm
Comment 5 solar (RETIRED) gentoo-dev 2003-12-25 12:32:09 UTC
So here is what I'm thinking about source scanning.
We can take RATS, flawfiner, and perhaps splint and add support to portage for when these are installed and found in the FEATURES for example we have FEATURES="rats" set then we scan the src code in $S right before the src_compile is called from ebuild.sh
example for flawfinder
http://dev.gentoo.org/~solar/portage_misc/feature.flawfinder
I'll add rats and see if I can do the same for it.
Comment 6 solar (RETIRED) gentoo-dev 2003-12-25 12:34:00 UTC
Created attachment 22661 [details]
rats-2.1.ebuild

Please test rats ebuild.
Comment 7 solar (RETIRED) gentoo-dev 2003-12-25 13:13:34 UTC
Created attachment 22662 [details]
rats-2.1.ebuild

This install cleaner.

solar@simple rats $ epm -q -l rats
/usr/bin/rats
/usr/share/man/man1/rats.1.gz
/usr/share/doc/rats-2.1/README.gz
/usr/share/doc/rats-2.1/COPYING.gz
/usr/share/doc/rats-2.1/README.win32.gz
/usr/share/rats/rats-c.xml
/usr/share/rats/rats-openssl.xml
/usr/share/rats/rats-perl.xml
/usr/share/rats/rats-php.xml
/usr/share/rats/rats-python.xml
Comment 8 solar (RETIRED) gentoo-dev 2003-12-25 13:14:06 UTC
And matching ebuild.sh to have rats scan cource files.

if [ "$PWD" = "${S}" -a "`has rats ${FEATURES}`" != "" -a -x /usr/bin/rats ]; then
        s_files="`find ${S} -name '*.c' -o -name '*.cpp' -o -name '*.php' -o -name '*.pl'`"
        flaws=""
        if [ -n "$s_files" ]; then
                s_count=`echo ${files} | tr ' ' '\n' | wc -l | awk '{print $1}'`
                einfo "Running rats on [$s_count] files"
                [ -z "${FEATURE_RATS_WARNLEVEL}" ] && export FEATURE_RATS_WARNLEVEL=3
                flaws=$(/usr/bin/rats --quiet --resultsonly --warning ${FEATURE_RATS_WARNLEVEL} ${s_files})
                if [ -n "$flaws" ]; then
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        ewarn "rats report for ${PN}"
                        echo "------------------------------------------------------------------------"
                        echo -e "${flaws}"
                        echo "------------------------------------------------------------------------"
                        i=5
                        while [ $i != 0 ]; do
                                echo -ne ".\a"
                                sleep 0.25
                                i=$(($i - 1))
                        done
                        has interactive ${FEATURES} &&
                                read -p "- Press Enter To Continue or CTRL+C to abort"
                fi
        fi
fi
Comment 9 solar (RETIRED) gentoo-dev 2003-12-25 13:18:20 UTC
If you want to add this to portage please test it like this.
edit your ebuild.sh look for a line like this.
-------------------------------------------
        #some packages use an alternative to $S to build in, cause
        #our libtool to create problematic .la files
        export PWORKDIR="$WORKDIR"
        src_compile
-------------------------------------------
Right before the src_compile add a src_pre_compile
then inside of src_pre_compile()  { # add the above code or the flawfinder code or both }

For example min looks like.

src_pre_compile() {

if [ "$PWD" = "${S}" -a "`has rats ${FEATURES}`" != "" -a -x /usr/bin/rats ]; then
        s_files="`find ${S} -name '*.c' -o -name '*.cpp' -o -name '*.php' -o -name '*.pl'`"
        flaws=""
        if [ -n "$s_files" ]; then
                s_count=`echo ${files} | tr ' ' '\n' | wc -l | awk '{print $1}'`
                einfo "Running rats on [$s_count] files"
                [ -z "${FEATURE_RATS_WARNLEVEL}" ] && export FEATURE_RATS_WARNLEVEL=3
                flaws=$(/usr/bin/rats --quiet --resultsonly --warning ${FEATURE_RATS_WARNLEVEL} ${s_files})
                if [ -n "$flaws" ]; then
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        ewarn "rats report for ${PN}"
                        echo "------------------------------------------------------------------------"
                        echo -e "${flaws}"
                        echo "------------------------------------------------------------------------"
                        i=5
                        while [ $i != 0 ]; do
                                echo -ne ".\a"  
                                sleep 0.25
                                i=$(($i - 1))
                        done
                        has interactive ${FEATURES} &&
                                read -p "- Press Enter To Continue or CTRL+C to abort"
                fi
        fi
fi

if [ "$PWD" = "${S}" -a "`has flawfinder ${FEATURES}`" != "" -a -x /usr/bin/flawfinder ]; then
        c_files="`find ${S} -name '*.c' -o -name '*.cpp'`"
        flaws=""
        if [ -n "$c_files" ]; then
                c_count=`echo ${c_files} | tr ' ' '\n' | wc -l | awk '{print $1}'`
                einfo "Running flawfinder on [$c_count] files"
                [ -z "${FEATURE_FLAWFINDER_MINLEVEL}" ] && export FEATURE_FLAWFINDER_MINLEVEL=5
                debug-print "flawfinder --quiet --dataonly --minlevel=${FEATURE_FLAWFINDER_MINLEVEL} ${c_files}"
                flaws=$(flawfinder --quiet --dataonly --minlevel=${FEATURE_FLAWFINDER_MINLEVEL} ${c_files})
                if [ -n "$flaws" ]; then
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null
                        ewarn "flawfinder report for ${PN}"
                        echo "------------------------------------------------------------------------"
                        echo -e "${flaws}"
                        echo "------------------------------------------------------------------------"
                        i=5
                        while [ $i != 0 ]; do
                                echo -ne ".\a"
                                sleep 0.25
                                i=$(($i - 1))
                        done
                        has interactive ${FEATURES} &&
                                read -p "- Press Enter To Continue or CTRL+C to abort"
                fi
        fi
fi

}

Comment 10 solar (RETIRED) gentoo-dev 2004-01-27 17:39:26 UTC
No feedback so "rats" must not be all that usefull to anybody.

Perparing to close bug or bounce to another herd.
Comment 11 solar (RETIRED) gentoo-dev 2004-02-13 00:23:32 UTC
changing resolution to LATER