Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for extra Azure resources + their role assignments #628

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions src/components/SearchContainer/TabContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import BaseNodeData from "./Tabs/BaseNodeData";
import ContainerNodeData from "./Tabs/ContainerNodeData";
import AZManagementGroupNodeData from "./Tabs/AZManagementGroupNodeData";
import AZRoleNodeData from "./Tabs/AZRoleNodeData";
import AZStorageAccountNodeData from './Tabs/AZStorageAccountNodeData';
import AZStorageContainerNodeData from './Tabs/AZStorageContainerNodeData';

class TabContainer extends Component {

Expand Down Expand Up @@ -64,6 +66,11 @@ class TabContainer extends Component {
azTenantVisible: false,
azVMVisible: false,
azServicePrincipalVisible: false,
azStorageAccountVisible: false,
azStorageContainerVisible: false,
azAutomationAccountVisible: false,
azLogicAppVisible: false,
azWebAppVisible: false,
azAppVisible: false,
azManagementGroupVisible: false,
azRoleVisible: false,
Expand Down Expand Up @@ -136,7 +143,18 @@ class TabContainer extends Component {
this._azManagementGroupNodeClicked()
} else if (type === 'AZRole') {
this._azRoleNodeClicked()
} else if (type === 'AZStorageAccount') {
this._azStorageAccountNodeClicked();
} else if (type === 'AZStorageContainer') {
this._azStorageContainerNodeClicked();
} else if (type === 'AZAutomationAccount') {
this._azAutomationAccountNodeClicked();
} else if (type === 'AZLogicApp') {
this._azLogicAppNodeClicked();
} else if (type === 'AZWebApp') {
this._azWebAppNodeClicked();
}

}

componentDidMount() {
Expand Down Expand Up @@ -369,6 +387,46 @@ class TabContainer extends Component {
});
}

_azStorageAccountNodeClicked() {
this.clearVisible()
this.setState({
azStorageAccountVisible: true,
selected: 2
});
}

_azStorageContainerNodeClicked() {
this.clearVisible()
this.setState({
azStorageContainerVisible: true,
selected: 2
});
}

_azAutomationAccountNodeClicked() {
this.clearVisible()
this.setState({
azAutomationAccountVisible: true,
selected: 2
});
}

_azLogicAppNodeClicked() {
this.clearVisible()
this.setState({
azLogicAppVisible: true,
selected: 2
});
}

_azWebAppNodeClicked() {
this.clearVisible()
this.setState({
azWebAppVisible: true,
selected: 2
});
}

