Live data from Hacker News

The CERT C Secure Coding Standard

securecoding.cert.org

11–20 of 32 posts

Re: The CERT C Secure Coding Standard

#12
post #6

I'm well aware this is full-on "middlebrow dismissal", but still, I feel that in 2015 this standard isn't complete without a chapter saying just don't. somewhere. I understand why a standard like this is necessary, but really it's like a CERT Safe Highway Cycling Standard or a CERT Healthy Smoking Standard. If security is an important enough goal to want to apply this entire standard in detail, maybe there are better…

Two use cases where C is often the only choice are OSes and micro-controllers.

Re: The CERT C Secure Coding Standard

#13
post #4

Actually it's hard to obey them all. And C makes it so easy to create pitfalls. Is there a language specially designed for secure programming?

The likes of Modula-2 (1978), Ada (1983), Modula-2+(1985), Modula-3 (1986), Oberon (1986).

The problem is that they were tied to OS that weren't successful in the mainstream, whereas some American startups using the original BSD code and AT&T licenses, got very successful and brought UNIX into the enterprise.

C came along of course.

Re: The CERT C Secure Coding Standard

#14
post #3

Can C code be linted according to those rules? I wonder if that kind of coding standards can be part of ISO standards.

Yes, but it is above all a culture problem.

Many developers think that they don't need static analyzers.

Actually lint was part of the original UNIX, but since it took some effort to configure and not everyone agreed with the rules, it was seldom ported to other systems, and it became part of the C culture not to use it.

I think we have to thank the LLVM project that now static analyzers are welcome in C.

Re: The CERT C Secure Coding Standard

#15
post #6

I'm well aware this is full-on "middlebrow dismissal", but still, I feel that in 2015 this standard isn't complete without a chapter saying just don't. somewhere. I understand why a standard like this is necessary, but really it's like a CERT Safe Highway Cycling Standard or a CERT Healthy Smoking Standard. If security is an important enough goal to want to apply this entire standard in detail, maybe there are better…

Two use cases where C is often the only choice are OSes and micro-controllers.

There are alternatives, depending on the the processor/controller capabilities.

http://www.mikroe.com/mikropascal/

http://www.mikroe.com/mikrobasic/

http://turbo51.com/

For more beefy systems,

http://www.astrobe.com/default.htm

http://www.is2t.com/products/

http://www.atego.com/products/atego-perc-pico/

Re: The CERT C Secure Coding Standard

#17
post #6

I'm well aware this is full-on "middlebrow dismissal", but still, I feel that in 2015 this standard isn't complete without a chapter saying just don't. somewhere. I understand why a standard like this is necessary, but really it's like a CERT Safe Highway Cycling Standard or a CERT Healthy Smoking Standard. If security is an important enough goal to want to apply this entire standard in detail, maybe there are better…

Some people like programming in C.

Re: The CERT C Secure Coding Standard

#18
post #6

I'm well aware this is full-on "middlebrow dismissal", but still, I feel that in 2015 this standard isn't complete without a chapter saying just don't. somewhere. I understand why a standard like this is necessary, but really it's like a CERT Safe Highway Cycling Standard or a CERT Healthy Smoking Standard. If security is an important enough goal to want to apply this entire standard in detail, maybe there are better…

You are missing the point. C is only for system programming which is insecure by definition.

Re: The CERT C Secure Coding Standard

#19
post #3

Can C code be linted according to those rules? I wonder if that kind of coding standards can be part of ISO standards.

It can, and it is. One of the outcomes of the CERT C secure coding standard was the publication of TS 17961, which is an ISO document on C analyzability, which also went hand in hand with the Annex L (normative) section of the C standard.

Basically, the CERT rules all must be analyzable (though some require dynamic analysis instead of static analysis).

Re: The CERT C Secure Coding Standard

#20
post #3

Can C code be linted according to those rules? I wonder if that kind of coding standards can be part of ISO standards.

We did actually produce ISO/IEC TS 17961:2013 Information technology -- Programming languages, their environments and system software interfaces -- C secure coding rules http://www.iso.org/iso/catalogue_detail.htm?csnumber=61134

The rules specified in this Technical Specification apply to analyzers, including static analysis tools and C language compiler vendors that wish to diagnose insecure code beyond the requirements of the language standard. All rules are meant to be enforceable by static analysis.

I wrote an article putting all this in some context at: http://www.informit.com/articles/article.aspx?p=2088511

Post reply on HN