home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 26: Security / pc_actual_seguridad.iso / Scanner / SecureScanNX / data1.cab / upgrade_DB / upgrade / upgrade2_B3-CreateNewBase.sql < prev    next >
Encoding:
Text File  |  2001-11-16  |  16.1 KB  |  359 lines

  1. %% ============================================================
  2. %%   Database name:  MODEL_3                                   
  3. %%   DBMS name:      Sybase SQL Anywhere 5.5                   
  4. %%   Created on:     12/01/2001  19:11                         
  5. %% ============================================================
  6.  
  7. %% ============================================================
  8. %%   Table: INTERNAL_INDEX                                     
  9. %% ============================================================
  10. create table dba.INTERNAL_INDEX
  11. (
  12.     sessnu                   integer               not null,
  13.     pernu                    integer                       ,
  14.     polnu                    integer                       ,
  15.     jobnu                    integer                       ,
  16.     hostnu                   integer                       ,
  17.     probnu                   integer                       ,
  18.     wksnu                    integer                       ,
  19.     resnu                    integer                       ,
  20.     version                  integer                       ,
  21.     primary key (sessnu)
  22. );
  23.  
  24. %% ============================================================
  25. %%   Table: GLOSSARY                                           
  26. %% ============================================================
  27. create table dba.GLOSSARY
  28. (
  29.     Glo_id                   integer               not null
  30.         default autoincrement,
  31.     GlossaryName             char(100)                     ,
  32.     GlossaryDescription      char(32767)                   ,
  33.     Glo_sta                  integer                       
  34.         default 0,
  35.     Flag                     integer                       
  36.         default 0,
  37.     primary key (Glo_id)
  38. );
  39.  
  40. %% ============================================================
  41. %%   Index: glo                                                
  42. %% ============================================================
  43. create unique index glo on dba.GLOSSARY (Glo_id asc);
  44.  
  45. %% ============================================================
  46. %%   Table: PERIMETER                                          
  47. %% ============================================================
  48. create table dba.PERIMETER
  49. (
  50.     Per_id                   integer               not null,
  51.     PerimeterName            varchar(50)           not null,
  52.     PerimeterDescription     char(32767)           not null,
  53.     Predefined               smallint              not null,
  54.     primary key (Per_id)
  55. );
  56.  
  57. %% ============================================================
  58. %%   Table: POLICY                                             
  59. %% ============================================================
  60. create table dba.POLICY
  61. (
  62.     Pol_id                   integer               not null,
  63.     PolicyName               varchar(50)           not null,
  64.     PolicyDescription        long varchar          not null,
  65.     Predefined               smallint              not null,
  66.     primary key (Pol_id)
  67. );
  68.  
  69. %% ============================================================
  70. %%   Table: WKS                                                
  71. %% ============================================================
  72. create table dba.WKS
  73. (
  74.     Wks_id                   integer               not null,
  75.     Wks                      varchar(50)           not null,
  76.     Service                  varchar(50)           not null,
  77.     primary key (Wks_id)
  78. );
  79.  
  80. %% ============================================================
  81. %%   Table: REALIMPACT                                         
  82. %% ============================================================
  83. create table dba.REALIMPACT
  84. (
  85.     RealImpact_id            integer               not null,
  86.     RealImpact               char(255)                     ,
  87.     primary key (RealImpact_id)
  88. );
  89.  
  90. %% ============================================================
  91. %%   Table: PARAMETER                                          
  92. %% ============================================================
  93. create table dba.PARAMETER
  94. (
  95.     Obj_id                   integer               not null,
  96.     Par_id                   integer               not null,
  97.     ClsType_id               integer               not null,
  98.     ClsType                 char(50)                      ,
  99.     ParameterName            char(50)                      ,
  100.     ParameterDescription     char(32767)                   ,
  101.     Info                     char(100)                     ,
  102.     Type_id                  integer                       ,
  103.     Type                     char(255)                     ,
  104.     DfltValue                char(32767)                   ,
  105.     MinVal                   integer                       ,
  106.     MaxVal                   integer                       ,
  107.     Value                    char(32767)                   ,
  108.     primary key (Obj_id, Par_id, ClsType_id)
  109. );
  110.  
  111. %% ============================================================
  112. %%   Table: TCRESULT_INFO                                      
  113. %% ============================================================
  114. create table dba.TCRESULT_INFO
  115. (
  116.     Tcr_id                   integer               not null,
  117.     Ordre                    integer               not null,
  118.     Type                     integer                       ,
  119.     Value                    integer                       ,
  120.     Field                    char (255)                    ,
  121.     Text                     char(32767)                   ,
  122.     primary key (Tcr_id, Ordre)
  123. );
  124.  
  125. %% ============================================================
  126. %%   Table: SOLUTION                                           
  127. %% ============================================================
  128. create table dba.SOLUTION
  129. (
  130.     Acc_id                   integer               not null,
  131.     Solution                 char(32767)                   ,
  132.     Type_id                  integer               not null,
  133.     Type                     char(100)             not null,
  134.     primary key (Acc_id, Type_id)
  135. );
  136.  
  137.  
  138. %% ============================================================
  139. %%   Table: TC_GLOSSARY                                        
  140. %% ============================================================
  141. create table dba.TC_GLOSSARY
  142. (
  143.     Acc_id                   integer               not null,
  144.     Glo_id                   integer               not null,
  145.     primary key (Acc_id, Glo_id)
  146. );
  147.  
  148. %% ============================================================
  149. %%   Table: RANGE                                              
  150. %% ============================================================
  151. create table dba.RANGE
  152. (
  153.     Range_id                 integer               not null,
  154.     Per_id                   integer               not null,
  155.     LowIpAddr                integer                       ,
  156.     HighIpAddr               integer                       ,
  157.     Include                  integer                       ,
  158.     primary key (Range_id, Per_id)
  159. );
  160.  
  161. %% ============================================================
  162. %%   Table: SESSION                                            
  163. %% ============================================================
  164. create table dba.SESSION
  165. (
  166.     Ses_id                   integer               not null,
  167.     Pol_id                   integer               not null,
  168.     Per_id                   integer               not null,
  169.     Session                  char(32767)           not null,
  170.     Type                     integer               not null,
  171.     CrDate                   timestamp             not null,
  172.     LastDate                 timestamp             not null,
  173.     LastJob_id               integer               not null,
  174.     ScActive                 smallint              not null,
  175.     ScJobTime                timestamp             not null,
  176.     ScDaySom                 integer               not null,
  177.     ScDaySow                 integer               not null,
  178.     ScFlags                  integer               not null,
  179.     ScArgs                   char(32767)           not null,
  180.     Predefined               smallint              not null,
  181.     primary key (Ses_id)
  182. );
  183. %% ============================================================
  184. %%   Table: PROP_VALUE                                         
  185. %% ============================================================
  186. create table dba.PROP_VALUE
  187. (
  188.     Pro_id                   integer               not null,
  189.     ClsType_id               integer               not null,
  190.     ClsType                 char(50)                      ,
  191.     Obj_id             integer           not null,    
  192.     Value                    char(254)                     ,    
  193.     DfltValue                char(254)                     ,
  194.     primary key (Pro_id, ClsType_id,Obj_id)
  195. );
  196.  
  197. %% ============================================================
  198. %%   Table: JOB                                                
  199. %% ============================================================
  200. create table dba.JOB
  201. (
  202.     Job_id                   integer               not null,
  203.     Ses_id                   integer               not null,
  204.     CrDate                   timestamp             not null,
  205.     primary key (Job_id)
  206. );
  207.  
  208. %% ============================================================
  209. %%   Table: TC_REALIMPACT                                      
  210. %% ============================================================
  211. create table dba.TC_REALIMPACT
  212. (
  213.     Acc_id                   integer               not null,
  214.     RealImpact_id            integer               not null,
  215.     primary key (Acc_id, RealImpact_id)
  216. );
  217.  
  218. %% ============================================================
  219. %%   Table: HOST                                               
  220. %% ============================================================
  221. create table dba.HOST
  222. (
  223.     Host_id                  integer               not null,
  224.     IpAddr                   integer               not null,
  225.     LastDate                 timestamp             not null,
  226.     DnsName                  varchar(50)           not null,
  227.     NtbName                  varchar(50)           not null,
  228.     Type                     integer               not null,
  229.     primary key (Host_id)
  230. );
  231.  
  232. %% ============================================================
  233. %%   Table: JOB_HOST                                           
  234. %% ============================================================
  235. create table dba.JOB_HOST
  236. (
  237.     Job_id                   integer               not null,
  238.     Host_id                  integer               not null,
  239.     Type                     integer                       ,
  240.     Probe                    integer                       ,
  241.     HostStatus_id            integer                       ,
  242.     HostStatus               char(50)                      ,
  243.     primary key (Job_id, Host_id)
  244. );
  245.  
  246. %% ============================================================
  247. %%   Table: SERVICE                                            
  248. %% ============================================================
  249. create table dba.SERVICE
  250. (
  251.     Service_id               integer               not null,
  252.     Host_id                  integer                       ,
  253.     Wks_id                   integer                       ,
  254.     RealPort                 integer                       ,
  255.     Job_id                   integer               not null,
  256.     primary key (Service_id, Job_id)
  257. );
  258.  
  259. %% ============================================================
  260. %%   Table: TCRESULT                                           
  261. %% ============================================================
  262. create table dba.TCRESULT
  263. (
  264.     Tcr_id                   integer               not null
  265.         default autoincrement,
  266.     Acc_id                   integer               not null,
  267.     Service_id               integer               not null,
  268.     ResultCode_id            integer                       ,
  269.     ResultCode               varchar(50)                   ,
  270.     DtBegin                  timestamp                     ,
  271.     DtEnd                    timestamp                     ,
  272.     Host_id                  integer                       ,
  273.     Job_id                   integer                       ,
  274.     primary key (Tcr_id)
  275. );
  276.  
  277. %% ============================================================
  278. %%   Table: PROPERTY                                           
  279. %% ============================================================
  280. create table dba.PROPERTY
  281. (
  282.     Pro_id                   integer               not null,
  283.     ClsType_id             integer           not null,    
  284.     ClsType             char(50)               ,                 
  285.     PropertyName             char(50)                      ,
  286.     Type                     integer                       ,
  287.     Flags                    integer                       ,
  288.     PropertyDescription      char(32767)                   ,
  289.     DfltValue                char(50)                      ,
  290.     MinVal                   integer                       ,
  291.     MaxVal                   integer                       ,
  292.     primary key (Pro_id,ClsType_id)
  293. );
  294.  
  295. %% ============================================================
  296. %%   Table: TESTCASE                                           
  297. %% ============================================================
  298. create table dba.TESTCASE
  299. (
  300.     Acc_id                   integer               not null
  301.         default autoincrement,
  302.     Tca_id                   integer               not null
  303.         default autoincrement,
  304.     Wks_id                   integer                       ,
  305.     WksDflt_id               integer                       ,
  306.     TestcaseName             char(255)                     ,
  307.     VulnerabilityDescription char(32767)                   ,
  308.     Copyright                char(255)                     ,
  309.     DtPub                    char(255)                     ,
  310.     TestMethod               char(32767)                   ,
  311.     TestMethodSoft           char(32767)                   ,
  312.     LastPublication          date                          ,
  313.     FollowupUrgency          char(255)                     ,
  314.     FollowupUrgency_id       integer                       ,
  315.     HighLevelDesc            char(32767)                   ,
  316.     NatFollowUp              char(255)                     ,
  317.     RiskDescription          char(32767)                   ,
  318.     Level_id                 integer                       ,
  319.     Level                    char(255)                     ,
  320.     Ref                      char(32767)                   ,
  321.     Impact_id                integer                       ,
  322.     Impact                   char(255)                     ,
  323.     Active                   integer                       ,
  324.     Flags                    integer                       ,
  325.     Product                  smallint                      
  326.         default 0,
  327.     Keywords                 char(255)                     ,
  328.     Cve                      char(255)                     ,
  329.     Chain                    char(32767)                   ,
  330.     Timeout                  integer                       ,
  331.     Mod_id                   integer                       
  332.         default autoincrement,
  333.     primary key (Acc_id)
  334. );
  335.  
  336. %% ============================================================
  337. %%   Table: JOB_RANGE                                          
  338. %% ============================================================
  339. create table dba.JOB_RANGE
  340. (
  341.     Range_id                 integer               not null,
  342.     Per_id                   integer               not null,
  343.     Job_id                   integer               not null,
  344.     Host_id                  integer               not null,
  345.     primary key (Range_id, Job_id, Host_id)
  346. );
  347.  
  348. %% ============================================================
  349. %%   Table: POLICYDESC                                         
  350. %% ============================================================
  351. create table dba.POLICYDESC
  352. (
  353.     Pol_id                   integer               not null,
  354.     Type                     integer               not null,
  355.     Value                    integer               not null,
  356.     Include                  smallint              not null,
  357.     primary key (Pol_id, Type, Value)
  358. );
  359.