nasl-pedant 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/Rakefile +38 -0
  2. data/bin/pedant +1 -1
  3. data/lib/pedant.rb +3 -1
  4. data/lib/pedant/check.rb +20 -12
  5. data/lib/pedant/checks/conditional_or_loop_is_empty.rb +1 -1
  6. data/lib/pedant/checks/contains_ip_address_literals.rb +1 -1
  7. data/lib/pedant/checks/contains_no_carriage_returns.rb +1 -1
  8. data/lib/pedant/checks/contains_no_tabs.rb +1 -1
  9. data/lib/pedant/checks/contains_registration_section.rb +10 -4
  10. data/lib/pedant/checks/contains_unreachable_code.rb +2 -2
  11. data/lib/pedant/checks/ends_with_newline.rb +1 -1
  12. data/lib/pedant/checks/{files_parse_without_error.rb → files_parse_without_errors.rb} +1 -1
  13. data/lib/pedant/checks/local_variable_unused.rb +51 -0
  14. data/lib/pedant/checks/parse_test_code.rb +1 -1
  15. data/lib/pedant/checks/plugin_type_not_specified.rb +4 -3
  16. data/lib/pedant/checks/script_category.rb +111 -0
  17. data/lib/pedant/checks/script_family_not_specified.rb +53 -16
  18. data/lib/pedant/checks/script_id.rb +115 -0
  19. data/lib/pedant/checks/script_name.rb +133 -0
  20. data/lib/pedant/checks/script_summary.rb +142 -0
  21. data/lib/pedant/cli.rb +41 -31
  22. data/lib/pedant/command.rb +16 -29
  23. data/lib/pedant/commands/check.rb +105 -6
  24. data/lib/pedant/commands/test.rb +24 -2
  25. data/lib/pedant/knowledge_base.rb +1 -1
  26. data/lib/pedant/test.rb +5 -5
  27. data/lib/pedant/version.rb +1 -1
  28. data/pedant.gemspec +33 -6
  29. data/test/test_helper.rb +26 -0
  30. data/test/unit/checks/test_conditional_or_loop_is_empty.rb +1 -1
  31. data/test/unit/checks/test_contains_ip_address_literals.rb +1 -1
  32. data/test/unit/checks/test_contains_no_carriage_returns.rb +1 -1
  33. data/test/unit/checks/test_contains_no_tabs.rb +1 -1
  34. data/test/unit/checks/test_contains_registration_section.rb +17 -1
  35. data/test/unit/checks/test_contains_unreachable_code.rb +11 -1
  36. data/test/unit/checks/test_ends_with_newline.rb +1 -1
  37. data/test/unit/checks/test_plugin_type_not_specified.rb +9 -1
  38. data/test/unit/checks/test_script_family_not_specified.rb +54 -13
  39. metadata +30 -20
@@ -1,5 +1,5 @@
1
1
  ################################################################################
2
- # Copyright (c) 2011, Mak Kolybabi
2
+ # Copyright (c) 2011-2014, Tenable Network Security
3
3
  # All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without
@@ -1,5 +1,5 @@
1
1
  ################################################################################
2
- # Copyright (c) 2011-2012, Mak Kolybabi
2
+ # Copyright (c) 2011-2014, Tenable Network Security
3
3
  # All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without
@@ -69,4 +69,12 @@ class TestPluginTypeNotSpecified < Test::Unit::TestCase
69
69
  %q|script_set_attribute(attribute:"plugin_type", value:"foo");|
70
70
  )
71
71
  end
72
+
73
+ def test_indexed
74
+ check(
75
+ :fail,
76
+ :CheckPluginTypeNotSpecified,
77
+ %q|script_set_attribute.foo(attribute:"plugin_type", value:"foo");|
78
+ )
79
+ end
72
80
  end
@@ -54,19 +54,52 @@ class TestScriptFamilyNotSpecified < Test::Unit::TestCase
54
54
 
55
55
  def test_valid
