Source Code Scanners for Better Code
Coding is tough enough, and coding right can sometimes seem an almost impossible task. Between design constraints, deadlines and making it work in the first place, it's difficult to get your code secure. Security concerns, however, can be helped by scanners.
Source code scanners are nothing new. Tools like lint have been around for many, many years to help you find errors in your C code. There are even lint checkers for DNS and HTML files, nslint and weblint, respectively. The lint tool doesn't explicitly talk about insecure code, though, only basic inconsistencies in your style.
Source code audits are also great things, things like the Linux Auditing Project. However, audits can take a lot of time and money if you outsource them, though the payback is well worth the investment. Source code scanners used available for only commercial software, prohibiting their use by many Linux developers and researchers, who didn't always place user friendliness high on their lists of goals.
A couple of years ago, pscan was released under the GPL. It's a simple format string scanner but one of the first such tools commonly available on the hobbyist developer market. Since then, three new source code scanners have become available for source available software, and all three are worth looking at. Not all of them are open source, but they do work well for most users coding in C or C++.
The resources listed at the end of this article are worth checking out. The Open Source Quality Project has links to several sites, including commercial products and academic research groups, involved in performing software quality testing. Some of these tools can do more rigorous testing but can be far less user-friendly.
Developed by the noted author and coder David Wheeler, Flawfinder is a Python program that can be used to assist auditing C and C++ code. It's in the early stages, currently at version 0.19, but already it's strong competition for the other tools listed here in the 1.x stages. Flawfinder is also quite fast, covering thousands of lines of C code on a typical desktop machine in a matter of seconds. Flawfinder is released under GPL version 2, meaning it is free software.
Flawfinder also shows some intelligence when it comes to scanning for vulnerabilities. For example, in tests using intentionally insecure code, Flawfinder was able to distinguish between strcpy() from a constant sized string and variable length strings and tell the difference between vulnerabilities and false hits. Furthermore, Flawfinder understands the gettext libraries and their use in internationalization.
RATS, the Rough Auditing Tool for Security, is a source code scanner under active development that is capable of scanning C, C++, Perl, PHP and Python source code. Also released under the GPL, some of the RATS developers also worked on a similar tool, ITS4 (discussed below). The current version, 1.3, is noticeably more stable than version 1.2, but it still can fail on large amounts of input.
RATS is configurable when the source code is modified (through lexical analysis), with error messages controlled by XML reporting filters, which requires the XML tool expat to also be installed. At runtime, you can configure the level of output you wish to see (defaulting to medium), alternative vulnerability databases and even report functions that accept input from the user, facilitating the tracking of user supplied data.
Some of the specific limitations of RATS include the use of greedy pattern matchings, meaning that tracking for "printf" will match not only "print()" calls but also "vsnprintf()" and the like. This can make it difficult to filter hits from noise when specific functions are being sought with the -a flag.
The authors of RATS and Flawfinder, by the way, plan to coordinate their development efforts to produce a high quality, open-source development tool. This should be good to watch, as each development team is well respected in the field.
One of the original source available scanners for Linux and UN*X, It's the Software Stupid Source Scanner (ITS4), scans C and C++ source for common security-related flaws. Developed by Cigital (then known as RST Technologies) and some of the same people who went on to develop RATS, ITS4 has set the pace. Many of the niceties in ITS4 are also available in RATS or Flawfinder, such as ignorable lines, tracking user input (the -m flag) and alternative databases.
Modification of a particular project or site is relatively straightforward. A simple text file of vulnerabilities is used, which can be added to or modified to suit any specifics of a system. It should be noted that ITS4 comes with a non-free license, even though the source is available. Users should read and understand the license if they are doing anything beyond hobbyist programming with it.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Stunnel Security for Oracle
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- SUSE LLC's SUSE Manager
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
- SourceClear Open
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide