å®å šãªãœãããŠã§ã¢éçºã®ããã®éããã¹
ããã«ã¡ã¯ïŒãœãããŠã§ã¢éçºã®äžçãžããããïŒð ããã°ã©ãã³ã°ãããŠãããšããã»ãã¥ãªãã£ããšããèšèãããè³ã«ãããããããŸãããã å®å šã§ä¿¡é Œæ§ã®é«ããœãããŠã§ã¢ãäœãããšã¯ããšãŠãéèŠã§ããããã§ç»å Žããã®ããSEI CERT ã³ãŒãã£ã³ã°èŠçŽãïŒSEI CERT Coding StandardsïŒã§ãã
ãªãã ãé£ãããâŠãšæãããããããŸããããå¿é ãããŸããïŒãã®ããã°ã§ã¯ãSEI CERT ã³ãŒãã£ã³ã°èŠçŽãã©ããªãã®ãªã®ãããªã倧åãªã®ããåå¿è ã®æ¹ã«ãåããããã解説ããŸããð
ð€ SEI CERT ã³ãŒãã£ã³ã°èŠçŽã£ãŠããã£ããäœïŒ
SEI CERT ã³ãŒãã£ã³ã°èŠçŽã¯ããœãããŠã§ã¢ãããå®å šã«ãä¿¡é Œæ§ãé«ãããããŠã»ãã¥ã¢ïŒæ»æããã«ããïŒã«ããããã«äœããããããã°ã©ãã³ã°ã®ãäœæ³éïŒã«ãŒã«ããã¯ïŒã®ãããªãã®ã§ãã
ãã®èŠçŽã¯ãã¢ã¡ãªã«ã®ã«ãŒãã®ãŒã¡ãã³å€§åŠã«ãããCERT/CC (Coordination Center)ããšãããã³ã³ãã¥ãŒã¿ã»ãã¥ãªãã£ãå°éã«ç 究ããŠããçµç¹ã®äžéšéïŒSoftware Engineering Instituteãç¥ããŠSEIïŒãäžå¿ãšãªã£ãŠéçºããŠããŸããCERTã¯ããœãããŠã§ã¢éçºè ãã»ãã¥ãªãã£å°é家ã³ãã¥ããã£ã®ç¥èãéããŠããããã®èŠçŽãäœæã»æŽæ°ããŠããŸãã
ãããã®èŠçŽã¯ãç¹ã«ã»ãã¥ãªãã£äžã®ãè匱æ§ïŒãããããããïŒããã€ãŸããœãããŠã§ã¢ã®åŒ±ç¹ãæ¬ é¥ã«ã€ãªããããããå±éºãªæžãæ¹ããããã°ã©ã ãã©ãåããäºæž¬ã§ããªããæªå®çŸ©ã®åäœããé¿ããããã®å ·äœçãªã«ãŒã«ãæšå¥šäºé ãå®ããŠããŸãã
äŸãã°ã2003幎é ã«Cèšèªã®æšæºåå§å¡äŒãšã®è°è«ããCèšèªçã®èŠçŽã®ã¢ã€ãã¢ãçãŸãããã®åŸãC++çãJavaçãªã©ãéçºãããŠããŸããã
ð¯ äž»ãªç®çã¯ïŒ
- ð¡ïž å®å šæ§ (Safety): ãœãããŠã§ã¢ãäºæãã¬åäœããããæå³ããªãæ害ãäžããªãããã«ããããšã
- ð ã»ãã¥ãªã㣠(Security): æªæã®ããæ»æãäžæ£ã¢ã¯ã»ã¹ãããœãããŠã§ã¢ãå®ãããšã
- âïž ä¿¡é Œæ§ (Reliability): ãœãããŠã§ã¢ãæåŸ ãããéãã«ãå®å®ããŠåäœããããšã
ð ã©ããªèšèªã«å¯Ÿå¿ããŠããã®ïŒ
SEI CERT ã³ãŒãã£ã³ã°èŠçŽã¯ãåºã䜿ãããŠããããã€ãã®ããã°ã©ãã³ã°èšèªã«å¯Ÿå¿ããŠããŸãã
- Cèšèª
- C++èšèª
- Javaèšèª (Oracle)
- Perlèšèª
- Android OS åã
ããããã®èšèªã®ç¹æ§ã«åãããèŠçŽãçšæãããŠããŸããç¹ã«CèšèªãC++èšèªã¯ãã¡ã¢ãªç®¡çãªã©ã§æ³šæãå¿ èŠãªéšåãå€ããããèŠçŽã®éèŠæ§ãé«ããšèšãããŠããŸãã
ð èŠçŽã®æ§æïŒã«ãŒã«ãšæšå¥šäºé
èŠçŽã¯äž»ã«ãã«ãŒã« (Rule)ããšãæšå¥šäºé (Recommendation)ãã®2çš®é¡ã§æ§æãããŠããŸãã
- ã«ãŒã« (Rule): ããã¯ãå®ãã¹ã決ãŸãããšãã§ããéåãããšãã»ãã¥ãªãã£äžã®åé¡ãäºæãã¬åäœãåŒãèµ·ããå¯èœæ§ãé«ããšããããã®ã§ãã
- æšå¥šäºé (Recommendation): ããã¯ãåŸãããšãæãŸããã¢ããã€ã¹ãã§ããå¿ ãããå®ããªããã°ãªããªãããã§ã¯ãããŸããããåŸãããšã§ãœãããŠã§ã¢ã®å質ãå®å šæ§ãããã«åäžãããããšãã§ããŸãã
ããã«ãåã«ãŒã«ãæšå¥šäºé ã«ã¯ããªã¹ã¯è©äŸ¡ïŒæ·±å»åºŠãè匱æ§ãæªçšãããå¯èœæ§ãä¿®æ£ã³ã¹ãïŒã«åºã¥ããŠåªå 床ãä»ããããŠããããšããããŸã (L1: é«, L2: äž, L3: äœãªã©)ãããã«ãããã©ã®é ç®ãã察å¿ãã¹ããã®å€æææã«ãªããŸãã
èŠçŽã¯åéããšã«åé¡ãããŠããŸããäŸãã°CèšèªèŠçŽã§ã¯ã以äžã®ãããªã«ããŽãªããããŸãã
ã«ããŽãªç¥ç§° | ã«ããŽãªå (æ¥æ¬èªäŸ) | å 容ã®äŸ |
---|---|---|
PRE | ããªããã»ããµ | ãã¯ãã®å®å šãªäœ¿ãæ¹ãªã© |
DCL | 宣èšãšåæå | å€æ°ã®å®£èšãåæåã«é¢ãã泚æç¹ |
EXP | åŒ | æŒç®åã®åªå é äœãå¯äœçšã«é¢ãã泚æç¹ |
INT | æŽæ° | æŽæ°ãªãŒããŒãããŒãªã©ã®åé¡ |
ARR | é å | é åã®ç¯å²å€ã¢ã¯ã»ã¹ïŒãããã¡ãªãŒããŒãããŒïŒãªã© |
STR | æåãšæåå | æååæäœã«é¢ãã泚æç¹ |
MEM | ã¡ã¢ãªç®¡ç | ã¡ã¢ãªè§£æŸå¿ãïŒã¡ã¢ãªãªãŒã¯ïŒã解æŸæžã¿ã¡ã¢ãªãžã®ã¢ã¯ã»ã¹ãªã© |
FIO | å ¥åºå | ãã¡ã€ã«æäœãæšæºå ¥åºåã®å®å šãªäœ¿ãæ¹ |
ERR | ãšã©ãŒåŠç | ãšã©ãŒçºçæã®é©åãªå¯Ÿå¿ |
CON | 䞊è¡æ§ | è€æ°åŠçãåæã«åããéã®æ³šæç¹ |
ð¡ å ·äœçãªã«ãŒã«äŸïŒãããã¡ãªãŒããŒãããŒãé²ã (Cèšèª)
ããããããã«ãŒã«ã®äžããã代衚çãªãã®ãäžã€èŠãŠã¿ãŸããããCèšèªã§ããåé¡ã«ãªãããããã¡ãªãŒããŒãããŒãã«é¢ããã«ãŒã«ã§ãã
ãããã¡ãªãŒããŒãããŒãšã¯ãçšæãããã¡ã¢ãªé åïŒãããã¡ïŒããã倧ããªããŒã¿ãæžã蟌ãŸããŠããŸããã¡ã¢ãªãããµããŠããŸãçŸè±¡ã§ãããããèµ·ãããšãããã°ã©ã ãç°åžžçµäºããããææªã®å Žåãæ»æè ã«ããã°ã©ã ãä¹ã£åããããããå¯èœæ§ããããŸããð±
ãã®ããã«ãSEI CERT ã³ãŒãã£ã³ã°èŠçŽã¯ãå±éºãªã³ãŒãã®æžãæ¹ãå ·äœçã«ç€ºããããå®å šãªä»£æ¿æ段ãæããŠãããŸãã
ð SEI CERT ã³ãŒãã£ã³ã°èŠçŽã䜿ãã¡ãªãã
- ð ãã°ãè匱æ§ã®åæž: å±éºãªã³ãŒãã£ã³ã°ãã¿ãŒã³ãé¿ããããšã§ããœãããŠã§ã¢ã®æ¬ é¥ãæžãããŸãã
- ð ã»ãã¥ãªãã£ã®åäž: æ»æè ãæªçšã§ãã匱ç¹ãæžãããããå®å šãªãœãããŠã§ã¢ã«ãªããŸãã
- ð ä¿¡é Œæ§ãšå®å®æ§ã®åäž: äºæãã¬åäœãã¯ã©ãã·ã¥ãæžããå®å®ããŠåãããã«ãªããŸãã
- ð§ ä¿å®æ§ã®åäž: ã«ãŒã«ã«åŸã£ãã³ãŒãã¯ãä»ã®äººãèªãã ãä¿®æ£ããããããããªããŸãã
- ð€ ããŒã éçºã®åæ»å: ããŒã å ã§å ±éã®ã«ãŒã«ãæã€ããšã§ãã³ãŒãã®å質ãåäžã«ä¿ã¡ããããªããŸãã
ãŸãšã
SEI CERT ã³ãŒãã£ã³ã°èŠçŽã¯ãå®å šã§ä¿¡é Œæ§ã®é«ããœãããŠã§ã¢ãäœãããã®ããšãŠã圹ç«ã€ã¬ã€ãã©ã€ã³ã§ããæåã¯é£ããæãããããããŸããããäžã€äžã€ã®ã«ãŒã«ã«ã¯ããœãããŠã§ã¢ãè¯ãããããã®çç±ããããŸãã
ãã¹ãŠã®ã«ãŒã«ãããã«å®ç§ã«èŠããå¿ èŠã¯ãããŸããããŸãã¯ããã®ãããªèŠçŽãããããšãç¥ãããªããããå¿ èŠãªã®ããç解ãããšããããå§ããŸãããããããŠãå°ããã€éçºã«åãå ¥ããŠããããšã§ãããªãã®æžãã³ãŒãã¯ããå®å šã§ãé«å質ãªãã®ã«ãªã£ãŠããã¯ãã§ããðª
å®å šãªã³ãŒãã£ã³ã°ã®äžçãæ¢æ±ããæ ã楜ããã§ãã ãããïŒð
ã³ã¡ã³ã