56
56
  [
57
- "AIX Local Security Checks", "Backdoors", "Brute force attacks",
58
- "CentOS Local Security Checks", "CGI abuses", "CISCO", "Databases",
59
- "Debian Local Security Checks", "Default Unix Accounts",
60
- "Denial of Service", "DNS", "Fedora Local Security Checks",
61
- "Finger abuses", "Firewalls", "FTP", "Gain a shell remotely",
62
- "General", "Gentoo Local Security Checks", "HP-UX Local Security Checks",
63
- "MacOS X Local Security Checks", "Mandriva Local Security Checks",
64
- "Misc.", "Netware", "Peer-To-Peer File Sharing", "Port scanners",
65
- "Red Hat Local Security Checks", "RPC", "SCADA", "Service detection",
66
- "Settings", "Slackware Local Security Checks", "SMTP problems",
67
- "SNMP", "Solaris Local Security Checks", "SuSE Local Security Checks",
68
- "Ubuntu Local Security Checks", "VMware ESX Local Security Checks",
69
- "Web Servers", "Windows"
57
+ "AIX Local Security Checks",
58
+ "Backdoors",
59
+ "Brute force attacks",
60
+ "CentOS Local Security Checks",
61
+ "CGI abuses",
62
+ "CGI abuses : XSS",
63
+ "CISCO",
64
+ "Databases",
65
+ "Debian Local Security Checks",
66
+ "Default Unix Accounts",
67
+ "Denial of Service",
68
+ "DNS",
69
+ "Fedora Local Security Checks",
70
+ "Firewalls",
71
+ "FreeBSD Local Security Checks",
72
+ "FTP",
73
+ "Gain a shell remotely",
74
+ "General",
75
+ "Gentoo Local Security Checks",
76
+ "HP-UX Local Security Checks",
77
+ "Junos Local Security Checks",
78
+ "MacOS X Local Security Checks",
79
+ "Mandriva Local Security Checks",
80
+ "Misc.",
81
+ "Mobile Devices",
82
+ "Netware",
83
+ "Peer-To-Peer File Sharing",
84
+ "Policy Compliance",
85
+ "Port scanners",
86
+ "Red Hat Local Security Checks",
87
+ "RPC",
88
+ "SCADA",
89
+ "Scientific Linux Local Security Checks",
90
+ "Service detection",
91
+ "Settings",
92
+ "Slackware Local Security Checks",
93
+ "SMTP problems",
94
+ "SNMP",
95
+ "Solaris Local Security Checks",
96
+ "SuSE Local Security Checks",
97
+ "Ubuntu Local Security Checks",
98
+ "VMware ESX Local Security Checks",
99
+ "Web Servers",
100
+ "Windows",
101
+ "Windows : Microsoft Bulletins",
102
+ "Windows : User management"
70
103
  ].each do |type|
71
104
  check(
72
105
  :pass,
@@ -83,4 +116,12 @@ class TestScriptFamilyNotSpecified < Test::Unit::TestCase
83
116
  %q|script_family("foo bar");|
84
117
  )
85
118
  end
119
+
120
+ def test_indexed
121
+ check(
122
+ :fail,
123
+ :CheckScriptFamilyNotSpecified,
124
+ %q|script_family.foo("Windows");|
125
+ )
126
+ end
86
127
  end
metadata CHANGED
@@ -1,22 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nasl-pedant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mak Kolybabi
9
+ - Alex Weber
10
+ - Jacob Hammack
9
11
  autorequire:
10
12
  bindir: bin
11
13
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
14
+ date: 2014-08-28 00:00:00.000000000 Z
13
15
  dependencies:
14
16
  - !ruby/object:Gem::Dependency
15
17
  name: rake
16
18
  requirement: !ruby/object:Gem::Requirement
17
19
  none: false
18
20
  requirements:
19
- - - ! '>='
21
+ - - ~>
20
22
  - !ruby/object:Gem::Version
21
23
  version: '0'
22
24
  type: :development
@@ -24,7 +26,7 @@ dependencies:
24
26
  version_requirements: !ruby/object:Gem::Requirement
25
27
  none: false
26
28
  requirements:
27
- - - ! '>='
29
+ - - ~>
28
30
  - !ruby/object:Gem::Version