_azAppNodeClicked() {
this.clearVisible()
this.setState({
Expand Down Expand Up @@ -421,6 +479,11 @@ class TabContainer extends Component {
!this.state.azTenantVisible &&
!this.state.azVMVisible &&
!this.state.azServicePrincipalVisible &&
!this.state.azStorageAccountVisble &&
!this.state.azStorageContainerVisble &&
!this.state.azAutomationAccountVisible &&
!this.state.azLogicAppVisible &&
!this.state.azWebAppVisible &&
!this.state.azAppVisible &&
!this.state.baseVisible &&
!this.state.azManagementGroupVisible &&
Expand Down Expand Up @@ -465,6 +528,11 @@ class TabContainer extends Component {
<AZServicePrincipalNodeData
visible={this.state.azServicePrincipalVisible}
/>
<AZStorageAccountNodeData visible={this.state.azStorageAccountVisble} />
<AZStorageContainerNodeData visible={this.state.azStorageContainerVisible} />
<AZAutomationAccountNodeData visible={this.state.azAutomationAccountVisible} />
<AZLogicAppNodeData visible={this.state.azLogicAppVisible} />
<AZWebAppNodeData visible={this.state.azWebAppVisible} />
<AZAppNodeData visible={this.state.azAppVisible} />
<AZManagementGroupNodeData visible={this.state.azManagementGroupVisible} />
<AZRoleNodeData visible={this.state.azRoleVisible} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,90 @@ const AZAutomationAccountNodeData = () => {
property='See Automation Account within Tenant'
query='MATCH p = (d:AZTenant)-[r:AZContains*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
/>
<NodeCypherLink
baseQuery={
'MATCH p=(:AZAutomationAccount {objectid:$objectid})-[:AZManagedIdentity]->(n)'
<NodeCypherNoNumberLink
target={objectid}
property='See Automation Account within Resource group'
query='MATCH p = (d:AZResourceGroup)-[r:AZContains*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p=(:AZAutomationAccount {objectid:$objectid})-[:AZManagedIdentity]->(n) RETURN COUNT(p)'
}
graphQuery={
'MATCH p=(:AZAutomationAccount {objectid:$objectid})-[:AZManagedIdentity]->(n) RETURN p'
}
start={label}
property={'Managed Identities'}
target={objectid}
distinct
/>
</tbody>
</Table>
</div>
</CollapsibleSection>

<hr></hr>

<MappedNodeProps
displayMap={displayMap}
properties={nodeProps}
label={label}
/>

<hr></hr>

<ExtraNodeProps
displayMap={displayMap}
properties={nodeProps}
label={label}
/>

<hr></hr>

<CollapsibleSection header='Role Assignments'>

<hr></hr>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:Owner*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:Owner*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
}
property={'Automation Account Owners'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:Contributor*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:Contributor*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
}
property={'Automation Account Contributors'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:UserAccessAdministrator*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:UserAccessAdministrator*1..]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
}
property={'User Access Administrators'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r]->(u:AZAutomationAccount {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r]->(u:AZAutomationAccount {objectid: $objectid}) RETURN p'
}
property={'All Relations'}
target={objectid}
/>
</CollapsibleSection>
<CollapsibleSection header={'INBOUND OBJECT CONTROL'}>
<div className={styles.itemlist}>
<Table>
Expand Down Expand Up @@ -141,7 +195,6 @@ const AZAutomationAccountNodeData = () => {
</Table>
</div>
</CollapsibleSection>

</div>
</div>
);
Expand Down
73 changes: 62 additions & 11 deletions src/components/SearchContainer/Tabs/AZLogicAppNodeData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,95 @@ const AZLogicAppNodeData = () => {
property='See Logic App within Tenant'
query='MATCH p = (d:AZTenant)-[r:AZContains*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
/>
<NodeCypherLink
baseQuery={
'MATCH p=(:AZLogicApp {objectid:$objectid})-[:AZManagedIdentity]->(n)'
<NodeCypherNoNumberLink
target={objectid}
property='See Logic App within Resource group'
query='MATCH p = (d:AZResourceGroup)-[r:AZContains*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p=(:AZLogicApp {objectid:$objectid})-[:AZManagedIdentity]->(n) RETURN COUNT(p)'
}
graphQuery={
'MATCH p=(:AZLogicApp {objectid:$objectid})-[:AZManagedIdentity]->(n) RETURN p'
}
start={label}
property={'Managed Identities'}
target={objectid}
distinct
/>
</tbody>
</Table>
</div>
</CollapsibleSection>

<hr></hr>

<MappedNodeProps
displayMap={displayMap}
properties={nodeProps}
label={label}
/>

<hr></hr>

<ExtraNodeProps
displayMap={displayMap}
properties={nodeProps}
label={label}
/>

<hr></hr>

<CollapsibleSection header={'INBOUND OBJECT CONTROL'}>
<CollapsibleSection header='Role Assignments'>
<div className={styles.itemlist}>
<Table>
<thead></thead>
<tbody className='searchable'>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:Owner*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:Owner*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
}
property={'Logic App Owners'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:Contributor*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:Contributor*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
}
property={'Logic App Contributors'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r:UserAccessAdministrator*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r:UserAccessAdministrator*1..]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
}
property={'User Access Administrators'}
target={objectid}
/>
<NodeCypherLinkComplex
countQuery={
'MATCH p = (d)-[r]->(u:AZLogicApp {objectid: $objectid}) RETURN COUNT(p)'
}
graphQuery={
'MATCH p = (d)-[r]->(u:AZLogicApp {objectid: $objectid}) RETURN p'
}
property={'All Relations'}
target={objectid}
/>
</tbody>
</Table>
</div>
</CollapsibleSection>
<hr></hr>
<CollapsibleSection header={'INBOUND OBJECT CONTROL'}>
<NodeCypherLink
property='Explicit Object Controllers'
target={objectid}
Expand Down Expand Up @@ -137,11 +191,8 @@ const AZLogicAppNodeData = () => {
end={label}
distinct
/>
</tbody>
</Table>
</div>
</CollapsibleSection>

</div>
</div>
);
Expand Down
Loading
Loading