Skip to content

Commit 6e29ba1

Browse files
hemantskcaphrim007
authored andcommitted
14.0.0 Protocol Inspection Profile Status, Learning_Suggestions, Staging, Flowspec, Shared Objects (#1491)
* Protocol Inspection Profile Status, Learning_Suggestions, Staging * Flatrock: Flowspec * Flatrock: Adding support for shared_objects * Flatrock: Flowspec-updated * Added version for Protocol Inspection Learning, Staging * Flatrock: Adding support for shared_objects * Added version Scrubbing, FlowSpec, Protected Objects, Blacklist Publisher
1 parent 1c111be commit 6e29ba1

20 files changed

Lines changed: 2593 additions & 5 deletions

f5/bigip/tm/security/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@
2929

3030
from f5.bigip.resource import OrganizingCollection
3131
from f5.bigip.tm.security.analytics import Analytics
32+
from f5.bigip.tm.security.blacklist_publisher import Blacklist_Publisher
3233
from f5.bigip.tm.security.dos import Dos
3334
from f5.bigip.tm.security.firewall import Firewall
35+
from f5.bigip.tm.security.flowspec_route_injector import Flowspec_Route_Injector
3436
from f5.bigip.tm.security.ip_intelligence import Ip_Intelligence
3537
from f5.bigip.tm.security.log import Log
3638
from f5.bigip.tm.security.nat import Nat
39+
from f5.bigip.tm.security.protected_servers import Protected_Servers
3740
from f5.bigip.tm.security.protocol_inspection import Protocol_Inspection
41+
from f5.bigip.tm.security.scrubber import Scrubber
42+
from f5.bigip.tm.security.shared_objects import Shared_Objects
3843

3944

4045
class Security(OrganizingCollection):
@@ -44,10 +49,15 @@ def __init__(self, tm):
4449
super(Security, self).__init__(tm)
4550
self._meta_data['allowed_lazy_attributes'] = [
4651
Analytics,
52+
Blacklist_Publisher,
4753
Dos,
4854
Firewall,
55+
Flowspec_Route_Injector,
4956
Ip_Intelligence,
5057
Log,
5158
Nat,
59+
Protected_Servers,
5260
Protocol_Inspection,
53-
]
61+
Scrubber,
62+
Shared_Objects,
63+
]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# coding=utf-8
2+
#
3+
# Copyright 2015-2017 F5 Networks Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
"""BIG-IP® Advanced Firewall Manager™ (AFM®) module.
19+
20+
REST URI
21+
``http://localhost/mgmt/tm/security/blacklist-publisher``
22+
23+
GUI Path
24+
``Security --> Option --> Network Firewall --> External Redirection
25+
--> Blacklist Publisher``
26+
27+
REST Kind
28+
``tm:security:blacklist-publisher:blacklist-publishercollectionstate:*``
29+
"""
30+
31+
from f5.bigip.resource import Collection
32+
from f5.bigip.resource import OrganizingCollection
33+
from f5.bigip.resource import Resource
34+
35+
36+
class Blacklist_Publisher(OrganizingCollection):
37+
"""BIG-IP® AFM® Blacklist Publisher organizing collection."""
38+
39+
def __init__(self, security):
40+
super(Blacklist_Publisher, self).__init__(security)
41+
self._meta_data['allowed_lazy_attributes'] = [
42+
Category_s,
43+
Profile_s]
44+
45+
46+
class Category_s(Collection):
47+
"""BIG-IP® AFM® Blacklist Publisher Category collection"""
48+
49+
def __init__(self, blacklist_publisher):
50+
super(Category_s, self).__init__(blacklist_publisher)
51+
self._meta_data['allowed_lazy_attributes'] = [Category]
52+
self._meta_data['attribute_registry'] = \
53+
{'tm:security:blacklist-publisher:category:categorystate':
54+
Category}
55+
56+
57+
class Category(Resource):
58+
"""BIG-IP® AFM® Blacklist Publisher Category resource"""
59+
60+
def __init__(self, category_s):
61+
super(Category, self).__init__(category_s)
62+
self._meta_data['required_json_kind'] = \
63+
'tm:security:blacklist-publisher:category:categorystate'
64+
self._meta_data['required_creation_parameters'].update(('partition', 'name'))
65+
self._meta_data['required_load_parameters'].update(('partition', 'name'))
66+
67+
68+
class Profile_s(Collection):
69+
"""BIG-IP® AFM® Blacklist Publisher Profile collection"""
70+
71+
def __init__(self, blacklist_publisher):
72+
super(Profile_s, self).__init__(blacklist_publisher)
73+
self._meta_data['allowed_lazy_attributes'] = [Profile]
74+
self._meta_data['attribute_registry'] = \
75+
{'tm:security:blacklist-publisher:profile:profilestate':
76+
Profile}
77+
78+
79+
class Profile(Resource):
80+
"""BIG-IP® AFM® Blacklist Publisher Profile resource"""
81+
82+
def __init__(self, profile_s):
83+
super(Profile, self).__init__(profile_s)
84+
self._meta_data['required_json_kind'] = \
85+
'tm:security:blacklist-publisher:profile:profilestate'
86+
self._meta_data['required_creation_parameters'].update(('partition', 'name'))
87+
self._meta_data['required_load_parameters'].update(('partition', 'name'))
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# coding=utf-8
2+
#
3+
# Copyright 2015-2017 F5 Networks Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
"""BIG-IP® Advanced Firewall Manager™ (AFM®) module.
19+
20+
REST URI
21+
``http://localhost/mgmt/tm/security/flowspec-route-injector``
22+
23+
GUI Path
24+
``Security --> Option --> Network Firewall --> External Redirection
25+
--> Flowspec Route Injector``
26+
27+
REST Kind
28+
``tm:security:flowspec-route-injector:flowspec-route-injectorcollectionstate:*``
29+
"""
30+
31+
from f5.bigip.resource import Collection
32+
from f5.bigip.resource import OrganizingCollection
33+
from f5.bigip.resource import Resource
34+
35+
36+
class Flowspec_Route_Injector(OrganizingCollection):
37+
"""BIG-IP® AFM® Flowspec Route Injector organizing collection."""
38+
39+
def __init__(self, security):
40+
super(Flowspec_Route_Injector, self).__init__(security)
41+
self._meta_data['allowed_lazy_attributes'] = [Profile_s]
42+
43+
44+
class Profile_s(Collection):
45+
"""BIG-IP® AFM® Flowspec Route Injector Profile collection"""
46+
47+
def __init__(self, flowspec_route_injector):
48+
super(Profile_s, self).__init__(flowspec_route_injector)
49+
self._meta_data['allowed_lazy_attributes'] = [Profile]
50+
self._meta_data['attribute_registry'] = \
51+
{'tm:security:flowspec-route-injector:profile:profilestate':
52+
Profile}
53+
54+
55+
class Profile(Resource):
56+
"""BIG-IP® AFM® Flowspec Route Injector Profile resource"""
57+
58+
def __init__(self, profile_s):
59+
super(Profile, self).__init__(profile_s)
60+
self._meta_data['required_json_kind'] = \
61+
'tm:security:flowspec-route-injector:profile:profilestate'
62+
self._meta_data['required_creation_parameters'].update(('partition', 'name', 'routeDomain', 'neighbor'))
63+
self._meta_data['required_load_parameters'].update(('partition', 'name'))
64+
self._meta_data['allowed_lazy_attributes'] = [Neighbor_s]
65+
self._meta_data['attribute_registry'] = \
66+
{'tm:security:flowspec-route-injector:profile:neighbor:neighborcollectionstate':
67+
Neighbor_s}
68+
69+
70+
class Neighbor_s(Collection):
71+
"""BIG-IP® AFM® Flowspec Route Injector Neighbor collection"""
72+
73+
def __init__(self, profile):
74+
super(Neighbor_s, self).__init__(profile)
75+
self._meta_data['required_json_kind'] = \
76+
'tm:security:flowspec-route-injector:profile:neighbor:neighborcollectionstate'
77+
self._meta_data['allowed_lazy_attributes'] = [Neighbor]
78+
self._meta_data['attribute_registry'] = \
79+
{'tm:security:flowspec-route-injector:profile:neighbor:neighborstate':
80+
Neighbor}
81+
82+
83+
class Neighbor(Resource):
84+
"""BIG-IP® AFM® Flowspec Route Injector Neighbor resource"""
85+
86+
def __init__(self, neighbor_s):
87+
super(Neighbor, self).__init__(neighbor_s)
88+
self._meta_data['required_json_kind'] = \
89+
'tm:security:flowspec-route-injector:profile:neighbor:neighborstate'
90+
self._meta_data['required_creation_parameters'].update(('name', 'local-address', 'local-as', 'remote-as'))
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# coding=utf-8
2+
#
3+
# Copyright 2015-2017 F5 Networks Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
"""BIG-IP® Advanced Firewall Manager™ (AFM®) module.
19+
20+
REST URI
21+
``http://localhost/mgmt/tm/security/protected-servers``
22+
23+
GUI Path
24+
``Security --> DoS Protection --> Protected Objects``
25+
26+
REST Kind
27+
``tm:security:protected-servers:protected-serverscollectionstate:*``
28+
"""
29+
30+
from f5.bigip.resource import Collection
31+
from f5.bigip.resource import OrganizingCollection
32+
from f5.bigip.resource import Resource
33+
34+
35+
class Protected_Servers(OrganizingCollection):
36+
"""BIG-IP® AFM® Protected servers organizing collection."""
37+
38+
def __init__(self, security):
39+
super(Protected_Servers, self).__init__(security)
40+
self._meta_data['allowed_lazy_attributes'] = [
41+
Traffic_Matching_Criteria_s,
42+
Netflow_Protected_Server_s]
43+
44+
45+
class Traffic_Matching_Criteria_s(Collection):
46+
"""BIG-IP® AFM® Traffic Matching Criteria collection"""
47+
48+
def __init__(self, protected_servers):
49+
super(Traffic_Matching_Criteria_s, self).__init__(protected_servers)
50+
self._meta_data['allowed_lazy_attributes'] = [Traffic_Matching_Criteria]
51+
self._meta_data['attribute_registry'] = \
52+
{'tm:security:protected-servers:traffic-matching-criteria:traffic-matching-criteriastate':
53+
Traffic_Matching_Criteria}
54+
55+
56+
class Traffic_Matching_Criteria(Resource):
57+
"""BIG-IP® AFM® Traffic Matching Criteria resource"""
58+
59+
def __init__(self, traffic_matching_criteria_s):
60+
super(Traffic_Matching_Criteria, self).__init__(traffic_matching_criteria_s)
61+
self._meta_data['required_json_kind'] = \
62+
'tm:security:protected-servers:traffic-matching-criteria:traffic-matching-criteriastate'
63+
self._meta_data['required_creation_parameters'].update(('partition', ))
64+
65+
66+
class Netflow_Protected_Server_s(Collection):
67+
"""BIG-IP® AFM® Netflow Protected Server collection"""
68+
69+
def __init__(self, protected_servers):
70+
super(Netflow_Protected_Server_s, self).__init__(protected_servers)
71+
self._meta_data['allowed_lazy_attributes'] = [Netflow_Protected_Server]
72+
self._meta_data['attribute_registry'] = \
73+
{'tm:security:protected-servers:netflow-protected-server:netflow-protected-serverstate':
74+
Netflow_Protected_Server}
75+
76+
77+
class Netflow_Protected_Server(Resource):
78+
"""BIG-IP® AFM® Netflow Protected Server resource"""
79+
80+
def __init__(self, netflow_protected_server_s):
81+
super(Netflow_Protected_Server, self).__init__(netflow_protected_server_s)
82+
self._meta_data['required_json_kind'] = \
83+
'tm:security:protected-servers:netflow-protected-server:netflow-protected-serverstate'
84+
self._meta_data['required_creation_parameters'].update(('name', 'trafficMatchingCriteria', 'partition'))

f5/bigip/tm/security/protocol_inspection.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
``tm:security:protocol-inspection*``
3030
"""
3131

32+
from f5.bigip.mixins import CommandExecutionMixin
3233
from f5.bigip.resource import Collection
3334
from f5.bigip.resource import OrganizingCollection
3435
from f5.bigip.resource import Resource
36+
from f5.bigip.resource import UnnamedResource
3537
from f5.sdk_exception import UnsupportedMethod
3638

3739

@@ -42,7 +44,10 @@ def __init__(self, security):
4244
self._meta_data['allowed_lazy_attributes'] = [
4345
Profiles,
4446
Compliances,
47+
Profile_Status,
48+
Learning_Suggestions,
4549
Signatures,
50+
Staging
4651
]
4752

4853

@@ -98,6 +103,47 @@ def modify(self, **kwargs):
98103
)
99104

100105

106+
class Learning_Suggestions(UnnamedResource, CommandExecutionMixin):
107+
"""BIG-IP® Protocol Inspection Compliance resource"""
108+
def __init__(self, protocol_inspection):
109+
super(Learning_Suggestions, self).__init__(protocol_inspection)
110+
self._meta_data['obj_has_stats'] = True
111+
self._meta_data['required_load_parameters'] = set()
112+
self._meta_data['required_json_kind'] = \
113+
'tm:security:protocol-inspection:learning-suggestion:learning-suggestionsstats'
114+
self._meta_data['allowed_commands'].append('publish')
115+
self._meta_data['allowed_commands'].append('delete')
116+
117+
118+
class Staging(UnnamedResource, CommandExecutionMixin):
119+
"""BIG-IP® Protocol Inspection Compliance resource"""
120+
def __init__(self, protocol_inspection):
121+
super(Staging, self).__init__(protocol_inspection)
122+
self._meta_data['obj_has_stats'] = True
123+
self._meta_data['required_load_parameters'] = set()
124+
self._meta_data['required_json_kind'] = \
125+
'tm:security:protocol-inspection:staging:stagingstats'
126+
self._meta_data['allowed_commands'].append('start')
127+
self._meta_data['allowed_commands'].append('stop')
128+
129+
130+
class Profile_Status(UnnamedResource):
131+
"""BIG-IP® Protocol Inspection Compliance resource"""
132+
def __init__(self, protocol_inspection):
133+
super(Profile_Status, self).__init__(protocol_inspection)
134+
self._meta_data['obj_has_stats'] = True
135+
self._meta_data['required_json_kind'] = \
136+
'tm:security:protocol-inspection:profile-status:profile-statusstats'
137+
138+
def update(self, **kwargs):
139+
'''Update is not supported.
140+
141+
:raises: :exc:`~f5.BIG-IP.resource.UnsupportedMethod`
142+
'''
143+
raise UnsupportedMethod(
144+
'Stats do not support create, only load and refresh')
145+
146+
101147
class Signatures(Collection):
102148
"""BIG-IP® Protocol Inspection Signature collection"""
103149
def __init__(self, protocol_inspection):

0 commit comments

Comments
 (0)