29
31
  version: '0'
30
32
  - !ruby/object:Gem::Dependency
@@ -32,36 +34,44 @@ dependencies:
32
34
  requirement: !ruby/object:Gem::Requirement
33
35
  none: false
34
36
  requirements:
35
- - - ! '>='
37
+ - - '='
36
38
  - !ruby/object:Gem::Version
37
- version: '0'
39
+ version: 2.0.0
38
40
  type: :runtime
39
41
  prerelease: false
40
42
  version_requirements: !ruby/object:Gem::Requirement
41
43
  none: false
42
44
  requirements:
43
- - - ! '>='
45
+ - - '='
44
46
  - !ruby/object:Gem::Version
45
- version: '0'
47
+ version: 2.0.0
46
48
  - !ruby/object:Gem::Dependency
47
49
  name: nasl
48
50
  requirement: !ruby/object:Gem::Requirement
49
51
  none: false
50
52
  requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '0.2'
51
56
  - - ! '>='
52
57
  - !ruby/object:Gem::Version
53
- version: 0.0.7
58
+ version: 0.2.0
54
59
  type: :runtime
55
60
  prerelease: false
56
61
  version_requirements: !ruby/object:Gem::Requirement
57
62
  none: false
58
63
  requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: '0.2'
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
- version: 0.0.7
62
- description:
69
+ version: 0.2.0
70
+ description: A static analysis framework for the Nessus Attack Scripting Language.
63
71
  email:
64
72
  - mak@kolybabi.com
73
+ - aweber@tenable.com
74
+ - jhammack@tenable.com
65
75
  executables:
66
76
  - pedant
67
77
  extensions: []
@@ -80,10 +90,15 @@ files:
80
90
  - lib/pedant/checks/contains_registration_section.rb
81
91
  - lib/pedant/checks/contains_unreachable_code.rb
82
92
  - lib/pedant/checks/ends_with_newline.rb
83
- - lib/pedant/checks/files_parse_without_error.rb
93
+ - lib/pedant/checks/files_parse_without_errors.rb
94
+ - lib/pedant/checks/local_variable_unused.rb
84
95
  - lib/pedant/checks/parse_test_code.rb
85
96
  - lib/pedant/checks/plugin_type_not_specified.rb
97
+ - lib/pedant/checks/script_category.rb
86
98
  - lib/pedant/checks/script_family_not_specified.rb
99
+ - lib/pedant/checks/script_id.rb
100
+ - lib/pedant/checks/script_name.rb
101
+ - lib/pedant/checks/script_summary.rb
87
102
  - lib/pedant/cli.rb
88
103
  - lib/pedant/command.rb
89
104
  - lib/pedant/commands/check.rb
@@ -115,24 +130,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
130
  - - ! '>='
116
131
  - !ruby/object:Gem::Version
117
132
  version: '0'
118
- segments:
119
- - 0
120
- hash: -4147162296377566136
121
133
  required_rubygems_version: !ruby/object:Gem::Requirement
122
134
  none: false
123
135
  requirements:
124
136
  - - ! '>='
125
137
  - !ruby/object:Gem::Version
126
138
  version: '0'
127
- segments:
128
- - 0
129
- hash: -4147162296377566136
130
139
  requirements: []
131
140
  rubyforge_project: nasl-pedant
132
- rubygems_version: 1.8.24
141
+ rubygems_version: 1.8.23
133
142
  signing_key:
134
143
  specification_version: 3
135
- summary: A static analysis framework for the Nessus Attack Scripting Language.
144
+ summary: A framework for the Nessus Attack Scripting Language.
136
145
  test_files:
137
146
  - test/test_helper.rb
138
147
  - test/unit/checks/test_conditional_or_loop_is_empty.rb
@@ -144,3 +153,4 @@ test_files:
144
153
  - test/unit/checks/test_ends_with_newline.rb
145
154
  - test/unit/checks/test_plugin_type_not_specified.rb
146
155
  - test/unit/checks/test_script_family_not_specified.rb
156
+ has_rdoc: